Files
opencode/packages
Kit Langton 64937161aa feat(httpapi-exercise): add .viaSdk() to drive scenarios through real SDK
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.
2026-05-09 20:22:55 -04:00
..
2026-05-10 00:07:24 +00:00
2026-05-10 00:07:24 +00:00
2026-01-21 14:36:21 -06:00
2026-05-10 00:07:24 +00:00
2026-05-10 00:07:24 +00:00
2026-05-10 00:07:24 +00:00
2026-05-10 00:07:24 +00:00
2026-05-10 00:07:24 +00:00
2026-05-10 00:07:24 +00:00