cloudaxe-opencode/packages/opencode/test/server
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
..
httpapi-exercise chore: generate 2026-05-09 13:11:45 +00:00
AGENTS.md test: cover HttpApi instance context middleware (#25032) 2026-04-29 21:24:45 -04:00
auth.test.ts fix(auth): respect server username in clients (#25596) 2026-05-03 19:28:31 +05:30
global-bus.ts test(httpapi): add route exerciser 2026-05-02 20:31:21 -04:00
global-session-list.test.ts Normalize instance lifecycle wiring (#25501) 2026-05-02 20:39:20 -04:00
httpapi-authorization.test.ts fix(server): include auth challenge on typed 401 (#26455) 2026-05-09 00:15:20 -04:00
httpapi-compression.test.ts research: delete Hono backend (do not merge) (#25667) 2026-05-09 13:10:42 +00:00
httpapi-config.test.ts chore: generate 2026-05-09 13:11:45 +00:00
httpapi-cors-vary.test.ts research: delete Hono backend (do not merge) (#25667) 2026-05-09 13:10:42 +00:00
httpapi-cors.test.ts research: delete Hono backend (do not merge) (#25667) 2026-05-09 13:10:42 +00:00
httpapi-event.test.ts research: delete Hono backend (do not merge) (#25667) 2026-05-09 13:10:42 +00:00
httpapi-experimental.test.ts research: delete Hono backend (do not merge) (#25667) 2026-05-09 13:10:42 +00:00
httpapi-file.test.ts Replace Instance.disposeAll/load with fixture helper (#25418) 2026-05-02 10:56:15 -04:00
httpapi-instance-context.test.ts test(server): expand workspace routing fixed-id coverage (#26458) 2026-05-09 00:00:18 -04:00
httpapi-instance.test.ts research: delete Hono backend (do not merge) (#25667) 2026-05-09 13:10:42 +00:00
httpapi-listen.test.ts research: delete Hono backend (do not merge) (#25667) 2026-05-09 13:10:42 +00:00
httpapi-mcp-oauth.test.ts fix(server): support desktop PTY websockets with HttpApi (#25598) 2026-05-03 18:23:29 +00:00
httpapi-mcp.test.ts research: delete Hono backend (do not merge) (#25667) 2026-05-09 13:10:42 +00:00
httpapi-provider.test.ts fix(server): keep provider lists JSON-safe (#26550) 2026-05-09 13:40:46 -04:00
httpapi-pty-websocket.test.ts test: port instance HttpApi path/vcs read coverage to Effect 2026-04-30 11:07:00 -04:00
httpapi-pty.test.ts research: delete Hono backend (do not merge) (#25667) 2026-05-09 13:10:42 +00:00
httpapi-query-schema-drift.test.ts fix(httpapi): eliminate drift between runtime query schemas and OpenAPI params 2026-05-09 16:12:02 -04:00
httpapi-raw-route-auth.test.ts chore: generate 2026-05-09 13:11:45 +00:00
httpapi-sdk.test.ts fix(httpapi): eliminate drift between runtime query schemas and OpenAPI params 2026-05-09 16:12:02 -04:00
httpapi-session.test.ts fix(httpapi): eliminate drift between runtime query schemas and OpenAPI params 2026-05-09 16:12:02 -04:00
httpapi-sync.test.ts fix(server): defer validation error body change 2026-05-09 14:50:45 -04:00
httpapi-ui.test.ts chore: generate 2026-05-09 13:11:45 +00:00
httpapi-workspace-routing.test.ts test(server): cover workspace sync fence protocol (#26441) 2026-05-08 23:55:47 -04:00
httpapi-workspace.test.ts research: delete Hono backend (do not merge) (#25667) 2026-05-09 13:10:42 +00:00
project-init-git.test.ts Delete Instance.dispose and Instance.reload (#25427) 2026-05-02 11:44:16 -04:00
proxy-util.test.ts Refactor HttpApi workspace routing and proxy boundaries (#25006) 2026-04-29 16:50:54 -04:00
session-actions.test.ts Normalize instance lifecycle wiring (#25501) 2026-05-02 20:39:20 -04:00
session-list.test.ts Normalize instance lifecycle wiring (#25501) 2026-05-02 20:39:20 -04:00
session-messages.test.ts fix(httpapi): eliminate drift between runtime query schemas and OpenAPI params 2026-05-09 16:12:02 -04:00
session-select.test.ts Normalize instance lifecycle wiring (#25501) 2026-05-02 20:39:20 -04:00
workspace-proxy.test.ts chore: generate 2026-04-30 23:37:58 +00:00
workspace-routing.test.ts refactor(server): extract Hono-coupled utilities to backend-neutral modules (#25542) 2026-05-03 12:58:34 +00:00
worktree-endpoint-repro.test.ts research: delete Hono backend (do not merge) (#25667) 2026-05-09 13:10:42 +00:00