Move the 8 standalone scenarios from
packages/opencode/test/server/httpapi-query-schema-drift.test.ts into
the route-coverage exerciser as `.viaSdk(...)` scenarios. Each one
exercises a routing-aware GET through the real SDK client wired to the
in-process router, so the SDK's auto-injected `?directory=...` /
`?workspace=...` query params hit the same typed schemas as in production.
Routes now covered by `.viaSdk(...)` scenarios in the exerciser:
/session (session.list.via_sdk)
/session/{sessionID}/message (session.messages.via_sdk)
/find/file (find.files.via_sdk)
/find (find.text.via_sdk)
/file/content (file.read.via_sdk)
/experimental/session (experimental.session.list.via_sdk)
/experimental/tool (experimental.tool.list.via_sdk)
/vcs/diff (vcs.diff.via_sdk)
Standalone httpapi-query-schema-drift.test.ts deleted — its coverage
now lives in the harness alongside every other route test, single
source of truth.
149/149 scenarios pass after migration (139 existing + 2 from
proof-of-concept #26604 + 8 migrated here).
The exerciser harness builds requests directly as Request objects, which
means it never exercises the SDK client's auto-injection of
?directory= / ?workspace= on GETs. That's structurally how the entire
#26569 / #26581 family of regressions slipped through — the SDK was
sending requests the typed query schemas didn't accept, but the harness
was sending requests directly.
Add an opt-in `.viaSdk((sdk, ctx) => sdk.X.Y(...))` builder method that
runs the scenario through a real `createOpencodeClient` wired to the
in-process exerciser router. The SDK applies its real request transforms
so route tests catch the SDK-vs-server-shape drift class at write time.
The runner normalizes the SDK's `{data, error, response}` (or thrown
Error with `.cause = {body, status}`) back into the existing `CallResult`
shape so all the existing assertions (`.json()`, `.status()`, `.ok()`,
etc.) continue to work unchanged. Existing `.at(...)` scenarios are
not touched.
Convert two scenarios as proof: `app.agents.via_sdk` and
`command.list.via_sdk` both pass alongside the 139 existing scenarios
(141/141 PASS).
Subsequent PRs will migrate the standalone `httpapi-query-schema-drift`
scenarios into the exerciser using `.viaSdk(...)` and delete that file
as the bug class becomes a structural guarantee inside the harness.