Repository navigation
Fix Codex usage bypassing configured proxy routing - #26942
Conversation
8f1e26a to
bfcca95
Compare
c659f70 to
ebf54f1
Compare
…roxy Use the host HTTP client for usage, reset-credit reads and redemption, keep those account requests cookie-free, and pass configured proxy settings to the native Codex probe. WSL probes keep the guest's own proxy environment. Co-authored-by: petersindex <[email protected]> Co-authored-by: mmarabel <[email protected]>
ebf54f1 to
ab63d0f
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to Codex usage, reset-credit, and redemption requests now route through the configured proxy, and the change looks safe to merge. Actual WSL guest behavior is still pending validation by the author. Pre-merge checks |
|
ELI5
Codex usage checks can ignore the HTTP proxy configured in Advanced settings. They now use Orca's configured desktop connection and pass the same proxy settings to the background Codex probe.
What Changed
Usage reads, reset-credit reads and redemption use the existing host HTTP client. Codex requests keep explicit account authentication and omit desktop-session cookies. All four service paths forward their existing local proxy settings. Native probes receive the validated proxy environment; WSL receives values through private environment carriers and restores them after login, keeping proxy credentials out of command arguments.
Why
The previous backend used Node fetch, which bypassed the desktop proxy, while the probe missed the configured environment. Reusing the host client and existing proxy/WSL helpers preserves host selection, cancellation and account-home ownership without adding another transport or remote protocol field.
This PR is stacked on #26957. That prerequisite fixes a separately reproduced failure to answer a cold Basic proxy challenge in the desktop HTTP client. The routing patch itself is unchanged; both fixes are needed for the measured cold authenticated Codex calls to work.
Linked Issue
Addresses the request-routing portion of #26477. The requested error-display improvement is outside this fix; #26477 remains open. Related reports: #19755 and #11752. Retains material from @petersindex's #26497 and @mmarabel's #19931, credited as co-authors. Thanks to @rodboev for the earlier investigation in #11862.
Visual Proof
Actual cold-authentication before/after: routing alone fails the usage, redemption and public-service calls with zero destination requests. With #26957, those operations complete with five cookie-free destination requests and ten cold proxy attempts. The fixture clears its session authentication cache and connections before every HTTP-port call; no app login handler or manual warm-up is installed. Explicit bypass stays direct, and a rejecting proxy reaches zero destinations. Download the cold trace. No rendered UI change.
Original routing before/after remains unchanged: five configured calls change from direct to proxied, bypass stays direct and a failed proxy changes from five direct origin calls to zero. This earlier proof uses cached proxy authentication and is not a cold-authentication claim. Download the original trace.
Testing
Actual macOS Electron 43.7.5 fixture exercises the production Codex fetcher, redemption and public service. All five configured and five bypass requests retain exact synthetic bearer/account authentication, the POST payload and zero desktop cookies. Six controlled probe processes per revision receive the fixture-owned account home and configured environment. Rejecting-proxy, no-direct-fallback, positive cookie and cleanup controls pass; no real CLI, account, user credential home, external endpoint or window is used.
Fresh combined local validation passes 297 tests across 26 suites, Node/CLI typechecks and the changed-code quality gate. The routing-only diff has an identical range-diff to its original commit, preserving all twelve files and both material contributor credits.
Separate prerequisite portability checks pass 149 tests across ten suites on native Windows and Linux; these use Request/stream fixtures, not native network captures. The original routing-only checks passed all 148 on Linux. Windows passed 137, skipped two POSIX cases and had nine failures independently reproduced on the pinned baseline: seven existing Fable policy expectations and two graceful-EOF child-termination expectations. Those failures are not claimed fixed by the stack. Windows carrier construction passes; the emitted POSIX WSL command runs with login overrides and hostile quoted values. Actual wsl.exe guest execution is pending: its controlled local constructor capture correctly refused an unexpected injected Windows authority key, before any guest command. Native Windows/Linux networking and SSH transport are outside the measured macOS proof. Node/SSH HTTP fallback remains unchanged.
AI Disclosure
Review
Root and independent source/proof reviews are clean. The routing patch preserves its original contributor trailers; source, fixture, proof and published asset hashes are recorded in the review packet. Final stacked source and actual cold proof were reviewed separately from the retained original evidence.
Agent skill upstream boundary
Notes
The base is the authentication prerequisite branch; the diff contains only the Codex routing fix. Execution hosts continue to own settings and credential homes; optional local settings preserve older callers. Proxy values stay in the child environment. No global cookie policy, retry policy, billing behavior or remote wire change.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)