Skip to content

feat(opencode): add provider HttpApi trial slice#1371

Merged
Astro-Han merged 1 commit into
devfrom
codex/i936-httpapi-provider-vertical
Jun 18, 2026
Merged

feat(opencode): add provider HttpApi trial slice#1371
Astro-Han merged 1 commit into
devfrom
codex/i936-httpapi-provider-vertical

Conversation

@Astro-Han

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

Copy link
Copy Markdown
Owner

Summary

Add a local provider HttpApi trial slice for the provider route group:

  • declare HttpApi endpoints for provider list, auth, OAuth authorize/callback, and recent model recording
  • extract shared provider route actions so Hono and HttpApi handlers use the same Effect boundaries
  • add handler coverage for provider list/auth/OAuth/recent behavior and route inventory coverage for the five provider routes

Why

This is the second Hono to Effect HttpApi vertical slice after the config scaffolding. It keeps production Hono routing intact while making the provider group available in local HttpApi parity coverage.

Related Issue

Related to #936

Human Review Status

Pending

Review Focus

Please focus on whether the provider HttpApi handlers preserve Hono response shapes, OAuth error status mapping, and ModelState.recordRecent behavior without switching production routing.

Risk Notes

This is a parity/scaffolding slice only; production server routing remains Hono. Fresh-eye and Claude found no P0/P1. Non-blocking residuals: the provider HttpApi error schemas are still trial/OpenAPI declarations and inherit the existing Hono 400 schema mismatch for runtime validation and OAuth NamedError bodies; full invalid-body matrix coverage can be tightened before HttpApi is wired as production routing. Skipped conditional checklist items: no visible UI or copy changed, no platform/packaging surface changed, and no docs/release/dependency/permission/generated surfaces changed.

How To Verify

Install: bun install --frozen-lockfile completed in the new worktree.
Baseline focused tests: 34 passed before changes across provider-routes, provider-recent-route, config-routes, and route-inventory-harness.
Initial focused tests: 37 passed after changes across provider-routes, provider-recent-route, config-routes, and route-inventory-harness.
Initial route inventory probe: localHttpApi count is 8; GET /provider, GET /provider/auth, POST /provider/:providerID/oauth/authorize, POST /provider/:providerID/oauth/callback, and POST /provider/recent all report localHttpApi=true; /provider/recent remains hono-v2-sdk and upstreamHttpApi=false.
Initial typecheck: GOMAXPROCS=2 bun run typecheck passed from packages/opencode.
Initial diff check: git diff --check passed.
Rebase: cleanly rebased onto origin/dev 6310080ec400ee83ed62cd61960a8a337c38a35a after PR #1370 merged.
Post-rebase focused tests: 37 passed across provider-routes, provider-recent-route, config-routes, and route-inventory-harness.
Post-rebase route inventory probe: after fetching opencode/dev, localHttpApi count is 8 and the same five provider routes report localHttpApi=true; /provider/recent remains hono-v2-sdk and upstreamHttpApi=false.
Post-rebase typecheck: GOMAXPROCS=2 bun run typecheck passed from packages/opencode.
Post-rebase diff check: git diff --check origin/dev...HEAD passed.
Fresh-eye review: no P0/P1; P2/P3 recorded in Risk Notes as non-blocking residuals.
Claude read-only review: no P0/P1; P2/P3 recorded in Risk Notes as non-blocking residuals.

Screenshots or Recordings

N/A, 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 40 minutes and 38 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: 3f03ce29-386a-453d-a6a6-c05e82e658ce

📥 Commits

Reviewing files that changed from the base of the PR and between 6310080 and 28e17c1.

📒 Files selected for processing (8)
  • packages/opencode/src/server/instance/provider-actions.ts
  • packages/opencode/src/server/instance/provider.ts
  • packages/opencode/src/server/routes/instance/httpapi/groups/common.ts
  • packages/opencode/src/server/routes/instance/httpapi/groups/config.ts
  • packages/opencode/src/server/routes/instance/httpapi/groups/provider.ts
  • packages/opencode/src/server/routes/instance/httpapi/handlers/provider.ts
  • packages/opencode/test/server/provider-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-httpapi-provider-vertical

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-httpapi-provider-vertical branch from 4142e39 to 28e17c1 Compare June 18, 2026 13:51
@Astro-Han Astro-Han merged commit 286a3d7 into dev Jun 18, 2026
39 checks passed
@Astro-Han Astro-Han deleted the codex/i936-httpapi-provider-vertical branch June 18, 2026 14:32
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