opencode/packages
Kit Langton da5e29b320 fix(server): read auth Config from Flag for HttpApi/Hono parity
HttpApi auth middleware was reading ServerAuth.Config via Effect's generated
defaultLayer, which resolves Config.string('OPENCODE_SERVER_PASSWORD') once
and is memoized by Layer identity. Subsequent runtime mutation of process.env
(or Flag.OPENCODE_SERVER_PASSWORD) was never observed, so the middleware kept
serving 401 even when auth was disabled at runtime.

Hono's AuthMiddleware reads Flag.OPENCODE_SERVER_PASSWORD per request, so it
picks up mutations immediately. With Hono still the production default and
HttpApi gated by OPENCODE_EXPERIMENTAL_HTTPAPI, the gap was masked by tests
that flipped the flag back to Hono for no-auth scenarios.

Override ServerAuth.Config.defaultLayer to read Flag.* via Layer.sync at
layer-build time. Each fresh listener (memoMap) picks up current Flag values.
This matches Hono behavior across listeners; per-request mutation within a
single listener is not preserved (would require reading Flag in the middleware
itself, which is a separate concern).

Tests:
- httpapi-listen: parameterize 'tickets optional when auth disabled' across
  both backends to lock in parity.
- httpapi-raw-route-auth + httpapi-ui: switch from ConfigProvider injection
  (which is now a no-op since defaultLayer is Flag-backed, not Config-backed)
  to ServerAuth.Config.layer({...}) for explicit overrides, or Flag mutation
  for tests that exercise the production read path.

46/46 auth + PTY tests pass.
2026-05-04 00:13:02 -04:00
..
app feat(server): pty websocket auth tickets (#25660) 2026-05-03 22:56:14 -04:00
console sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
containers chore: bump Bun to 1.3.13 (#23791) 2026-04-23 00:25:36 -04:00
core refactor(config+core): drop ConfigPaths.readFile, add AppFileSystem.readFileStringSafe, flatten TuiConfig.loadState (#25602) 2026-05-03 15:21:34 +00:00
desktop ci: only build electron desktop (#19067) 2026-05-03 19:10:15 +05:30
desktop-electron ci: only build electron desktop (#19067) 2026-05-03 19:10:15 +05:30
docs
enterprise sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
extensions/zed sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
function sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
identity
opencode fix(server): read auth Config from Flag for HttpApi/Hono parity 2026-05-04 00:13:02 -04:00
plugin sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
script refactor: replace bun semver with npm semver package 2026-03-09 15:29:55 -04:00
sdk chore: generate 2026-05-04 02:57:18 +00:00
slack sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
storybook feat(prompt): add shell mode UI with cancel button, custom icon, and example placeholder (#24105) 2026-04-24 14:04:55 +08:00
ui sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
web chore: generate 2026-05-03 00:10:53 +00:00