GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(auth): pin forwarded Codex credentials to ChatGPT by luvs01 · Pull Request #1471 · lidge-jun/opencodex Conversation
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughCanonical OpenAI forward providers now use ChangesCanonical Codex routing
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
✅ Deterministic PR hygiene checks passed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. Automatic draft conversion failed. Please convert this pull request to a draft manually until every box above is ticked. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
392873c to
3725a3c
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Reviewed the credential-destination changes. I did not find an additional blocker in this head. The canonical-provider predicate rejects userinfo/query/hash/noncanonical destinations, dynamic caller and pool credentials are gated on that predicate, and canonical trailing-slash variants are pinned before credential-bearing endpoint construction.
I am not approving this head because GitHub currently reports it as not mergeable against the latest dev. Please rebase/resolve the conflicts and request re-review so the final credential boundary can be checked on the integrated diff.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
3725a3c to
8abf036
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
src/adapters/openai-responses.ts (1)
1174-1195: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winGate the required-account error on canonical providers.
Line 1185 throws when any forward provider has
_codexAccountRequired: truewithout an override. This includes noncanonical providers. Those providers must use their configured URL and static headers without requiring a Codex pool account.Require
mayForwardCallerCredentialsin this condition. Add a regression case with a noncanonical provider,_codexAccountRequired: true, and no_codexAccountOverride.Proposed fix
- if (runtimeProvider._codexAccountRequired && !runtimeProvider._codexAccountOverride) { + if ( + mayForwardCallerCredentials + && runtimeProvider._codexAccountRequired + && !runtimeProvider._codexAccountOverride + ) { throw new Error("Codex pool account auth is required but unavailable"); }This conflicts with the PR objective that noncanonical gateways retain static-header operation without caller or pool credentials.
🤖 Prompt for 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. In `@src/adapters/openai-responses.ts` around lines 1174 - 1195, Update the `_codexAccountRequired` validation in the response request flow so it throws only when `mayForwardCallerCredentials` is true and no `_codexAccountOverride` exists. Preserve noncanonical providers’ configured URL and static-header behavior without requiring pool credentials, and add a regression case covering a noncanonical provider with `_codexAccountRequired: true` and no override.
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/adapters/openai-responses.ts`:
- Around line 1174-1195: Update the `_codexAccountRequired` validation in the
response request flow so it throws only when `mayForwardCallerCredentials` is
true and no `_codexAccountOverride` exists. Preserve noncanonical providers’
configured URL and static-header behavior without requiring pool credentials,
and add a regression case covering a noncanonical provider with
`_codexAccountRequired: true` and no override.
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 46121151-b40d-49a3-837b-152da073e2d8
src/adapters/openai-responses.tssrc/providers/openai-sidecar.tssrc/server/live.tssrc/server/responses/compact.tstests/codex-metadata-integrity.test.tstests/openai-responses-passthrough.test.tstests/passthrough-override.test.tstests/responses-compaction-routing.test.tstests/server-images.test.tstests/server-live.test.tstests/vision-sidecar-e2e.test.tstests/web-search.test.ts
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Requesting changes for two regressions plus one remaining credential-boundary bug:
The PR currently breaks existing Responses behavior. The suite reports:
(fail) routed Responses custom-tool compatibility > handleResponses leaves custom tools native for forward-auth passthrough(fail) native openai-responses route carries prompt_cache_key + synthesized session_id headerThese failures are in code paths changed by this PR's canonical/noncanonical forward-provider classification. Please update the implementation and/or now-obsolete fixtures as appropriate, but the full affected behavior needs to remain covered and green before merge. In particular, make sure legitimate canonical native Responses requests still preserve their expected metadata/header behavior while noncanonical gateways do not inherit caller credentials.
Major: gate _codexAccountRequired on the canonical credential destination. In src/adapters/openai-responses.ts, the current condition throws for any authMode: "forward" provider with _codexAccountRequired: true and no _codexAccountOverride:
if (runtimeProvider._codexAccountRequired && !runtimeProvider._codexAccountOverride) { throw new Error("Codex pool account auth is required but unavailable"); }
That still includes noncanonical providers. It conflicts with this PR's objective that noncanonical gateways continue operating with their configured URL and static headers, without caller or pool credentials.
Please require mayForwardCallerCredentials in this condition, e.g. conceptually:
if ( mayForwardCallerCredentials && runtimeProvider._codexAccountRequired && !runtimeProvider._codexAccountOverride ) { throw new Error("Codex pool account auth is required but unavailable"); }
Add a regression case with a noncanonical provider, _codexAccountRequired: true, no _codexAccountOverride, and static configured headers. It should build/send against the configured noncanonical URL without requiring a Codex pool account and without forwarding caller credentials.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
8abf036 to
d2bd0f0
Compare
|
Re-review on exact head The blockers from the previous review are addressed on this head:
I traced the destination predicate through the adapter, sidecar, compact, and live paths and found no additional credential-boundary blocker. Exact-head validation under a 2-CPU/8-GB cap:
I am not approving or merging while the PR remains draft with the author's local-CI and ready-for-review boxes open. From the credential-destination and affected-path review, I found no remaining code blocker at this head; please complete the readiness/CI gate and request final review without changing the head. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
d2bd0f0 to
787db40
Compare
There was an error while loading. Please reload this page.
|
🧠 Learnings used
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash set -euo pipefail echo '== HEAD and merge base ==' git rev-parse HEAD git rev-parse dev git merge-base HEAD dev echo '== Changed files relative to dev ==' git diff --name-status dev...HEAD echo '== Changed TypeScript outlines ==' git diff --name-only dev...HEAD -- '*.ts' | while IFS= read -r file; do echo "--- $file" ast-grep outline "$file" --items all --type function,class,interface,type --view compact || true done echo '== Exact diff ==' git diff --find-renames --find-copies --unified=80 dev...HEAD -- \ src/adapters/openai-responses.ts \ src/providers/openai-sidecar.ts \ src/server/live.ts \ src/server/responses/compact.ts \ tests/openai-responses-passthrough.test.ts \ tests/responses-compaction-routing.test.ts \ tests/web-search.test.ts \ tests/server-live.test.ts \ tests/server-images.test.ts \ tests/vision-sidecar-e2e.test.ts \ tests/codex-metadata-integrity.test.ts \ tests/passthrough-override.test.ts Length of output: 1538 🏁 Script executed: #!/bin/bash set -euo pipefail repo="lidge-jun/opencodex" pr_number="1471" echo '== Available refs ==' git branch -a git show-ref --heads --remotes || true echo '== Pull request metadata ==' gh pr view "$pr_number" --repo "$repo" \ --json number,state,isDraft,baseRefName,baseRefOid,headRefName,headRefOid,mergeCommit,reviewDecision,statusCheckRollup \ --jq '{ number, state, isDraft, baseRefName, baseRefOid, headRefName, headRefOid, mergeCommit: (.mergeCommit.oid // null), reviewDecision, checks: [.statusCheckRollup[]? | {name, conclusion, status}] }' base_sha="$(gh pr view "$pr_number" --repo "$repo" --json baseRefOid --jq '.baseRefOid')" echo "== Diff summary from base $base_sha ==" git diff --stat "$base_sha...HEAD" git diff --name-status "$base_sha...HEAD" echo '== Relevant source outlines ==' for file in \ src/adapters/openai-responses.ts \ src/providers/openai-sidecar.ts \ src/server/live.ts \ src/server/responses/compact.ts; do echo "--- $file" ast-grep outline "$file" --items all --view compact done echo '== Relevant source and test diff ==' git diff --find-renames --find-copies --unified=100 "$base_sha...HEAD" -- \ src/adapters/openai-responses.ts \ src/providers/openai-sidecar.ts \ src/server/live.ts \ src/server/responses/compact.ts \ tests/openai-responses-passthrough.test.ts \ tests/responses-compaction-routing.test.ts \ tests/web-search.test.ts \ tests/server-live.test.ts \ tests/server-images.test.ts \ tests/vision-sidecar-e2e.test.ts \ tests/codex-metadata-integrity.test.ts \ tests/passthrough-override.test.ts Length of output: 5957 🏁 Script executed: #!/bin/bash set -euo pipefail base_sha="49887650eb2c7efa5c90996ec5108c8a7cfd129b" echo '== Changed source outlines ==' for file in \ src/adapters/openai-responses.ts \ src/providers/openai-sidecar.ts \ src/server/live.ts \ src/server/responses/compact.ts; do echo "--- $file" ast-grep outline "$file" --items all --view signatures done echo '== Full PR diff ==' git diff --find-renames --find-copies --unified=55 "$base_sha...HEAD" -- \ src/adapters/openai-responses.ts \ src/providers/openai-sidecar.ts \ src/server/live.ts \ src/server/responses/compact.ts \ tests/claude-messages-endpoint.test.ts \ tests/codex-metadata-integrity.test.ts \ tests/openai-responses-passthrough.test.ts \ tests/passthrough-override.test.ts \ tests/responses-compaction-routing.test.ts \ tests/responses-custom-tool-repair.test.ts \ tests/server-images.test.ts \ tests/server-live.test.ts \ tests/vision-sidecar-e2e.test.ts \ tests/web-search.test.ts echo '== Canonical-forward predicate and canonical-base references ==' rg -n -C 5 --glob '*.ts' \ 'CODEX_FORWARD_BASE_URL|isCanonical.*Codex|canonical.*Codex|is.*Forward.*Provider' \ src echo '== Response and sidecar URL construction contexts ==' rg -n -C 6 --glob '*.ts' \ 'new URL\(|/responses|/responses/compact|/realtime/calls|forwardLiveUrl|runWebSearch' \ src/adapters src/providers src/server Length of output: 192052 🏁 Script executed: #!/bin/bash set -euo pipefail base_sha="49887650eb2c7efa5c90996ec5108c8a7cfd129b" echo '== Canonical provider predicate ==' nl -ba src/providers/openai-tiers.ts | sed -n '1,65p' echo '== Forward request construction ==' nl -ba src/adapters/openai-responses.ts | sed -n '1200,1255p' echo '== Sidecar selection and pinning ==' nl -ba src/providers/openai-sidecar.ts | sed -n '35,90p' echo '== Native compact and live URL construction ==' nl -ba src/server/responses/compact.ts | sed -n '345,425p' nl -ba src/server/live.ts | sed -n '155,180p' echo '== Source-only PR diff ==' git diff --unified=25 "$base_sha...HEAD" -- \ src/adapters/openai-responses.ts \ src/providers/openai-sidecar.ts \ src/server/responses/compact.ts \ src/server/live.ts echo '== Focused test changes ==' git diff --unified=22 "$base_sha...HEAD" -- \ tests/openai-responses-passthrough.test.ts \ tests/responses-compaction-routing.test.ts \ tests/web-search.test.ts \ tests/server-live.test.ts \ tests/server-images.test.ts \ tests/vision-sidecar-e2e.test.ts \ tests/responses-custom-tool-repair.test.ts \ tests/claude-messages-endpoint.test.ts \ tests/codex-metadata-integrity.test.ts \ tests/passthrough-override.test.ts Length of output: 1609 🏁 Script executed: #!/bin/bash set -euo pipefail base_sha="49887650eb2c7efa5c90996ec5108c8a7cfd129b" echo '== Canonical provider predicate ==' sed -n '1,65p' src/providers/openai-tiers.ts echo '== Forward request construction ==' sed -n '1200,1255p' src/adapters/openai-responses.ts echo '== Sidecar selection and pinning ==' sed -n '35,90p' src/providers/openai-sidecar.ts echo '== Native compact and live URL construction ==' sed -n '345,425p' src/server/responses/compact.ts sed -n '155,180p' src/server/live.ts echo '== Source-only PR diff ==' git diff --unified=25 "$base_sha...HEAD" -- \ src/adapters/openai-responses.ts \ src/providers/openai-sidecar.ts \ src/server/responses/compact.ts \ src/server/live.ts echo '== Focused test changes ==' git diff --unified=22 "$base_sha...HEAD" -- \ tests/openai-responses-passthrough.test.ts \ tests/responses-compaction-routing.test.ts \ tests/web-search.test.ts \ tests/server-live.test.ts \ tests/server-images.test.ts \ tests/vision-sidecar-e2e.test.ts \ tests/responses-custom-tool-repair.test.ts \ tests/claude-messages-endpoint.test.ts \ tests/codex-metadata-integrity.test.ts \ tests/passthrough-override.test.ts Length of output: 74725
I found no new blocker. The implementation now applies the canonical destination predicate before it forwards caller credentials, enforces pool-account availability, or applies runtime account overrides in Noncanonical forward providers retain only configured static headers. They do not receive caller bearer tokens, ChatGPT account IDs, session metadata, or pool credentials. The canonical URL is pinned for Responses, sidecars, compact requests, and downstream image, vision, web-search, and live paths. The focused tests cover these paths and the trailing-slash variants. The PR gate is complete, and GitHub reports the required gate checks as successful. I did not execute tests in this restricted inspection sandbox. To approve through CodeRabbit, post the explicit top-level command: 🧠 Learnings usedYou are interacting with an AI system. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
src/adapters/openai-responses.ts (1)
579-640: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winAdd regression tests for batch normalization.
Lines 579-640 change request ordering when
requiresAdjacentResponsesToolResultsis enabled. Add adapter coverage for a reasoning turn with parallel calls, an interleaved non-tool item, and ordered outputs. Assert that the result iscalls → outputs → intervening item. Add cases that leave duplicate, missing, backward, and reversed outputs unchanged.As per path instructions, “A behavior change in src/ should come with a focused regression test near the existing tests for that subsystem.”
🤖 Prompt for 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. In `@src/adapters/openai-responses.ts` around lines 579 - 640, Add focused regression tests near the existing OpenAI Responses adapter tests for requiresAdjacentResponsesToolResults: verify a reasoning turn with parallel calls, an interleaved non-tool item, and ordered outputs normalizes to calls → outputs → intervening item. Also verify duplicate, missing, backward, and reversed output mappings return the original input unchanged.Source: Path instructions
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/adapters/openai-responses.ts`:
- Around line 579-640: Add focused regression tests near the existing OpenAI
Responses adapter tests for requiresAdjacentResponsesToolResults: verify a
reasoning turn with parallel calls, an interleaved non-tool item, and ordered
outputs normalizes to calls → outputs → intervening item. Also verify duplicate,
missing, backward, and reversed output mappings return the original input
unchanged.
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 74b95024-1d20-4939-8a3c-7d31088e180f
src/adapters/openai-responses.tstests/claude-messages-endpoint.test.tstests/openai-responses-passthrough.test.tstests/responses-custom-tool-repair.test.tstests/web-search.test.ts
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Re-review on current head 787db40d9411388b00c24a634f754e121a1f643c.
The earlier credential-boundary blockers are fixed on this head. Dynamic caller/pool credentials are gated on the canonical ChatGPT Codex destination, canonical trailing-slash variants are pinned before endpoint construction, _codexAccountRequired is now gated on that same canonical boundary, and the previously failing canonical metadata/custom-tool regressions have been updated. I did not find a new code blocker in the current diff. The later CodeRabbit batch-normalization note is outside this PR's behavioral change and comes from base history, not this credential patch.
The remaining blocker is integration. This head is now 10 commits behind current dev@70d2e175 after #1464 merged, with overlap in tests/claude-messages-endpoint.test.ts. Exact-head Cross-platform CI and React Doctor are action_required, and the Cross-platform run executed zero jobs.
Please rebase onto current dev and obtain an executed exact-head CI signal, then request re-review. No additional credential-scope changes are requested from my review.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
787db40 to
fa87583
Compare
|
Tip For best results, initiate chat on the files or code changes.
The checklist and hygiene checks passed. The prior review found no remaining code blocker on this head. Post 🧠 Learnings usedYou are interacting with an AI system. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
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`:
- Around line 653-660: Update the fetch shim around the canonical Codex routing
condition to fail closed for any request whose origin is https://chatgpt.com and
whose pathname is not exactly /backend-api/codex/responses: reject it instead of
passing it to originalFetch. Preserve the existing rewrite for the exact
canonical path and normal passthrough for non-canonical origins.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 0e0b3036-01a7-4deb-9ea1-13cad4398394
tests/claude-messages-endpoint.test.ts
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
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="1471" previous_head="80aeb36aa0d0f55276f4f42132f14ae71925db14" current_head="cd5b3b766dd2c713804963babfb3ba60976b05b1" echo '== PR state and checks ==' gh pr view "$pr" --repo "$repo" \ --json state,isDraft,headRefOid,baseRefOid,reviewDecision,labels,statusCheckRollup \ --jq '{ state, isDraft, headRefOid, baseRefOid, reviewDecision, labels: [.labels[].name], checks: [.statusCheckRollup[]? | {name,status,conclusion,isRequired}] }' echo '== Head verification ==' git rev-parse HEAD git cat-file -e "${previous_head}^{commit}" git cat-file -e "${current_head}^{commit}" git merge-base --is-ancestor "$previous_head" "$current_head" \ && echo 'previous_head_is_ancestor=true' \ || echo 'previous_head_is_ancestor=false' git merge-base --is-ancestor "$current_head" HEAD \ && echo 'current_head_is_checked_out=true' \ || echo 'current_head_is_checked_out=false' echo '== Incremental commits ==' git log --format='%H %s' "${previous_head}..${current_head}" echo '== Incremental files ==' git diff --name-status "${previous_head}..${current_head}" echo '== Changed production-file outlines ==' git diff --name-only "${previous_head}..${current_head}" -- src | while IFS= read -r file; do echo "--- $file" ast-grep outline "$file" --items all --view signatures || true done echo '== Incremental production diff ==' git diff --find-renames --find-copies --unified=45 "${previous_head}..${current_head}" -- src echo '== Incremental tests and workflow diff ==' git diff --find-renames --find-copies --unified=35 "${previous_head}..${current_head}" -- tests .github package.json bun.lockb Length of output: 105522 🏁 Script executed: #!/bin/bash set -euo pipefail repo="lidge-jun/opencodex" pr="1471" previous_head="80aeb36aa0d0f55276f4f42132f14ae71925db14" current_head="cd5b3b766dd2c713804963babfb3ba60976b05b1" echo '== Current PR status and checks ==' gh pr view "$pr" --repo "$repo" \ --json state,isDraft,headRefOid,reviewDecision,labels,statusCheckRollup \ --jq '{ state, isDraft, headRefOid, reviewDecision, labels: [.labels[].name], checks: [.statusCheckRollup[]? | {name,status,conclusion,isRequired}] }' echo '== Changed production files ==' git diff --name-status "${previous_head}..${current_head}" -- src echo '== Candidate source files ==' fd -t f . src | rg \ 'local-management-capability|local-management-attestation|management-auth|auth-cors|direct.*transport|local.*transport|reasoning-replay-cache|responses/core|openai-chat|request-log|usage/(log|summary)|account-label' echo '== Local management capability implementation and uses ==' rg -n -C 8 \ 'LOCAL_MANAGEMENT_CAPABILITY|createLocalManagementReadCapability|verifyLocalManagementReadCapability|local-read-capability|LOCAL_MANAGEMENT_READ_PATHS' \ src echo '== Local direct transport implementation and uses ==' rg -n -C 8 \ 'attestationSecret|readRuntimePort|findLiveProxy|management.*fetch|managementHeaders|LOCAL_ATTESTATION|local management' \ src/cli src/server src/lib echo '== Reasoning replay cache implementation and scope binding ==' ast-grep outline src/responses/reasoning-replay-cache.ts --items all --view signatures rg -n -C 8 \ 'reasoningReplay(Key|OAuth|Codex)CredentialIdentity|reasoningReplayDestinationIdentity|bindReasoningReplayScope|_reasoningReplayScope' \ src echo '== Focused implementation diffs ==' git diff --unified=50 "${previous_head}..${current_head}" -- \ src/lib/local-management-capability.ts \ src/server/management-auth.ts \ src/server/auth-cors.ts \ src/responses/reasoning-replay-cache.ts \ src/server/responses/core.ts \ src/adapters/openai-chat.ts \ src/server/request-log.ts \ src/usage/log.ts \ src/usage/summary.ts \ src/codex/account-label.ts Length of output: 111230 🏁 Script executed: #!/bin/bash set -euo pipefail echo '== Local capability module outline ==' ast-grep outline src/lib/local-management-capability.ts --items all --view expanded echo '== Local capability module ==' cat -n src/lib/local-management-capability.ts echo '== Management authentication enforcement ==' rg -n -C 16 \ 'local-read-capability|verifyLocalManagementReadCapability|requireManagementAuth|managementPrincipal' \ src/server/management-auth.ts src/server/auth-cors.ts echo '== CLI capability generation and management request transport ==' rg -n -C 16 \ 'createLocalManagementReadCapability|LOCAL_MANAGEMENT_READ_PATHS|readRuntimePortImpl|attestationSecret|managementHeaders|management.*fetch' \ src/cli echo '== Terminal continuation variable and bridge context ==' rg -n -C 20 \ 'nextParsed|fetchTerminalGuardContinuation|bindRouteReasoningReplayScope\(|replayCacheScope:' \ src/server/responses/core.ts echo '== Replay cache module ==' cat -n src/responses/reasoning-replay-cache.ts echo '== Account label source and request-log serialization ==' cat -n src/codex/account-label.ts rg -n -C 12 \ 'accountLogLabel|sealRequestAttemptIdentity|addFinalRequestLog|requestLogErrorCode' \ src/server/request-log.ts src/server/responses/core.ts Length of output: 120789 🏁 Script executed: #!/bin/bash set -euo pipefail echo '== Terminal guard implementation ==' ast-grep outline src/server/responses/terminal-guard.ts --items all --view expanded cat -n src/server/responses/terminal-guard.ts echo '== Parsed request type and copy sites ==' rg -n -C 12 \ 'OcxReasoningReplayScopeRef|_reasoningReplayScope|structuredClone\(.*parsed|\.{3}parsed|Object\.assign\(.*parsed|nextParsed' \ src tests echo '== OpenAI Chat replay lookup ==' rg -n -C 18 \ 'peekReasoningForCall|_reasoningReplayScope|reasoning_content|tool_calls' \ src/adapters/openai-chat.ts echo '== Existing terminal-continuation tests ==' rg -n -C 12 \ 'terminal.*continuation|terminal guard|end_turn|key-429|reasoning.*replay' \ tests Length of output: 197602 🏁 Script executed: #!/bin/bash set -euo pipefail echo '== Terminal guard source ==' cat -n src/server/responses/terminal-guard.ts echo '== Terminal continuation failover test ==' sed -n '125,180p' tests/terminal-guard-server.test.ts echo '== Current head and check rollup ==' gh pr view 1471 --repo lidge-jun/opencodex \ --json headRefOid,state,isDraft,reviewDecision,labels,statusCheckRollup \ --jq '{ headRefOid, state, isDraft, reviewDecision, labels: [.labels[].name], checks: [.statusCheckRollup[]? | {name,status,conclusion,isRequired}] }' Length of output: 16067
The READY gate completed at GitHub now reports head The PR is also a draft. GitHub reports The current check rollup shows only I reviewed the local management capability implementation. It binds the capability to the exact Mark the PR ready for review. Run the required checks on 🧠 Learnings usedYou are interacting with an AI system. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
🧩 Analysis chain🏁 Script executed: #!/bin/bash set -euo pipefail repo="lidge-jun/opencodex" pr="1471" gate_head="52fe372c0e354af2082a9fa503483054aeb8c786" echo '== Pull request state and checks ==' gh pr view "$pr" --repo "$repo" \ --json state,isDraft,headRefOid,baseRefOid,reviewDecision,labels,statusCheckRollup \ --jq '{ state, isDraft, headRefOid, baseRefOid, reviewDecision, labels: [.labels[].name], checks: [ .statusCheckRollup[]? | {name, status, conclusion, isRequired: (.isRequired // null)} ] }' current_head="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq -r '.headRefOid')" echo '== Head relationship ==' printf 'gate_head=%s\ncurrent_head=%s\n' "$gate_head" "$current_head" git cat-file -e "${gate_head}^{commit}" git cat-file -e "${current_head}^{commit}" git merge-base --is-ancestor "$gate_head" "$current_head" \ && echo 'gate_head_is_ancestor_of_current_head=true' \ || echo 'gate_head_is_ancestor_of_current_head=false' echo '== Commits after gate-completed head ==' git log --oneline "${gate_head}..${current_head}" echo '== Changed files after gate-completed head ==' git diff --name-status "${gate_head}..${current_head}" echo '== Changed source outlines ==' git diff --name-only "${gate_head}..${current_head}" -- 'src/**/*.ts' | while IFS= read -r file; do echo "--- $file" ast-grep outline "$file" --items all --view signatures || true done echo '== Incremental source and test diff ==' git diff --find-renames --find-copies --unified=50 "${gate_head}..${current_head}" -- src tests Length of output: 2811 🏁 Script executed: #!/bin/bash set -euo pipefail repo="lidge-jun/opencodex" pr="1471" head="52fe372c0e354af2082a9fa503483054aeb8c786" echo '== Workflow runs for the exact head ==' gh run list --repo "$repo" --commit "$head" --limit 100 \ --json databaseId,name,workflowName,status,conclusion,event,headSha,url,createdAt,updatedAt \ --jq 'sort_by(.workflowName, .databaseId) | .[] | { databaseId, workflowName, name, status, conclusion, event, headSha, url, createdAt, updatedAt }' echo '== Required workflow run summary ==' gh run list --repo "$repo" --commit "$head" --limit 100 \ --json workflowName,status,conclusion \ --jq 'group_by(.workflowName) | map({ workflowName: .[0].workflowName, runs: map({status, conclusion}) })' echo '== Head and gate commit relationship ==' git rev-parse HEAD git cat-file -e "${head}^{commit}" git merge-base --is-ancestor "$head" HEAD \ && echo 'gate_head_is_ancestor_of_checked_out_head=true' \ || echo 'gate_head_is_ancestor_of_checked_out_head=false' echo '== Commits after the gate-completed head ==' git log --oneline "${head}..HEAD" Length of output: 4094 🏁 Script executed: #!/bin/bash set -euo pipefail repo="lidge-jun/opencodex" pr="1471" run_id="31579662202" head="52fe372c0e354af2082a9fa503483054aeb8c786" echo '== React Doctor run details ==' gh run view "$run_id" --repo "$repo" --json \ databaseId,name,workflowName,status,conclusion,event,headSha,url,createdAt,updatedAt,jobs \ --jq '{ databaseId, workflowName, name, status, conclusion, event, headSha, url, createdAt, updatedAt, jobs: [ .jobs[]? | { databaseId, name, status, conclusion, startedAt, completedAt, steps: [ .steps[]? | {name, status, conclusion, number} ] } ] }' echo '== Recent pull-request workflow runs ==' gh run list --repo "$repo" --branch "$(gh pr view "$pr" --repo "$repo" --json headRefName --jq '.headRefName')" --limit 100 \ --json databaseId,workflowName,name,status,conclusion,event,headSha,createdAt,url \ --jq '.[] | select(.event == "pull_request" or .event == "pull_request_target") | { databaseId, workflowName, name, status, conclusion, event, headSha, createdAt, url }' echo '== Workflow files that define test or platform jobs ==' fd -t f -e yml -e yaml .github/workflows -x sh -c \ 'if rg -n -i "test [1-4]/4|macos|keyring|npm-global|workflow_dispatch|pull_request" "$1" >/dev/null; then echo "--- $1" rg -n -i -C 2 "test [1-4]/4|macos|keyring|npm-global|workflow_dispatch|pull_request" "$1" fi' sh {} Length of output: 30852
I cannot confirm full CI success from GitHub Actions.
A maintainer must resolve or explain the I will complete a review of the current head. 🧠 Learnings used✅ Action performedReview finished.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
52fe372 to
875a694
Compare
|
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="1471" gate_head="52fe372c0e354af2082a9fa503483054aeb8c786" previous_reviewed_head="80aeb36aa0d0f55276f4f42132f14ae71925db14" echo '== PR state and status checks ==' gh pr view "$pr" --repo "$repo" \ --json state,isDraft,headRefOid,baseRefOid,reviewDecision,labels,statusCheckRollup \ --jq '{ state, isDraft, headRefOid, baseRefOid, reviewDecision, labels: [.labels[].name], checks: [.statusCheckRollup[]? | {name,status,conclusion,isRequired}] }' current_head="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq -r .headRefOid)" printf '\n== Head verification ==\ngate_head=%s\ncurrent_head=%s\n' "$gate_head" "$current_head" git merge-base --is-ancestor "$gate_head" "$current_head" \ && echo 'gate_head_is_ancestor_of_current_head=true' \ || echo 'gate_head_is_ancestor_of_current_head=false' echo '== Commits after prior reviewed head ==' git log --oneline "${previous_reviewed_head}..${current_head}" echo '== Full changed-file list after prior reviewed head ==' git diff --name-status "${previous_reviewed_head}..${current_head}" echo '== Changed source outlines ==' git diff --name-only "${previous_reviewed_head}..${current_head}" -- 'src/**/*.ts' | while IFS= read -r file; do echo "--- $file" ast-grep outline "$file" --items all --view signatures || true done echo '== Full production diff after prior reviewed head ==' git diff --find-renames --find-copies --unified=40 \ "${previous_reviewed_head}..${current_head}" -- src echo '== Full test and workflow diff after prior reviewed head ==' git diff --find-renames --find-copies --unified=35 \ "${previous_reviewed_head}..${current_head}" -- tests .github package.json bun.lockb echo '== Workflow runs for the current head ==' gh run list --repo "$repo" --commit "$current_head" --limit 100 \ --json databaseId,workflowName,status,conclusion,event,headSha,url \ --jq 'sort_by(.workflowName, .databaseId) | .[] | {databaseId,workflowName,status,conclusion,event,headSha,url}' Length of output: 3052 🏁 Script executed: #!/bin/bash set -euo pipefail repo="lidge-jun/opencodex" pr="1471" gate_head="52fe372c0e354af2082a9fa503483054aeb8c786" current_head="875a694f473ec6403130f5ab73185560679c6823" echo '== Head graph ==' git log --oneline --decorate -25 "$current_head" echo '== Commit range after gate head ==' git log --format='%H%n%s%n%b%n---' "${gate_head}..${current_head}" echo '== Changed files after gate head ==' git diff --name-status "${gate_head}..${current_head}" git diff --stat "${gate_head}..${current_head}" echo '== Changed production files and outlines ==' git diff --name-only "${gate_head}..${current_head}" -- src | while IFS= read -r file; do echo "--- $file" ast-grep outline "$file" --items all --view signatures || true done echo '== Incremental production diff ==' git diff --find-renames --find-copies --unified=50 \ "${gate_head}..${current_head}" -- src echo '== Incremental tests, workflows, and package diff ==' git diff --find-renames --find-copies --unified=40 \ "${gate_head}..${current_head}" -- tests .github package.json bun.lockb echo '== Workflow runs for the current head ==' gh run list --repo "$repo" --commit "$current_head" --limit 100 \ --json databaseId,workflowName,status,conclusion,event,headSha,url,createdAt,updatedAt \ --jq 'sort_by(.workflowName, .databaseId) | .[] | {databaseId,workflowName,status,conclusion,event,headSha,url,createdAt,updatedAt}' Length of output: 17381 🏁 Script executed: #!/bin/bash set -euo pipefail repo="lidge-jun/opencodex" echo '== Current changed workflow lines ==' nl -ba .github/workflows/release.yml | sed -n '135,195p' echo '== Current changed test lines ==' nl -ba tests/ci-workflows.test.ts | sed -n '585,640p' for run_id in 31580237649 31580237765; do echo "== Workflow run ${run_id} ==" gh run view "$run_id" --repo "$repo" \ --json databaseId,workflowName,status,conclusion,event,headSha,url,jobs \ --jq '{ databaseId, workflowName, status, conclusion, event, headSha, url, jobs: [ .jobs[]? | { name, status, conclusion, startedAt, completedAt, steps: [.steps[]? | {name,status,conclusion}] } ] }' || true done echo '== Check suite details for the current head ==' gh api "repos/lidge-jun/opencodex/commits/875a694f473ec6403130f5ab73185560679c6823/check-suites" \ --jq '.check_suites[] | {app: .app.slug, status, conclusion, head_sha, url: .url}' || true Length of output: 1434 🏁 Script executed: #!/bin/bash set -euo pipefail repo="lidge-jun/opencodex" echo '== Current changed workflow lines ==' awk 'NR >= 135 && NR <= 195 { printf "%6d %s\n", NR, $0 }' .github/workflows/release.yml echo '== Current changed test lines ==' awk 'NR >= 585 && NR <= 640 { printf "%6d %s\n", NR, $0 }' tests/ci-workflows.test.ts for run_id in 31580237649 31580237765; do echo "== Workflow run ${run_id} ==" gh run view "$run_id" --repo "$repo" \ --json databaseId,workflowName,status,conclusion,event,headSha,url,jobs \ --jq '{ databaseId, workflowName, status, conclusion, event, headSha, url, jobs: [ .jobs[]? | { name, status, conclusion, startedAt, completedAt, steps: [.steps[]? | {name,status,conclusion}] } ] }' || true done echo '== Check suites for the current head ==' gh api "repos/lidge-jun/opencodex/commits/875a694f473ec6403130f5ab73185560679c6823/check-suites" \ --jq '.check_suites[] | {app: .app.slug, status, conclusion, head_sha, url: .url}' || true Length of output: 10167
I found no code blocker in the incremental diff. In
I used the existing readiness-gate guidance. The READY state is stale because it completed at I cannot approve this PR yet.
A maintainer must resolve or explain both 🧠 Learnings usedYou are interacting with an AI system. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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="1471" gate_head="875a694f473ec6403130f5ab73185560679c6823" echo '== Pull request state and check rollup ==' gh pr view "$pr" --repo "$repo" \ --json state,isDraft,headRefOid,baseRefOid,reviewDecision,labels,statusCheckRollup \ --jq '{ state, isDraft, headRefOid, baseRefOid, reviewDecision, labels: [.labels[].name], checks: [ .statusCheckRollup[]? | {name, status, conclusion, isRequired: (.isRequired // null)} ] }' echo '== Gate-head relationship ==' current_head="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq -r .headRefOid)" printf 'gate_head=%s\ncurrent_head=%s\n' "$gate_head" "$current_head" git cat-file -e "${gate_head}^{commit}" git cat-file -e "${current_head}^{commit}" git merge-base --is-ancestor "$gate_head" "$current_head" \ && echo 'gate_head_is_ancestor_of_current_head=true' \ || echo 'gate_head_is_ancestor_of_current_head=false' git log --oneline "${gate_head}..${current_head}" echo '== GitHub Actions runs for the gate head ==' gh run list --repo "$repo" --commit "$gate_head" --limit 100 \ --json databaseId,workflowName,name,status,conclusion,event,headSha,url,createdAt,updatedAt \ --jq 'sort_by(.workflowName, .databaseId) | .[] | { databaseId, workflowName, name, status, conclusion, event, headSha, url, createdAt, updatedAt }' echo '== Check suites for the gate head ==' gh api "repos/${repo}/commits/${gate_head}/check-suites" \ --jq '.check_suites[] | { app: .app.slug, status, conclusion, head_sha, url: .html_url }' Length of output: 2905 🏁 Script executed: #!/bin/bash set -euo pipefail repo="lidge-jun/opencodex" head="875a694f473ec6403130f5ab73185560679c6823" echo '== GitHub Actions workflow runs for the exact head ==' gh run list --repo "$repo" --commit "$head" --limit 100 \ --json databaseId,workflowName,name,status,conclusion,event,headSha,url,createdAt,updatedAt \ --jq 'sort_by(.workflowName, .databaseId) | .[] | { databaseId, workflowName, name, status, conclusion, event, headSha, url, createdAt, updatedAt }' || true echo '== Check suites for the exact head ==' gh api "repos/${repo}/commits/${head}/check-suites" \ --jq '.check_suites[] | { app: .app.slug, status, conclusion, head_sha, url: .html_url }' || true echo '== Check runs for the exact head ==' gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \ --jq '.check_runs[] | { name, app: .app.slug, status, conclusion, details_url }' || true Length of output: 5617
I cannot approve the PR yet. GitHub Actions reports two completed workflows with GitHub also reports The successful checks are limited to the target, label, hygiene, and resolve workflows. The API does not show successful test-shard or platform-job results for this head. A maintainer must resolve or explain both 🧠 Learnings usedYou are interacting with an AI system. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Pinning the forwarded Codex credentials to the ChatGPT host closes the configured-target path, but the credential-bearing sidecars still followed a cross-origin 3xx. Bun strips `Authorization` on a cross-origin redirect and forwards nonstandard headers, so `chatgpt-account-id`, `session_id` and `x-codex-turn-metadata` reached the redirect target. Verified with a two-server probe. Set `redirect: "manual"` on the five credential-bearing sidecar fetches: images, live, search relays plus the web-search and vision sidecars. The Responses and compact paths already reach the same policy through `fetchWithHeaderTimeout(manualRedirect)`; the new test pins both families so they cannot drift apart.
875a694 to
3cb9cf6
Compare
Review: LAND (after one fix folded in on top)Verified against the current What the PR gets rightPinning the forwarded Codex credentials to the canonical ChatGPT host is the correct shape of defense. The fail-closed path check in the follow-up commit closes the obvious "unexpected path" bypass instead of allow-listing, which is the right default for a credential boundary. The gap I found and fixedHost pinning closes the configured target, but it does not close the redirect. Bun follows cross-origin 3xx responses, and while it drops So a request pinned to the canonical host that receives a redirect would still hand the account id, session id, and turn metadata to the redirect target. Fix:
The Responses and compact paths already reach the same policy through a different mechanism — One behavior change worth calling outA noncanonical gateway configured with VerificationRun on the Linux CI host, Bun 1.3.14, at the pushed head.
Red-before was confirmed: with only the test file applied to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
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="1471" echo '== Pull request state ==' gh pr view "$pr" --repo "$repo" \ --json state,isDraft,headRefOid,reviewDecision,labels,statusCheckRollup \ --jq '{ state, isDraft, headRefOid, reviewDecision, labels: [.labels[].name], checks: [ .statusCheckRollup[]? | {name, status, conclusion, isRequired: (.isRequired // null), detailsUrl} ] }' head="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq -r .headRefOid)" printf '\n== Exact-head workflow runs: %s ==\n' "$head" gh run list --repo "$repo" --commit "$head" --limit 100 \ --json databaseId,workflowName,status,conclusion,event,headSha,url \ --jq 'sort_by(.workflowName, .databaseId) | .[] | { databaseId, workflowName, status, conclusion, event, headSha, url }' printf '\n== Exact-head check runs ==\n' gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \ --jq '.check_runs[] | { name, app: .app.slug, status, conclusion, details_url }' Length of output: 2326 🏁 Script executed: #!/bin/bash set -euo pipefail repo="lidge-jun/opencodex" gate_head="875a694f473ec6403130f5ab73185560679c6823" current_head="3cb9cf6965a0f474db140895737f5a359fb721e9" echo '== Head relationship ==' git cat-file -e "${gate_head}^{commit}" git cat-file -e "${current_head}^{commit}" git merge-base --is-ancestor "$gate_head" "$current_head" \ && echo 'gate_head_is_ancestor_of_current_head=true' \ || echo 'gate_head_is_ancestor_of_current_head=false' echo '== Commits after gate head ==' git log --oneline "${gate_head}..${current_head}" echo '== Files changed after gate head ==' git diff --name-status "${gate_head}..${current_head}" echo '== Workflow runs for current head ==' gh api "repos/${repo}/actions/runs?head_sha=${current_head}&per_page=100" \ --jq '.workflow_runs[] | { databaseId: .id, workflowName: .name, status, conclusion, event, headSha: .head_sha, url: .html_url }' echo '== Check runs for current head ==' gh api "repos/${repo}/commits/${current_head}/check-runs?per_page=100" \ --jq '.check_runs[] | { name, app: .app.slug, status, conclusion, details_url }' Length of output: 13529
The gate completed at I cannot approve this PR.
Resolve or document both 🧠 Learnings usedYou are interacting with an AI system. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ts (lidge-jun#1471) Pins forwarded Codex credentials to the canonical ChatGPT host with a fail-closed path check, and stops the five credential-bearing sidecar fetches from following cross-origin redirects. Bun strips Authorization across origins but forwards nonstandard headers, so chatgpt-account-id, session_id and x-codex-turn-metadata would otherwise reach a redirect target. tests/credential-redirect-guard.test.ts pins both the sidecar family and the shared fetchWithHeaderTimeout helper. Co-authored-by: luvs01 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.