GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(claude): contain main credentials to canonical forward routes by luvs01 · Pull Request #1358 · lidge-jun/opencodex

Conversation

@luvs01

@luvs01 luvs01 commented Aug 9, 2026 •
edited by Wibias
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Summary

  • Keep Claude replay's optional main-account enrichment for canonical OpenAI routes and internal OpenAI sidecars.
  • Strip the internally injected bearer and account ID when the final resolved wire adapter is a noncanonical openai-responses forward destination.
  • Apply the boundary after shadow routing and model-level wire overrides, and add direct plus shadow/model-override regressions.

This keeps existing key/OAuth adapters and sidecar behavior intact while preventing an internal main-account credential from following a final custom forward route.

Verification

  • bun test tests/claude-messages-endpoint.test.ts -t 'custom forward|shadow-call' — 2 passed.
  • Canonical OpenAI positive control — 1 passed.
  • Routed OpenAI sidecar positive control — 1 passed.
  • bun run typecheck
  • bun run privacy:scan
  • git diff --check
  • Independent final diff review found no P0–P3 findings.
  • The whole endpoint file reached 37 passing tests; one existing 5-second lifecycle timeout and its following cleanup EBUSY reproduced on an unchanged dev control. Exact-head GitHub CI remains required.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were not needed for this internal routing boundary.
  • Security-sensitive changes require explicit maintainer security review.

Review readiness checklist

  • All CI tests are green on my local testing.

  • I pushed my PR to the latest dev commit.

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Claude Messages replays now enable credential stripping for noncanonical OpenAI Responses forwards. Responses handling clears native authentication and Codex routing metadata. Tests cover direct custom forwarding and shadow-call rerouting.

Changes

Claude forward authentication

Layer / File(s) Summary
Conditional authentication stripping
src/server/responses/core.ts, src/server/claude-messages.ts
HandleResponsesOptions adds stripClaudeMainAuthForNoncanonicalForward at lines 634-639. Claude replay enables it at line 735. For noncanonical OpenAI Responses forwards, lines 1710-1727 release the Codex probe lease, reset authentication, remove runtime fields and credential headers, clear account routing metadata, and update the provider name.
Credential forwarding regression coverage
tests/claude-messages-endpoint.test.ts
Lines 689-739 test direct custom forwarding without authorization or chatgpt-account-id. Lines 741-802 test shadow-call rerouting with the same credential checks and a successful streamed response.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ClaudeMessagesReplay
  participant HandleResponses
  participant AuthContext
  participant CustomOpenAIResponsesRoute
  ClaudeMessagesReplay->>HandleResponses: enable credential stripping
  HandleResponses->>AuthContext: reset auth and remove native headers and routing metadata
  HandleResponses->>CustomOpenAIResponsesRoute: forward request without main credentials
  CustomOpenAIResponsesRoute-->>ClaudeMessagesReplay: return streamed response
Loading

Possibly related PRs

  • lidge-jun/opencodex#626: Shares the Claude Messages replay and endpoint test areas but addresses cache-key and session-ID stabilization.
  • lidge-jun/opencodex#634: Shares the routed Claude Messages/OpenAI replay flow but addresses cache and session stabilization.

Suggested reviewers: wibias, lidge-jun, devmello

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preventing main credentials from reaching noncanonical Claude forward routes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the bug Something isn't working label Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed; the review readiness checklist is complete.

Review readiness checklist

  • ✅ All CI tests are green on my local testing.
  • ✅ I pushed my PR to the latest dev commit.
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ✅ My PR is ready for review.

✅ 4/4 boxes ticked.

This pull request is already Ready for Review.
The review-ready label marks this PR as ready; review automation runs independently. If no CodeRabbit review appears, comment @coderabbitai review to request one.
Maintainers: @lidge-jun @Ingwannu @Wibias

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@luvs01

