Repository navigation
fix: discard credential-bearing Codex CLI error text (#329) - #330
Conversation
|
@sfl review |
There was a problem hiding this comment.
✅ Verdict: PASS • Round 1
Confidence: 8/10 · Project risk: 4/10 (codexbar)
Review done by claude-opus-5-5 (adversarial to codex)
The PR stops copying Codex app-server JSON-RPC error.message and failed account/login/completed params.error text into AppServerError::Refused, uses fixed local messages instead, and adds mock-transport tests that check both Display and Debug output. The fix closes the leak on both paths with no Critical, High or Medium defects, so it is approvable. Two Low quality findings remain: a stale UI test and duplicated failure text in the sign-in dialog.
🔨 Full-Spectrum Review Summary
Effort: high
Review time: 2m 23s
Token count: Unavailable
| Pass | 🔴 Critical | 🟠 High | 🟡 Medium | ⚪ Low |
|---|---|---|---|---|
| 🔒 Security | 0 | 0 | 0 | 0 |
| ✅ Accuracy | 0 | 0 | 0 | 0 |
| 🧰 Quality & Maintainability | 0 | 0 | 0 | 2 |
| Total | 0 | 0 | 0 | 2 |
Key Findings
- ⚪ LOW — Quality & Maintainability: Failed Codex sign-in dialog now shows the same sentence twice.
crates/codexbar-providers/src/codex_app_server.rs:267: Observed:codex_sign_in.rs:214renders theStage::Failedstatus as "The sign-in didn't complete." and putserr.to_string()in thesign-in-erroralert. With the new fixed message, that alert always reads "Codex: The sign-in didn't complete." Trigger: any failed browser sign-in reported by Codex (success: false). Impact: the alert repeats the status line and carries no distinguishing diagnostic. Before, only the no-reason fallback did this. Issue #329's goal of 'keeping useful fixed diagnostics' is only partly met. This is inferred from the source; the dialog was not rendered. (non-blocking) - ⚪ LOW — Quality & Maintainability: UI test still asserts a Codex-supplied sign-in reason that production can no longer produce.
crates/codexbar-providers/src/codex_app_server.rs:267: Observed: after this change,SignIn::finishalways returnsRefused("The sign-in didn't complete.")for a failed login. The unchanged testa_failed_codex_sign_in_says_why_and_changes_nothingincrates/codexbar-app/src/ui_tests.rs(around line 4582) still has its fake service returnRefused("Login was cancelled in the browser")and asserts the dialog showsCodex: Login was cancelled in the browser. Trigger: the test passes because it goes through the fakePendingSignIn, not the real adapter. Impact: the UI suite now documents and protects a CLI-reason display that the security fix intentionally removed. A later reader could take that as the expected behavior, and the test does not cover the message users will actually see. (non-blocking)
Coverage
- Files reviewed:
crates/codexbar-providers/src/codex_app_server.rscrates/codexbar-providers/tests/codex_error_privacy.rs
- Context read:
crates/codexbar-providers/src/codex.rscrates/codexbar-providers/src/lib.rscrates/codexbar-providers/src/error.rscrates/codexbar-providers/Cargo.tomlCargo.tomlcrates/codexbar-app/src/codex_sign_in.rscrates/codexbar-app/src/ui_tests.rsAGENTS.mdissue #329PR #330 description
- Verified:
- Compare
base_commit.sha=66764b6f65964d1422e63aa5c575333b5bafb0e0and last commit =7126f17f096cd37ed491a75e991cbaaee36570a8; merge base equals base, ahead_by 1, behind_by 0 - Full diff covers two files: +11/-31 in
codex_app_server.rs, and the newcodex_error_privacy.rs(+61) AppServer::requestmaps anyerrormember torefused(), a fixed string; no CLI text reachesRefusedon that pathSignIn::finishreturns a fixedRefusedmessage wheneversuccessis not true;params.erroris never read- The rest of the head module stores no CLI-provided text in
AppServerError;MAX_ERRORand the oldrefused(Option<&Value>)have no leftover references - The integration test uses only public API:
codex_app_serverispub mod, andAppServer::over,Transport,begin_sign_inandfinisharepub - The new integration test is auto-discovered: the
[[test]] command_runnerentry does not setautotests = false, andserde_jsonis a normal dependency - Production callers:
CodexProvider::renewuses onlyis_ok(); the sign-in and sign-out UI showerr.to_string(), which now contains only fixed text FakeRenewerincodex.rsstill buildsRefused("refresh token expired")locally; it is test-only and no production code matches on that text- Updated unit tests in the module are consistent with the new fixed messages
- Workspace lints are only
clippy::allwarn andunsafe_op_in_unsafe_fndeny; nothing in the diff obviously trips them
- Compare
- Not verified:
- Runtime and test results; the PR's claims of passing cargo test, fmt and clippy were not checked because execution is forbidden
- Rendered dialog appearance; the duplicated-text finding comes from reading source only
- Whether real Codex CLI error payloads contain credentials; that premise comes from issue #329 and was not reproduced
- Hosted CI check status on the head SHA was not queried
- Tests run: None. Reviewer execution is disabled.
HemSoft full-spectrum review • 3 evidence-based passes • Reviewed head 7126f17f096cd37ed491a75e991cbaaee36570a8 • SFL v0
|
Metrics failure diagnosed from the retained CI artifact: production line coverage moved from 21181/23961 to 21172/23951 after deleting covered sanitization code. No CRAP regression or unrelated coverage loss. Commit b4641be adds a mock-transport malformed login-start response case, rejecting credential-bearing fields without echoing them; production code is unchanged. All gates are re-running. Exact current-head independent review remains required by this assignment. |
|
@sfl review |
There was a problem hiding this comment.
✅ Verdict: PASS • Round 2
Confidence: 9/10 · Project risk: 4/10 (codexbar)
Since round 1
New: 0; still open (repeated): 0; resolved: 2.
Resolved means no matching finding in this review, not independent proof of a fix.
New (0)
- None.
Still open (repeated) (0)
- None.
Resolved (2)
- LOW UI test still asserts a Codex-supplied sign-in reason that production can no longer produce at
crates/codexbar-providers/src/codex_app_server.rs:267 - LOW Failed Codex sign-in dialog now shows the same sentence twice at
crates/codexbar-providers/src/codex_app_server.rs:267
Review done by claude-opus-5-5 (adversarial to codex)
The PR stops copying Codex app-server request-error and failed-login text into AppServerError::Refused and uses fixed local messages instead. It also adds integration tests with synthetic credentials covering request errors, failed logins and malformed login-start responses. Every remaining Refused construction in the module uses a local literal, and the UI callers show only Display output, so no evidenced Critical, High or Medium defect remains.
🔨 Full-Spectrum Review Summary
Effort: high
Review time: 1m 10s
Token count: Unavailable
| Pass | 🔴 Critical | 🟠 High | 🟡 Medium | ⚪ Low |
|---|---|---|---|---|
| 🔒 Security | 0 | 0 | 0 | 0 |
| ✅ Accuracy | 0 | 0 | 0 | 0 |
| 🧰 Quality & Maintainability | 0 | 0 | 0 | 0 |
| Total | 0 | 0 | 0 | 0 |
Key Findings
No material defects found.
Coverage
- Files reviewed:
crates/codexbar-providers/src/codex_app_server.rscrates/codexbar-providers/tests/codex_error_privacy.rs
- Context read:
crates/codexbar-providers/src/lib.rscrates/codexbar-providers/src/codex.rscrates/codexbar-providers/Cargo.tomlcrates/codexbar-app/src/codex_sign_in.rscrates/codexbar-providers/tests/claude_quota_reset.rsAGENTS.md
- Verified:
- Compare
base_commit.shais66764b6f65964d1422e63aa5c575333b5bafb0e0, the last commit isb4641be8189acbfef409342a3e305fa7783ef2a7, and the head is 2 commits ahead and 0 behind - PR base and head SHAs from the pulls API match the reserved SHAs
requestmaps anyerrormember torefused()without reading the error payload (codex_app_server.rs:159)SignIn::finishfailure uses only the fixed message 'The sign-in didn't complete.' (codex_app_server.rs:267)- No remaining reference to
MAX_ERRORor the oldrefused(Option<&Value>)signature at head - Every
AppServerError::Refusedconstruction in the module uses a string literal (lines 120, 267, 276) begin_sign_inreturnsFailedwithout copying the result payload whenauthUrlis missing, matching the new malformed-response test- The integration test uses only public items (
pub mod codex_app_server,pub fn over,pub trait Transport) and needs no extra feature - Test trait bounds hold:
unwrap_erronfinishandrenewhasT=(), andlet-elseavoids needingDebugonSignIn codex_sign_in.rsshows errors viaerr.to_string()(lines 292, 314, 366), so the UI receives only local textCodexProvider::renewdiscards the renewal error viais_ok(), so it has no dependence on the removed Codex text- The new test file follows the AGENTS.md placement rule for cross-module provider tests and uses snake_case behavior names
- Compare
- Not verified:
- Runtime behavior and the CI or metrics gate results the PR describes; execution is forbidden
- Whether other logging paths outside the files read record raw app-server messages; a code search covered only the default branch index, not the exact head
- Whether users lose useful diagnostics now that Codex's own error text is dropped; that is a product judgment, not a checked defect
- Tests run: None. Reviewer execution is disabled.
HemSoft full-spectrum review • 3 evidence-based passes • Reviewed head b4641be8189acbfef409342a3e305fa7783ef2a7 • SFL v0
Closes #329.
Codex app-server request errors and failed login notifications previously copied arbitrary CLI error text into Display and Debug diagnostics. A short token or authorization code survived the 200-character cap. Both mock-transport regression tests failed on main
66764b6f65964d1422e63aa5c575333b5bafb0e0.Discard that text at the adapter boundary. Request refusals use a fixed local message; failed logins use the existing local sign-in failure message. CLI stdout/stderr, credentials, account state and authentication protocols are unchanged. No layout or interaction files change.
Validation
cargo test -p codexbar-providers --locked: passed, 364 unit tests and all integration/command-fixture tests; 5 pre-existing installed-provider tests ignored.cargo fmt --all --check: passed.cargo clippy --workspace --all-targets --locked -- -D warnings: passed on Laptop.cargo check -p codexbar-app --bin codexbar --locked: passed on Laptop without test-support.cargo test --workspace --locked: passed on Laptop headlessly, including the new mock-transport regressions.b4641be8189acbfef409342a3e305fa7783ef2a7, reviewed by Claude Opus 5.5 with no findings; authenticated unedited review and zero unresolved threads.b4641be; all four local Rust gates pass onb4641be8189acbfef409342a3e305fa7783ef2a7. All seven required hosted checks pass on that head, including metrics and mutation qualification. Package was not triggered by these paths. Guarded squash merge delivered899bf3fe7c589ce45ca7ca96c9684d43e1f956d1.Only invented synthetic data and mock responses were used. No real auth/config/vault files, provider calls, installed CLI sign-in or historical exposure reproduction. This source-security fix makes no rendered UI qualification claim. No application deployment or launch.