chore(sdk): regenerate v2 SDK types for the migrated error contracts - #1112
Conversation
Regenerate packages/sdk/js/src/v2/gen from the current server contract (`cd packages/sdk/js && bun run build`). This closes the SDK-lag P2 that the #936 contract slices kept surfacing: the generated v2 SDK error types now match the live server's declared 4xx responses. Picked up: - SessionForkErrors (400, 404) and the fork method's error generic — #1101. - SessionToolRespondErrors now declares the inline 404/409/422 bodies ({ error, details? }) instead of only 400/404 — #1104. - 409 Conflict (UnknownError) on the nine busy-guarded session routes (turnChangeUndo/Redo, turnChangesAggregateUndo/Redo, summarize, deleteMessage, shell, revert, unrevert) — #1106. The regen also absorbs minor pre-existing ordering/description drift from earlier merges (an EventSessionCompacted union reordering, a VCS diffRaw doc string), which is just the canonical generator output catching up. Scope note: this regenerates only the consumed SDK artifact (src/v2/gen). The checked-in packages/sdk/openapi.json reporting snapshot is intentionally left to a separate change — it is read only by the route-inventory harness, whose tests are built to detect (and tolerate) that snapshot's lag, so resyncing it there would fight that harness by design. All changes are additive (new error types on existing methods), so SDK consumers are unaffected. `bun tsc` (run by the SDK build) and the route-inventory harness tests pass. Refs #936
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
📝 WalkthroughWalkthroughThe PR extends GitHub labeler configuration to route SDK package changes to the ChangesSDK Labeler Routing
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This SDK regen is the first packages/sdk-only PR, which surfaced that the
labeler has no routing glob for packages/sdk. With sync-labels enabled, a
SDK-only PR therefore gets no primary routing label (and any manually added one
is stripped), so the pr-triage label policy ("at least one routing label")
cannot be satisfied.
Route packages/sdk/** to the harness area: the SDK is the opencode server's
generated client, part of the same contract surface as packages/opencode. Lock
the routing in the pr-triage workflow test.
Refs #936
Summary
Two related changes that finish the #936 SDK side:
packages/sdk/js/src/v2/genfrom the current server contract (cd packages/sdk/js && bun run build). This closes the recurring SDK-lag P2 that every [Task] Audit remaining Effect migration scope after upstream HttpApi rollout #936 contract slice surfaced in review: the generated v2 SDK error types now match the live server's declared 4xx responses.packages/sdk/**to theharnesslabel in the labeler — this is the first packages/sdk-only PR and it exposed that the labeler had no routing glob for the SDK package, so the pr-triage label policy couldn't be satisfied (see "CI labeler gap" below).What the SDK regen picked up
SessionForkErrors(400, 404) + the fork method's error generic — from fix(server): declare 400/404 on the session fork route #1101.SessionToolRespondErrorsnow declares the inline404/409/422bodies ({ error, details? }) instead of only400/404— from fix(server): declare tool/respond route-local failures, harden errors() helper #1104.409Conflict (UnknownError) on the nine busy-guarded session routes (turnChangeUndo/Redo,turnChangesAggregateUndo/Redo,summarize,deleteMessage,shell,revert,unrevert) — from fix(server): map busy-session conflict to 409 and declare it on guarded routes #1106.deleteMessage/part.delete(the #1109 / #1111 silent-200 → 404 fixes) correctlyproduce no SDK type change: their 404 was already declared; those PRs only made
the runtime reach it. The regen also absorbs minor pre-existing ordering/description
drift from earlier merges (an
EventSessionCompactedunion reordering, a VCSdiffRawdoc string) — just the canonical generator output catching up.CI labeler gap
packages/sdk/**matched no routing glob in.github/labeler.yml(the buckets areapp/ui/platform/harness/ci). Withsync-labels: true, a SDK-only PR got noprimary routing label and any manually added one was stripped, so the pr-triage
policy ("at least one routing label") failed for this PR. Routing
packages/sdk/**to
harness(the SDK is the opencode server's generated client, same contractsurface) fixes it for this PR and every future SDK-only PR, and is pinned by a new
pr-triage-workflow.test.tsassertion.Scope note
This regenerates only the consumed SDK artifact (
src/v2/gen, whichapp/uiimport). The checked-in
packages/sdk/openapi.jsonreporting snapshot is left as-ison purpose: it is read only by the route-inventory harness, whose tests are written
to detect and tolerate that snapshot's lag, so resyncing it there would fight that
harness by design.
Verification
cd packages/sdk/js && bun run buildregenerated the gen and ranbun tscclean.bun test test/server/route-inventory-harness.test.ts— 11 pass (route lists unchanged; only error types changed).bun test test/github/pr-triage-workflow.test.ts— 11 pass (locks the new packages/sdk → harness routing).bun run typecheck(opencode) — clean.Refs #936