luvs01 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Aug 9, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/claude-messages-endpoint.test.ts`:
- Line 693: Remove the duplicate captured declarations within the test()
callbacks so each callback has only one declaration. Apply this at
tests/claude-messages-endpoint.test.ts lines 693-693 and 745-745, retaining the
single declaration needed by each test.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 018ae3a4-151b-40e8-a848-2e65bd069496

📥 Commits

Reviewing files that changed from the base of the PR and between 4f746d1 and cb1cb39.

📒 Files selected for processing (3)
  • src/server/claude-messages.ts
  • src/server/responses/core.ts
  • tests/claude-messages-endpoint.test.ts

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tests/claude-messages-endpoint.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Wibias ChatGPT Codex Connector

Wibias commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Please rebase this PR onto the latest dev (e8ce2b93dd3ef8074d96dee407704c5dc06e2699) before merge, then rerun the exact-head CI checks.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@luvs01
fix(claude): contain main credentials to canonical forward routes
9eaae1b
@luvs01
luvs01 force-pushed the agent/fix-claude-main-credential-boundary branch from cb1cb39 to 9eaae1b Compare August 9, 2026 23:25
@Wibias
Wibias marked this pull request as ready for review August 9, 2026 23:45
@Wibias
Wibias requested review from Ingwannu, Wibias and lidge-jun as code owners August 9, 2026 23:45
@github-actions github-actions Bot added the review-ready label Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Rate Limit Exceeded

@github-actions[bot] have exceeded the limit for the number of chat messages per hour. Please wait 48 minutes and 25 seconds before sending another message.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="lidge-jun/opencodex"
pr_number="1358"
required_dev_sha="e8ce2b93dd3ef8074d96dee407704c5dc06e2699"

echo "== Pull request metadata =="
gh pr view "$pr_number" --repo "$repo" \
  --json number,state,isDraft,headRefName,headRefOid,baseRefName,baseRefOid,mergeStateStatus,statusCheckRollup \
  --jq '{
    number,
    state,
    isDraft,
    headRefName,
    headRefOid,
    baseRefName,
    baseRefOid,
    mergeStateStatus,
    checks: [.statusCheckRollup[]? | {
      name,
      status,
      conclusion,
      workflowName,
      startedAt,
      completedAt,
      detailsUrl
    }]
  }'

echo
echo "== Required dev commit =="
gh api "repos/$repo/commits/$required_dev_sha" \
  --jq '{sha, commit: {message: .commit.message, committer: .commit.committer}}'

echo
echo "== Is the required dev commit an ancestor of the exact PR head? =="
head_sha="$(gh pr view "$pr_number" --repo "$repo" --json headRefOid --jq '.headRefOid')"
comparison="$(gh api "repos/$repo/compare/$required_dev_sha...$head_sha")"
printf '%s\n' "$comparison" | jq '{
  status,
  ahead_by,
  behind_by,
  merge_base_commit: .merge_base_commit.sha
}'

echo
echo "== Check runs attached to the exact PR head =="
gh api "repos/$repo/commits/$head_sha/check-runs?per_page=100" \
  --jq '[.check_runs[] | {
    name,
    status,
    conclusion,
    started_at,
    completed_at,
    details_url
  }]'

Length of output: 19838


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="lidge-jun/opencodex"
pr_number="1358"

head_sha="$(gh pr view "$pr_number" --repo "$repo" --json headRefOid --jq '.headRefOid')"
current_dev_sha="$(gh api "repos/$repo/git/ref/heads/dev" --jq '.object.sha')"

echo "== Current dev versus PR head =="
echo "current_dev_sha=$current_dev_sha"
echo "pr_head_sha=$head_sha"
gh api "repos/$repo/compare/$current_dev_sha...$head_sha" \
  --jq '{
    status,
    ahead_by,
    behind_by,
    merge_base_commit: .merge_base_commit.sha
  }'

Length of output: 907


@github-actions[bot] Verified for PR #1358.

  • PR head 9eaae1b22e5ab2115c97626284c13cbebd27f142 is 1 commit ahead and 0 commits behind current dev at d517161aeaa3a974ad3c0360ff0c97b03b4c4520.
  • It also contains the previously required dev commit e8ce2b93dd3ef8074d96dee407704c5dc06e2699.
  • The exact-head ci check succeeded.
  • The PR is open, not a draft, and GitHub reports merge state CLEAN.

The PR meets the stated rebase and exact-head CI requirements.

You are interacting with an AI system.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Wibias
Wibias merged commit c2cc244 into lidge-jun:dev Aug 10, 2026
31 of 35 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Wibias ChatGPT Codex Connector

Wibias commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Thanks @luvs01 — really appreciate the careful credential-boundary hardening here, especially covering final-route overrides and shadow rerouting with regressions. Merged! 🙏

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Aug 12, 2026
fix(auth): pin forwarded Codex credentials to ChatGPT #1471
Merged
[Bug]: ForwardAdmissionCredentialError blocks direct-mode OpenAI forwarding when caller authenticates with the proxy admission token #1687
Closed
[Bug]: ocx claude --dangerously-skip-permissions aborts as root (uid==0) because IS_SANDBOX is never set #1688
Closed
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
@Wibias
Merge pull request lidge-jun#1358 from luvs01/agent/fix-claude-main-c…
69472b9
…redential-boundary

fix(claude): contain main credentials to canonical forward routes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments
@lidge-jun lidge-jun Awaiting requested review from lidge-jun lidge-jun is a code owner
@Ingwannu Ingwannu Awaiting requested review from Ingwannu Ingwannu is a code owner
@Wibias Wibias Awaiting requested review from Wibias

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bug Something isn't working review-ready

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@luvs01 @Wibias
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.