Skip to content

feat: add small route HttpApi coverage#1378

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

feat: add small route HttpApi coverage#1378
Astro-Han merged 2 commits into
devfrom
codex/i936-httpapi-small-routes

Conversation

@Astro-Han

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

Copy link
Copy Markdown
Owner

Summary

Add local Effect HttpApi declarations and handlers for ordinary JSON file, project, memory, and external-result routes.

Why

Related to #936.

This gives the next Hono-to-HttpApi migration slice local coverage without switching the production server off Hono.

Related Issue

Related to #936

Human Review Status

Pending

Review Focus

Please focus on Hono wire-behavior parity for JSON body parsing, project 404 handling, memory safe-mode errors, and route-inventory classification.

Risk Notes

Production server routing is unchanged and remains on Hono in this PR. The new HttpApi schemas use broad Schema.Any only where the current route wire shape is Zod-owned or app-specific and preserving Hono behavior is more important than overstating OpenAPI precision.

Skipped checklist items: visible UI/copy check is not applicable; platform/packaging check is not applicable; docs/release/dependency/permission/generated-content checks are not applicable.

How To Verify

Baseline focused routes: 24 passed before changes
Focused route coverage: 34 passed after changes, 169 expect() calls
Typecheck: GOMAXPROCS=2 bun run typecheck passed
Diff check: git diff --check passed

Screenshots or Recordings

Not applicable: no visible UI changes.

Checklist

How to use this checklist:

  • Tick a box by replacing [ ] with [x]. Do not edit, add, or remove items.
  • The bot-applied label items can only be honestly ticked AFTER the PR is opened and the labeler / priority-triage bots have run — return to the PR description and tick them then.
  • Most items are required. The few that are conditional are explicitly marked (conditional); for those, leave unticked if they truly do not apply and explain why in Risk Notes. All other items must be ticked before requesting human review.
  • 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.

@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 3 minutes and 59 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: 8703cbae-4135-4cb6-8a96-a84e3a5260b7

📥 Commits

Reviewing files that changed from the base of the PR and between b9fbcef and bb5f18c.

📒 Files selected for processing (19)
  • packages/opencode/src/server/instance/external-result.ts
  • packages/opencode/src/server/instance/file.ts
  • packages/opencode/src/server/instance/memory.ts
  • packages/opencode/src/server/instance/project.ts
  • packages/opencode/src/server/routes/instance/httpapi/groups/common.ts
  • packages/opencode/src/server/routes/instance/httpapi/groups/external-result.ts
  • packages/opencode/src/server/routes/instance/httpapi/groups/file.ts
  • packages/opencode/src/server/routes/instance/httpapi/groups/memory.ts
  • packages/opencode/src/server/routes/instance/httpapi/groups/project.ts
  • packages/opencode/src/server/routes/instance/httpapi/handlers/external-result.ts
  • packages/opencode/src/server/routes/instance/httpapi/handlers/file.ts
  • packages/opencode/src/server/routes/instance/httpapi/handlers/memory.ts
  • packages/opencode/src/server/routes/instance/httpapi/handlers/project.ts
  • packages/opencode/test/server/external-result-routes.test.ts
  • packages/opencode/test/server/file-routes.test.ts
  • packages/opencode/test/server/memory-routes.test.ts
  • packages/opencode/test/server/project-init-git.test.ts
  • packages/opencode/test/server/project-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-small-routes

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 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

@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 added a commit that referenced this pull request Jun 18, 2026
Root cause:
- The e2e-artifacts workflow repeatedly timed out before test execution because `bunx playwright install-deps chromium` downloaded extra apt font packages from the Ubuntu 24.04 hosted runner mirror.
- This blocked PR #1378 and PR #1380 at the CI setup layer; their `Run e2e` steps never started.

Change:
- Use the GitHub-hosted Chrome binary for e2e-artifacts instead of installing Playwright system dependencies in the workflow.
- Remove the unused Playwright browser cache/env for this workflow and replace the install-deps step with a bounded Chrome verification step.
- Keep the real e2e run, artifact upload, warning step, and aggregate failure reporting intact.
- Add a workflow contract test so the PR-gating e2e workflow does not reintroduce `playwright install-deps` or the removed browser cache path.

Verification:
- `bun test test/config/e2e-artifacts-workflow.test.ts` in `packages/opencode`
- `bun run typecheck` in `packages/opencode`
- `actionlint .github/workflows/e2e-artifacts.yml`
- `git diff --check`
- PR CI all green, including e2e-artifacts run 27780806048 / job 82204831558, where `Verify GitHub-hosted Chrome` succeeded and the workflow reached and passed the real `Run e2e` step.

Reviews:
- Fresh-eye review: no P0/P1 blockers, no P2/P3 findings.
- Claude read-only review: no P0/P1 blockers. Non-blocking P2 noted the separate perf-probe baseline workflow still has its own install-deps pattern; this PR intentionally stays scoped to the PR-gating e2e-artifacts blocker.

Related to #1378.
Related to #1380.
@Astro-Han Astro-Han force-pushed the codex/i936-httpapi-small-routes branch from a9d5080 to bb5f18c Compare June 18, 2026 18:51
@Astro-Han Astro-Han merged commit 7a4c455 into dev Jun 18, 2026
37 checks passed
@Astro-Han Astro-Han deleted the codex/i936-httpapi-small-routes branch June 18, 2026 19:21
Astro-Han added a commit that referenced this pull request Jun 18, 2026
Add local Effect HttpApi declarations and handlers for the permission and experimental workspace JSON routes while keeping the production server on the existing Hono path.

Changes:
- Declare and cover GET /permission and POST /permission/:requestID/reply in the local instance HttpApi surface.
- Declare and cover POST/GET /experimental/workspace, GET /experimental/workspace/status, and DELETE /experimental/workspace/:id.
- Keep POST /permission/__e2e/ask intentionally Hono-only because it is a test-only env-gated route.
- Extend route-inventory coverage so this slice and the earlier small-route slice both remain tracked as local HttpApi coverage.
- Add focused parity tests for permission/workspace handlers and malformed permission reply JSON.

Verification:
- Baseline before the slice: focused permission/workspace/router/routing-decision/route-inventory tests passed with 46 tests.
- After rebasing onto #1378: bun test test/server/permission-routes.test.ts test/server/workspace-routes.test.ts test/server/workspace-router.test.ts test/server/workspace-routing-decision.test.ts test/server/route-inventory-harness.test.ts passed with 53 tests and 218 expect calls.
- git diff --check passed.
- GOMAXPROCS=2 bun run typecheck passed from packages/opencode.
- Fresh-eye reviews and Claude read-only reviews reported no P0/P1 blockers. Remaining P2/P3 notes were non-blocking helper/test-shape suggestions and were not chased beyond the scoped fixes.
- PR CI was green on head 82ccf47, including ci, e2e-artifacts, desktop-smoke, windows-advisory, CodeQL, dependency checks, pr-triage, and CodeRabbit. e2e used GitHub-hosted Chrome, entered the real Run e2e step, and passed.

Related to #936.
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