Repository navigation
Fix commented-out Codex base URL overrides - #4330
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. Reviewed October 7, 2026, 8:06 PM ET / October 8, 2026, 00:06 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR corrects parsing of commented Codex endpoint overrides, adds isolated regression tests, and documents the behavior. Merge readiness⛔ Needs changes before merge - 1 item remains The fix remains necessary on current main and the latest release. No actionable patch defect was found, and production-path proof is sufficient; repository-required validation remains incomplete. Priority: P2 Review scores
Verification
How this fits togetherCodexBar reads Codex configuration to choose the endpoint for authenticated usage requests. Returned quota data feeds the app and CLI usage displays. flowchart TD
A[Codex configuration file] --> B[Ignore comments]
B --> C{Active override?}
C -->|Yes| D[Configured endpoint]
C -->|No| E[Default endpoint]
D --> F[Authenticated HTTP request]
E --> F
F --> G[Quota display]
Before merge
Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep the existing endpoint resolver and apply this focused comment-parsing correction with isolated regression coverage. Do we have a high-confidence way to reproduce the issue? Yes, current-main source establishes that a leading comment marker loses its empty prefix and lets the commented endpoint shadow active configuration. Contributor CLI evidence confirms the failure on v0.72.0; this review did not execute current main. Is this the best way to solve the issue? Yes, preserving the empty prefix is the narrowest repair and retains existing override, fallback, and inline-comment handling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 844b0e19bbbb. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Merge the reviewed main baseline without rewriting the contributor commit. Exercise commented and active overrides through isolated config.toml files, document comment handling, and record contributor credit for steipete#4330.
# Conflicts: # CHANGELOG.md
|
Thanks @lishouxian! Merged in f8b75cf: a commented-out Codex base URL override was still being applied because the parser matched the key inside the comment; commented overrides are now ignored, with parser and on-disk configuration regressions. Ships in the next release. |
Problem
A commented-out
chatgpt_base_urlat the start of a line is treated as an active override. For example:# chatgpt_base_url = "http://127.0.0.1:8788/backend-api/"CodexBar attempts to fetch usage from that address instead of the default endpoint, resulting in a network error when the old local service is stopped. A commented override can also shadow an active setting later in the file.
Change
Preserve empty subsequences when splitting a line at
#, so a full-line comment leaves an empty prefix that is skipped. Existing inline-comment handling is preserved.Add five regression cases covering full-line comments with and without whitespace, fallback to the default usage endpoint, and an active override following a comment with a trailing inline comment.
Built production-path proof
Verified locally on October 7, 2026 using the actual CLI built from PR head
765869ff644e30d389c1ff526591ab97b29bbb32:A temporary
CODEX_HOMEcontained an on-diskconfig.tomlwith a commented loopback override followed by an active loopback mock-server override:The harness used a synthetic
auth.json(fake access/refresh tokens and a fresh timestamp), a separate version-1CODEXBAR_CONFIGenabling only Codex, a temporary home, andCODEXBAR_DISABLE_KEYCHAIN_ACCESS=1. Both endpoint candidates were loopback addresses. It did not use real credentials, browser cookies, or a live OpenAI endpoint.The same CLI arguments and fixture were exercised against the installed v0.72.0 binary and the newly built PR binary:
The mock server returned fixed 12%/34% usage values; the harness asserted the successful exit, the actual
/backend-api/wham/usagerequest, and the decoded 34% weekly value. This exercises file loading, endpoint resolution, HTTP fetching, and usage decoding in the compiled production CLI, without extracting/reimplementing those paths. The before comparison is the installed v0.72.0 release, not a separately rebuilt base revision.Validation
DYLD_FRAMEWORK_PATH.git diff --check: passed.make test/make test-fast: blocked by the installed Python lackingos.waitidrequired by the test runner.swift test --filter CodexOAuthTestswithScripts/test_environment.sh: build blocked becauseactoolrequires full Xcode; only Command Line Tools are installed.make check: stopped in the existing packaged-app launch isolation test because the synthetic ambient home acquired aLibrarydirectory. Format and lint checks were subsequently run separately.No real account credentials or external live provider calls were used in these tests.
The upstream CI run is currently
action_requiredfor this fork PR. Maintainer approval is needed before hosted checks can run; fullmake test/make checksuccess is not claimed.