Skip to content

fix: regenerate broken OpenAPI documents and check them in CI - #58262

Merged
Hona merged 1 commit into
anomalyco:devfrom
Hona:fix-openapi-json
Oct 22, 2026
Merged

Hona merged 1 commit into
anomalyco:devfrom
Hona:fix-openapi-json

Conversation

@Hona

@Hona Hona commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

deploy-www has failed on every dev commit since #58252, because packages/protocol/openapi.json (and the two copies in services/www) is not valid JSON.

[builtin:vite-json] plugin `builtin:vite-json` threw an error
Caused by:
    expected `,` or `]` at line 13419 column 5

At that line, a location query schema stops after "type": "null" } and "/api/debug/heap-dump" starts. The file was merged by hand, not generated, and lost the /api/experimental/client-mcp and /api/experimental/client-mcp/token paths along the way.

  • Regenerate: run bun run generate in packages/protocol and then in services/www. The result is the generator's output for the current ClientApi, including the two client-mcp paths and the heap-dump route.
  • Guard: add packages/protocol's check:generated to the Linux unit job. CI already checked that the services/www copies match packages/protocol/openapi.json, but not that the file matches ClientApi, so a broken file that was copied to all three places passed.
flowchart LR
  A["ClientApi (source)"] -->|"protocol check:generated (new)"| B["packages/protocol/openapi.json"]
  B -->|"www check:generated (existing)"| C["services/www/openapi.json, public/openapi.json"]
Loading

The new step fails against the current dev file and passes with this change.

Flaky update-restart tests

The two TUI tests added in #58139 (restarting after an update…, quitting after a background update…) failed on both unit (linux) runs of this PR. Changing test.yml invalidates turbo's cache, so every package's tests run here. They waited on frames with a renderer whose frame loop never started, so waitForFrame gave up as soon as no render was scheduled while the home route was still loading:

error: Timed out waiting for frame predicate after 20 passes
frameId: 2
isRunning: false
hasScheduledRender: false

They now start the frame loop and wait for terminalHandoff's complete, the same as the selection-copy test in the same file.

Copilot AI balanced review requested due to automatic review settings October 22, 2026 23:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. On the base, all three openapi.json files fail to parse at line 13419, the same error deploy-www hits, and protocol check:generated reports the document is stale. With this PR, the checked-in file is byte-identical to what bun run generate produces from the current ClientApi. The services/www copies match it, and both protocol and www check:generated pass. The new CI step sits correctly before the existing www check.

Public API impact: the published OpenAPI document becomes valid again and regains /api/experimental/client-mcp and /api/experimental/client-mcp/token, which were already served by the server. This is backwards compatible, and no server, SDK or client code changes.

No concerns.

@Hona
Hona merged commit 318e83e into anomalyco:dev Oct 22, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants