Files
anomalyco_opencode/packages/opencode
Kit Langton 80897e2159 align OpenAPI BadRequestError shape + cover response-encode 400s + SDK canary
Code review on PR #26631 surfaced two blocking gaps:

1. The OpenAPI legacy shim (addLegacyErrorSchemas in public.ts) still
   declared BadRequestError as the old {data, errors, success} shape,
   so the SDK's typed result.error path saw fields that don't match
   the actual wire body. Update the shim and regenerate the SDK so
   typed consumers see {name, data:{message,kind}}.

2. The regression test only triggered kind:"Payload" (request body
   parse). The user-reported failure was kind:"Body" (response encode
   on a corrupt stored row). Add a second test that mirrors the OMO/
   Windows scenario: stored step-finish part with NaN tokens.output
   makes the messages endpoint 400 — assert the new body has the field
   path in data.message.

Plus an end-to-end SDK canary in sdk-error-shape.test.ts: asserts the
v2 SDK's wrapClientError extracts data.message into Error.message and
preserves the full body in cause.body, so future regressions of either
the server shape OR wrapClientError surface immediately.

bun typecheck, all 18 tests in 4 adjacent files pass.
2026-05-09 23:19:57 -04:00
..
2026-02-25 01:48:10 -05:00
2026-03-27 15:00:26 +01:00
2026-02-14 04:19:02 +00:00
2026-02-18 13:54:23 -05: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.