Repository navigation
fix(tui): local /auth exits 1 with no diagnostics when the session provider is CLI-backed - #125677
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
12972a6 to
6af711b
Compare
|
Codex review: needs changes before merge. Reviewed August 28, 2026, 8:42 AM ET / 12:42 UTC. ClawSweeper reviewWhat this changesThe branch adds bounded local TUI auth diagnostics and redirects CLI-backed providers without an OpenClaw auth method to the interactive provider picker. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open: the current head fixes a real P1 local-auth dead end, but its newly displayed and persisted auth argv can bypass built-in secret masking when custom log patterns are configured. Priority: P1 Review scores
Verification
How this fits togetherThe local TUI delegates flowchart LR
User[Local TUI user] --> Command[/auth command]
Command --> Route[Provider auth routing]
Route --> Child[Foreground auth child]
Child --> Outcome[Exit result]
Outcome --> Transcript[TUI transcript]
Outcome --> Logs[Diagnostic logs]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The new auth-argv diagnostic can expose sensitive text when users configure custom log redaction patterns. PR surfaceSource +49, Tests +114. Total +163 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep one foreground-child diagnostic flow, but route its rendered argv through the merged UI/tool-payload redaction policy and prove custom-pattern configurations preserve built-in token masking. Do we have a high-confidence way to reproduce the issue? Yes for the source path: current main returns only the exit status and rejects the CLI-backed provider before the picker; the supplied PR body also records a red/green real-PTY run, though this read-only review did not execute it. Is this the best way to solve the issue? No: recording the child outcome at the existing owner is the right shape, but the formatter must use the safety-surface redaction contract before exposing argv. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 468054f93c43. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
Acceptance criteria:
What 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 (13 earlier review cycles; latest 8 shown)
|
|
Addressed the review in db8c6bd534: Retry-command quoting (P2, Codex sibling inspection (P1 merge risk) — done before the original push; the citations are in the PR body's "Why This Change Was Made": Production LOC (P1 merge risk) — the net production growth is the new capability itself: a |
|
Follow-up finding addressed in 75cc5aed31: |
|
Percent-expansion finding addressed in cf539bfe22, following the "do not advertise this string as pasteable" option: |
|
The "picker cannot be reached without |
|
Picker-intent finding confirmed and fixed in 92603ae7a4 — good catch, it reproduced live (fake Fix follows the suggested shape: the auth target is now a closed Evidence added to the PR body: live before/after with the shim (before: On the LOC merge-risk item: this round is production +34/−12 by numstat, but the semantic change is net-reducing — the duplicated session-derived delegation branch is gone and picker intent exists in exactly one place; the numstat growth is the discriminated-union type plus formatter reflow of the touched promise signature. |
|
Dual-registration finding addressed in 0ec3ca0d36, following the suggested gate: the picker fallback now requires absent provider auth, not CLI-backend classification alone.
Also noting for the exact-head CI item: the previous head's |
|
Scoped-registry finding addressed in 7c17c859fd, per the suggested repair: the gate now resolves auth availability from the setup provider contract, not the global registry alone.
|
Co-authored-by: Timur Turatbekov <[email protected]>
7c17c85 to
cb1aaf0
Compare
|
Thanks @P5ina! Proof: In an isolated real local TUI session, a deterministic provider-auth child exited with status 1. The old build ended with only
Example
|
Make local TUI auth failures actionable while preserving the foreground child lifecycle, provider picker routing, and built-in token masking under custom redaction patterns. Co-authored-by: Timur Turatbekov <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #125635
What Problem This Solves
Fixes an issue where local TUI users could run
/auth, get onlyauth flow failed (exit 1), and find no usefultui/authrecord.It also fixes a dead end where a session that uses a CLI-only provider could send that provider to an OpenClaw auth wizard that cannot authenticate it.
Why This Change Was Made
The foreground auth-child owner now records one bounded, redacted JSON argument list and the child result. The TUI uses that same result for the visible failure message. This preserves the existing child shutdown owner from #126476.
The provider-auth command now detects a requested CLI-only provider through the existing provider registry. It explains the mismatch and opens the supported provider picker. It does not hardcode a provider.
Explicit OpenAI auth still delegates to
codex login. Session-derived CLI providers no longer enter the Codex path by accident.User Impact
/authaction ends with an actionable bounded result.tui/authspawn and result events.Evidence
Live red and green used the real local TUI in a PTY. Each run used disposable
HOME, OpenClaw state, config, XDG, workspace, binary, and temp directories. A deterministic child failed or succeeded at the real process boundary.640d73ecb1aaf0/auth openaiauth flow failed (exit 1); 0tui/authrecordstui/authrecords["models","auth","login","--provider","claude-cli"]/auth openai["login"]; TUI reports successThe failure child wrote a fake secret-like diagnostic. It did not appear in the repaired visible result or either repaired
tui/authrecord.The security follow-up at
cbdcb64changes only the auth argument redactor and its regression test. Auth arguments now use the existing merged UI-payload policy, so customlogging.redactPatternsadd to built-in token masking instead of replacing it. The new formatter-boundary test failed oncb1aaf0because a token-shaped argument remained visible, then passed oncbdcb64; the operator's custom pattern remained active in the same result.Current
mainwas also checked at5b07247. The affected auth and redaction owner files have no overlapping repair that supersedes this PR.Required Codex Source Check
The reviewer personally inspected the sibling Codex source at commit
a73bf25d17805and mapped it to the retained PTY result:codex-rs/cli/src/main.rs:1515-1555routes a bareloginargument torun_login_with_chatgpt.codex-rs/cli/src/login.rs:116-119writes browser-login guidance to stderr.codex-rs/cli/src/login.rs:170-200exits with status 0 on success or status 1 with an stderr error on failure.["login"].Validation on the exact repaired head:
cb1aaf06f30e631f496f37333caa264b3d3a55ed.cbdcb64ceda68daa6dc9c7b1d4e7613f1ec58573.git diff --checkpassed.Change Size
+80/-31lines, net+49.+143/-6lines, net+137.The production growth adds one bounded diagnostic result at the existing foreground-child owner and one registry-driven picker route. The security follow-up is net-neutral production and reuses the existing merged UI redactor. The repair replaces the contributor branch's parallel lifecycle path and reduces its earlier net production growth by 96 lines. No new config, schema, protocol, fallback stack, or provider-specific policy was added.