Skip to content

chore(sdk): regenerate v2 SDK types for the migrated error contracts - #1112

Merged
Astro-Han merged 2 commits into
devfrom
claude/i936-openapi-resync
Jun 3, 2026
Merged

chore(sdk): regenerate v2 SDK types for the migrated error contracts#1112
Astro-Han merged 2 commits into
devfrom
claude/i936-openapi-resync

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

Two related changes that finish the #936 SDK side:

  1. Regenerate packages/sdk/js/src/v2/gen from 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.
  2. Route packages/sdk/** to the harness label 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

deleteMessage / part.delete (the #1109 / #1111 silent-200 → 404 fixes) correctly
produce 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 EventSessionCompacted union reordering, a VCS
diffRaw doc string) — just the canonical generator output catching up.

CI labeler gap

packages/sdk/** matched no routing glob in .github/labeler.yml (the buckets are
app/ui/platform/harness/ci). With sync-labels: true, a SDK-only PR got no
primary 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 contract
surface) fixes it for this PR and every future SDK-only PR, and is pinned by a new
pr-triage-workflow.test.ts assertion.

Scope note

This regenerates only the consumed SDK artifact (src/v2/gen, which app/ui
import). The checked-in packages/sdk/openapi.json reporting snapshot is left as-is
on 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 build regenerated the gen and ran bun tsc clean.
  • 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.
  • SDK type changes are additive (new error types on existing methods), so consumers are unaffected.

Refs #936

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
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR extends GitHub labeler configuration to route SDK package changes to the harness label by adding packages/sdk/** glob patterns, with corresponding test updates that validate routing behavior for both mixed and SDK-only PRs.

Changes

SDK Labeler Routing

Layer / File(s) Summary
Extend harness labeler routing and validate with tests
.github/labeler.yml, packages/opencode/test/github/pr-triage-workflow.test.ts
The harness label glob patterns now include packages/sdk/** to capture SDK-related changes. Existing labeler assertions are extended to verify packages/sdk/** and **/*.tsx routing while excluding **/*.md. A new test case confirms SDK-only PRs receive the harness label per routing policy.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • Astro-Han/pawwork#573: Both PRs extend the harness label routing in .github/labeler.yml and corresponding tests to cover SDK/opencode paths with glob patterns.

Suggested labels

harness

Poem

A rabbit hops through SDK ground,
Labels routing all around,
Globs now catch the packages snug,
Tests verify each careful tug! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is partially related to the changeset. It accurately describes the regeneration of SDK types but does not mention the CI routing label changes that are also part of this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description is comprehensive and well-structured, covering summary, rationale, verification, and scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/i936-openapi-resync

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Astro-Han Astro-Han added tech-debt Supplemental cleanup, maintainability, architecture, test, or quality debt context harness Model harness, prompts, tool descriptions, and session mechanics P3 Low priority labels Jun 3, 2026
@github-actions github-actions Bot added P2 Medium priority and removed P3 Low priority harness Model harness, prompts, tool descriptions, and session mechanics labels Jun 3, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested priority: P2 (includes non-doc, non-test paths outside the low-risk bucket).

P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.

@Astro-Han Astro-Han added task Narrow execution, audit, spike, migration, tracking, or upstream follow-up work harness Model harness, prompts, tool descriptions, and session mechanics labels Jun 3, 2026
@github-actions github-actions Bot removed the harness Model harness, prompts, tool descriptions, and session mechanics label Jun 3, 2026
@Astro-Han Astro-Han added harness Model harness, prompts, tool descriptions, and session mechanics and removed tech-debt Supplemental cleanup, maintainability, architecture, test, or quality debt context labels Jun 3, 2026
@github-actions github-actions Bot removed the harness Model harness, prompts, tool descriptions, and session mechanics label Jun 3, 2026
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
@github-actions github-actions Bot added ci Continuous integration / GitHub Actions harness Model harness, prompts, tool descriptions, and session mechanics labels Jun 3, 2026
@Astro-Han
Astro-Han merged commit 66065eb into dev Jun 3, 2026
35 of 36 checks passed
@Astro-Han
Astro-Han deleted the claude/i936-openapi-resync branch June 3, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous integration / GitHub Actions harness Model harness, prompts, tool descriptions, and session mechanics P2 Medium priority task Narrow execution, audit, spike, migration, tracking, or upstream follow-up work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant