Skip to content

refactor(opencode): add root global HttpApi coverage - #1383

Merged
Astro-Han merged 2 commits into
devfrom
codex/i936-root-global-httpapi
Jun 18, 2026
Merged

refactor(opencode): add root global HttpApi coverage#1383
Astro-Han merged 2 commits into
devfrom
codex/i936-root-global-httpapi

Conversation

@Astro-Han

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

Copy link
Copy Markdown
Owner

Summary

Add local Effect HttpApi coverage for root instance and global JSON/control routes while keeping production routing on the existing Hono server.

Why

This moves the #936 route inventory forward for ordinary non-streaming root/global routes without touching automation, session, SSE, WebSocket, static, or production server switching surfaces. POST /log is intentionally excluded because live source ownership is packages/opencode/src/server/control/index.ts, not the root instance route owner in this slice.

Related Issue

Related to #936

Human Review Status

Pending

Review Focus

Please check the raw handler parity for GET /vcs/diff/raw, POST /vcs/apply, global config patch validation, and global dispose request-context bridging.

Risk Notes

No production server switch is included; these are local HttpApi declarations and handlers only. After rebasing onto #1382, route inventory keeps the union of #1382 experimental coverage and this PR's root/global coverage. A future production HttpApi switch should revisit group-level global request-context parity for all global routes and chunked oversized request handling for POST /vcs/apply. Visible UI/copy check skipped because this PR changes no UI or copy. Platform/packaging check skipped because this PR changes no platform, packaging, updater, signing, paths, shell, or permissions surface. Docs/release/dependency/permission/generated/local-file checklist item skipped because none of those surfaces changed.

How To Verify

Rebase base: origin/dev 5296b823f73f5a841b363f633867fb98450cbbc4 (#1382 squash merge)
Focused route tests: 50 passed with bun test test/server/route-inventory-harness.test.ts test/server/instance-root-routes.test.ts test/server/global-config-routes.test.ts test/server/vcs-routes.test.ts
Route inventory: Hono 128, local HttpApi 64; #1382 experimental routes and #1383 root/global routes are localHttpApi: true
Typecheck: GOMAXPROCS=2 bun run typecheck passed from packages/opencode
Diff check: git diff --check origin/dev...HEAD passed
Fresh-eye review after rebase conflict fix: PASS, no P0/P1/P2/P3 blockers
Claude review after rebase conflict fix: PASS, no P0/P1 blockers; P2/P3 notes are non-blocking future production-switch cleanup

Screenshots or Recordings

Not applicable: no visible UI changes.

Checklist

  • Type label — this PR carries exactly one of bug, enhancement, task, documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.
  • Routing labels — this PR carries at least one of app, ui, platform, harness, ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot's choice (or override if wrong), then tick this.
  • Priority label — this PR carries exactly one of P0, P1, P2, P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.
  • Human Review Status above is set to Pending, Approved by @<reviewer>, or Not required: <reason> (default is Pending; "not required" is restricted to bot-authored low-risk PRs).
  • I linked the related issue, or stated in Summary why there is no issue.
  • I described the review focus and any meaningful risks.
  • I replaced the example block in How To Verify with the real verification steps and the key result for each.
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope.
  • (conditional) I manually checked visible UI or copy changes when needed, with screenshots or recordings. Leave unticked only if no visible UI or copy changed.
  • (conditional) I considered macOS and Windows impact for platform, packaging, updater, signing, paths, shell, or permissions changes. Leave unticked only if no platform/packaging surface was touched.
  • (conditional) I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant. Leave unticked only if none of those surfaces was touched.
  • I reviewed the final diff for unrelated changes and suspicious dependency changes.
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English.

@Astro-Han Astro-Han added P2 Medium priority upstream Tracked upstream or vendor behavior harness Model harness, prompts, tool descriptions, and session mechanics task Narrow execution, audit, spike, migration, tracking, or upstream follow-up work tech-debt Supplemental cleanup, maintainability, architecture, test, or quality debt context labels Jun 18, 2026
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@Astro-Han, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 24 minutes and 5 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cda7799c-31a7-4518-8669-43792824f44e

📥 Commits

Reviewing files that changed from the base of the PR and between 5296b82 and 62bae4a.

📒 Files selected for processing (7)
  • packages/opencode/src/server/routes/instance/httpapi/groups/global.ts
  • packages/opencode/src/server/routes/instance/httpapi/groups/root.ts
  • packages/opencode/src/server/routes/instance/httpapi/handlers/global.ts
  • packages/opencode/src/server/routes/instance/httpapi/handlers/root.ts
  • packages/opencode/test/server/global-config-routes.test.ts
  • packages/opencode/test/server/instance-root-routes.test.ts
  • packages/opencode/test/server/route-inventory-harness.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/i936-root-global-httpapi

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.

@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 force-pushed the codex/i936-root-global-httpapi branch from 7e465de to 62bae4a Compare June 18, 2026 20:45
@Astro-Han
Astro-Han merged commit 67eb846 into dev Jun 18, 2026
39 checks passed
@Astro-Han
Astro-Han deleted the codex/i936-root-global-httpapi branch June 18, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

harness Model harness, prompts, tool descriptions, and session mechanics P2 Medium priority task Narrow execution, audit, spike, migration, tracking, or upstream follow-up work tech-debt Supplemental cleanup, maintainability, architecture, test, or quality debt context upstream Tracked upstream or vendor behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant