Skip to content

feat(review): keep the reviewer's gateway and cloud-provider routing - #424

Merged
moq-bot[bot] merged 6 commits into
mainfrom
quest/m0/review-gateway
Nov 3, 2026
Merged

moq-bot[bot] merged 6 commits into
mainfrom
quest/m0/review-gateway

Conversation

@kixelated

@kixelated kixelated commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Completes quest/m0/review-gateway.md: quest review now works when the reviewer CLI reaches its model through a gateway such as CLIProxyAPI, or through a cloud provider, instead of stripping the routing and reporting the reviewer as logged out.

Changes

  • src/cli/review.ts: each reviewer declares a connection allowlist that always passes, alongside its credentials and its routes (which replace reroutes).
    • Claude Code keeps ANTHROPIC_BASE_URL, ANTHROPIC_CUSTOM_HEADERS, the CLAUDE_CODE_USE_* and CLAUDE_CODE_SKIP_*_AUTH switches for Bedrock, Vertex, Foundry, Mantle, Claude Platform on AWS, and Google Cloud, and those providers' endpoint, project, region, workspace, and key settings. I took the names from the Claude Code 2.1.316 binary.
    • Codex keeps CODEX_CA_CERTIFICATE, and CODEX_ACCESS_TOKEN is now a Codex credential next to CODEX_API_KEY.
    • While a gateway or provider is set, the credential meant for it (ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, CLAUDE_CODE_OAUTH_TOKEN) passes even over a stored login, as it would for the user's own CLI. Without a route, the 2026-10-30 rule still holds: a stored login wins over a shell's key.
    • Errors: a logged-out or rejected error names the gateway or provider it went through. A stored login the API rejects names any credential quest review stripped beside it, instead of only saying "not logged in".
    • Model choices (ANTHROPIC_MODEL, ANTHROPIC_DEFAULT_*), plugin, permission, and effort variables, other harnesses' keys, and secret-manager tokens stay stripped. quest agent's and the runner's isolation (strippedEnvironment) are unchanged.
  • test/review.test.ts: reuses the gateway and cloud-routing tests from closed moq-dev/quest#316, covering both rounds, every provider, the error messages, and Codex's variables. It replaces the tests for the old reroute-blocking behavior.
  • README.md and quest review --help describe the new behavior.
  • Deletes the quest and its links in quest/m0/README.md and quest/m0/agent-stalls.md.

Choices made without asking

  • A route's credential passes over a stored login. Without this, a gateway would receive the subscription's OAuth token instead of the token configured for it. The quest's Goal says the reviewer "keeps ANTHROPIC_BASE_URL with its token".
  • More providers than the Goal names. Mantle, Claude Platform on AWS (CLAUDE_CODE_USE_ANTHROPIC_AWS), and Google Cloud are switched on the same way as Bedrock, Vertex, and Foundry, and claude auth status reports each as a third-party provider. Handling only three would leave the rest half-stripped.
  • Provider keys pass only while a route is set (ANTHROPIC_FOUNDRY_API_KEY, ANTHROPIC_AWS_API_KEY, ANTHROPIC_FOUNDRY_AUTH_TOKEN, now routeCredentials). At first they always passed. CodeRabbit flagged that this let an unused provider secret reach the reviewer. Unlike its suggested patch, they do not go into credentials. That list also passes with no stored login and no route, where Claude Code ignores these keys: the review would start and then blame the key instead of failing fast as logged out.
  • CLAUDE_CODE_USE_GATEWAY stays stripped. It is undocumented, and it does not change apiProvider in claude auth status.
  • Codex has no routes. OPENAI_BASE_URL was never stripped. CODEX_ACCESS_TOKEN follows the stored-login-wins rule, like CODEX_API_KEY.

Validation

  • just check and just test pass on 1e4ec9b, after merging main.
  • 1e4ec9b merges origin/main (d7ef15e), including moq-dev/quest#421 and moq-dev/quest#426, which also edit src/cli/review.ts. The conflicts were in prepare() and the fake Codex CLI. The resolution keeps both sides. Main's abort signal is now passed to the routed and stored-login status checks and returned on every Cli, and the fake CLI keeps both main's FAKE_HANG mode and this PR's CODEX_ACCESS_TOKEN login. Main's new reviewerEnvironment() is used only by the live sandbox test, and it now returns the same routed environment as a review.
  • Probed the real CLIs: claude auth status exits 1 with only ANTHROPIC_BASE_URL, and 0 with a token or a provider switch. codex login status reads CODEX_ACCESS_TOKEN but not CODEX_API_KEY.

Review

mechanical fix by codex / Codex: Merged base and preserved both sides' completed quest deletions; passed bun install --frozen-lockfile, bun run build, bun run test (1010 passed, 2 skipped), bun run check, bun run --silent quest check, and bun run --silent quest --root examples/export check. (head 23a13a1)

  • Reviewer: Codex, gpt-6.1-sol, medium effort (quest review). Earlier rounds used session 01a19f87-e27a-7362-bdd5-0c3dc93ce3fb.
  • Round 1 at a97fbac: 1 finding.
    • medium, src/cli/review.ts:246, "Preserve the Google Cloud location setting": fixed in 1b2dc7b. ANTHROPIC_GOOGLE_CLOUD_LOCATION was added and is now tested.
  • Round 2 at 1b2dc7b: no findings.
  • CodeRabbit on 1b2dc7b: 1 finding.
    • Major, src/cli/review.ts:234, "Move provider API keys to the credentials list": fixed in e7cb662, as route-only credentials (see Choices).
  • Fresh session 01a1a1ef-3a8e-7c43-b7a2-f29a1f06de8f, round 1 at e7cb662: no findings. The session was fresh because the PR branch was checked out in another worktree.
  • Session 01a19f87-e27a-7362-bdd5-0c3dc93ce3fb, round 3 at 1e4ec9b (the merge of main): no findings. The merged diff differs from e7cb662's only where main's signal was threaded through, so this round was needed.

Follow-ups

  • The pinned Claude review model (claude-opus-5-5) has not been checked on Bedrock, Vertex, or Foundry, where model IDs differ. ANTHROPIC_MODEL and ANTHROPIC_DEFAULT_*_MODEL stay stripped, so a provider that cannot resolve the pin needs --model. This belongs with the in-flight review-harness quest (model pins), not here.

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

kixelated and others added 3 commits November 2, 2026 19:42
Quest-Claim: ca7b91faf0d78a1c
quest review now passes the variables that connect the reviewer CLI to its
model: ANTHROPIC_BASE_URL, ANTHROPIC_CUSTOM_HEADERS, and Claude Code's cloud
provider switches and settings, and Codex's CODEX_CA_CERTIFICATE. While a
gateway or provider is set, the credential meant for it passes too, so a
review goes where the user's own CLI sessions do. CODEX_ACCESS_TOKEN joins
CODEX_API_KEY as a Codex credential. A stored login the API rejects names a
credential quest review stripped beside it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title quest review routes through a gateway or cloud provider feat(review): keep the reviewer's gateway and cloud-provider routing Nov 3, 2026
@kixelated
kixelated marked this pull request as ready for review November 3, 2026 03:57
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 86d0bdf4-55ba-4f0d-aa0d-d8c0fae76534

No actionable comments were generated in the recent review.

Walkthrough

The review command now separates credentials from connection settings. It passes through Claude gateway and provider settings and the Codex CA-certificate setting. Claude route detection recognizes additional provider switches. Credential handling now depends on route status and stored-login checks. The CLI documentation and tests describe and cover the updated behavior.

Merge Risk: Minimal · previous review 1e4ec

Inactive provider credentials no longer reach review processes. No issue identified here needs resolution before merge.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title "feat(review): keep the reviewer's gateway and cloud-provider routing" matches the main change. The changeset keeps gateway and cloud-provider settings for Claude Code and CA certificate and…
Description check Passed The description states that quest review now works through a gateway or cloud provider instead of stripping routing. It lists the review.ts connection, credentials, and routes changes, the test update…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Title check

Explanation

The title "feat(review): keep the reviewer's gateway and cloud-provider routing" matches the main change. The changeset keeps gateway and cloud-provider settings for Claude Code and CA certificate and access-token settings for Codex in the review command, so the title describes the primary change.

Full details: Description check

Explanation

The description states that quest review now works through a gateway or cloud provider instead of stripping routing. It lists the review.ts connection, credentials, and routes changes, the test updates, README and help text updates, and the quest deletions. This matches the changeset.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 3 files. (1 skipped: 1 unsupported.)

Finishing Touches
Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 98928808-ff4e-474f-b30c-0b82d14363fb
Commits

Reviewing files that changed from the base of the PR and between 1b2dc7b and 1e4ec9b.

Files selected for processing: 5
  • README.md
  • quest/m0/README.md
  • src/cli/main.ts
  • src/cli/review.ts
  • test/review.test.ts
Files with no reviewable changes: 1
  • quest/m0/README.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@coderabbitai coderabbitai 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.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread src/cli/review.ts Resolved
ANTHROPIC_AWS_API_KEY, ANTHROPIC_FOUNDRY_API_KEY, and
ANTHROPIC_FOUNDRY_AUTH_TOKEN passed on every turn as connection settings,
so an unused provider secret reached the reviewer and its subprocesses.
They are now route credentials: passed only while a gateway or provider
is set. A shell holding only such a key, with no stored login and no
route, still fails fast as logged out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves src/cli/review.ts and test/review.test.ts against main's abort
signal (#421/#426): the routed and stored-login status checks pass it on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated added this pull request to the merge queue Nov 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 3, 2026
@moq-bot

moq-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

quest land watch: the merge queue removed this pull request at 1e4ec9b because it conflicts with main (merge_conflict).

The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs.

(written by quest land watch)

@moq-bot
moq-bot Bot enabled auto-merge November 3, 2026 17:38
@moq-bot

moq-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

quest land watch: armed auto-merge on this pull request at 23a13a1, so it joins the back of the merge queue once its required checks pass, with the land fixer's fix (codex / Codex): Merged base and preserved both sides' completed quest deletions; passed bun install --frozen-lockfile, bun run build, bun run test (1010 passed, 2 skipped), bun run check, bun run --silent quest check, and bun run --silent quest --root examples/export check..

(written by quest land watch)

@moq-bot
moq-bot Bot added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit c9ee762 Nov 3, 2026
18 checks passed
@moq-bot
moq-bot Bot deleted the quest/m0/review-gateway branch November 3, 2026 18:11
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.

1 participant