opencode/packages/opencode
Developer b3c7d34dfb fix(httpapi): eliminate drift between runtime query schemas and OpenAPI params
Context: PR #26569 narrowly fixed a crash where the generated SDK sent
GET /session/{sessionID}/message?limit=80&directory=... because public.ts
manually injected InstanceQueryParameters (directory/workspace) into OpenAPI,
but the runtime MessagesQuery schema omitted directory, causing empty 400.

This change eliminates the drift by:

1. Creating a shared schema helper in query.ts that adds directory/workspace
   fields to all instance route query schemas.

2. Updating all instance route query schemas to use the helper:
   - session.ts: MessagesQuery, ListQuery
   - file.ts: FileQuery, FindTextQuery, FindFileQuery, FindSymbolQuery
   - experimental.ts: ToolListQuery, SessionListQuery
   - control.ts: LogQuery (already correct, now uses helper)
   - instance.ts, v2/session.ts, v2/message.ts

3. Adding reproducer tests in httpapi-query-schema-drift.test.ts that verify
   the runtime accepts directory/workspace params on affected routes.

The OpenAPI spec generation in public.ts still manually injects params for
backward compatibility with the legacy SDK format, but now the runtime
schemas match, eliminating the validation errors.

Verification:
- bun typecheck passes
- 4 drift reproducer tests pass
- 24 httpapi tests pass across session, file, experimental, workspace-routing
2026-05-09 16:12:02 -04:00
..
bin fix(cli): forward signals from npm shim (#26259) 2026-05-08 14:00:51 -05:00
migration fix(storage): default workspace time migration (#26556) 2026-05-09 14:18:55 -04:00
script refactor(server): split HttpApi exercise harness (#26385) 2026-05-08 17:58:14 +00:00
specs chore(server): clean up post-Hono-deletion scar tissue (#26542) 2026-05-09 12:30:18 -04:00
src fix(httpapi): eliminate drift between runtime query schemas and OpenAPI params 2026-05-09 16:12:02 -04:00
test fix(httpapi): eliminate drift between runtime query schemas and OpenAPI params 2026-05-09 16:12:02 -04:00
.gitignore refactor(httpapi): fork server startup by flag (#24799) 2026-04-28 11:02:35 -04:00
AGENTS.md Refactor HttpApi workspace routing and proxy boundaries (#25006) 2026-04-29 16:50:54 -04:00
BUN_SHELL_MIGRATION_PLAN.md sync 2026-02-25 01:48:10 -05:00
bunfig.toml tui plugins (#19347) 2026-03-27 15:00:26 +01:00
Dockerfile
drizzle.config.ts sqlite again (#10597) 2026-02-14 04:19:02 +00:00
git feat: interactive update flow for non-patch releases (#18662) 2026-03-22 23:12:40 +00:00
package.json sync release versions for v1.14.43 2026-05-09 18:06:16 +00:00
parsers-config.ts feat(tui): add syntax highlighting for kotlin, hcl, lua, toml (#18198) 2026-03-23 16:15:24 +01:00
README.md
sst-env.d.ts zen: update sst version 2026-02-18 13:54:23 -05:00
tsconfig.json core: remove @effect/language-service plugin and optimize hot path type performance 2026-04-30 23:21:05 -04:00

js

To install dependencies:

bun install

To run:

bun run index.ts

This project was created using bun init in bun v1.2.12. Bun is a fast all-in-one JavaScript runtime.