Repository navigation
fix(tui): reload auth store ownership after login - #130349
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 6:16 PM ET / 22:16 UTC. ClawSweeper reviewWhat this changesThe PR reloads shared auth-store ownership and clears prepared auth snapshots after a successful non-Codex local TUI login so the next inference uses the new credential. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessThe branch appears to repair the current-main stale ownership cache for a retained local TUI and its focused PTY test reaches the next provider request. It remains open for maintainer handling because it is member-authored/protected and the Codex-specific exemption could not be checked in the required sibling source checkout. Priority: P1 Review scores
Verification
How this fits togetherThe local TUI runs provider login in a child process, while the parent process retains prepared model runtimes and auth snapshots. The change refreshes that parent-owned state before the next model request. flowchart LR
A[Local TUI auth command] --> B[Provider login child]
B --> C[Shared auth store]
C --> D[Ownership reload]
D --> E[Runtime snapshot reset]
E --> F[Prepared model runtime]
F --> G[Next provider request]
Decision needed
Why: The introduced conditional preserves a distinct external auth-store owner; direct inspection is required by the applicable repository policy, but the sibling checkout is unavailable here. Before merge
Agent review detailsSecurityNone. PR surfaceSource +20, Tests +31. Total +51 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the explicit non-Codex login lifecycle boundary, absorb the reload into the canonical ownership resolver to avoid duplicate parsing logic, and confirm that Codex login never writes OpenClaw’s shared auth store. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main pins shared-store ownership in a process cache while the auth child persists out of process, and the introduced PTY scenario asserts the next same-process request uses the new credential. Is this the best way to solve the issue? Unclear: refreshing the explicit external mutation boundary is the correct owner layer, but the preserved Codex exemption requires direct dependency-contract confirmation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f12dab5833ae. LabelsLabel 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 (4 earlier review cycles)
|
|
Addressed the current P1 on exact head After a successful OpenClaw auth child exits, the retained TUI now reloads shared-store ownership and clears the published runtime-auth snapshots through the existing mutation boundary. Prepared model-runtime owners observe that invalidation and rebuild from the newly persisted credential before the next inference. Codex-owned login remains outside this shared-store path. The retained-TUI regression now authenticates the actual Proof:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞👀 Pull request received. I will update this pull request when review starts. |
2e427f7 to
61df1eb
Compare
* fix(tui): reload auth store ownership after login * fix(tui): refresh auth runtime after login
Summary
Local TUI
/authnow reloads shared auth-store ownership after a successful out-of-process login. The login child can relocate the shared auth store intostate/openclaw.sqlite, while the already-running TUI remained pinned to its pre-login legacy owner and could not see the new credential until restart.This keeps ownership process-stable during normal runtime and reloads it only at the explicit auth lifecycle boundary. No schema, migration, config, fallback, or compatibility path changes. The PTY assertion now reads the effective runtime store rather than the retired agent-local persistence row.
Evidence
src/tui/tui-pty-local.e2e.test.ts:1592; the auth child exited 0, the sharedauth_profile_storesrow contained the credential, and the caller still resolved the empty legacy agent row.pnpm test src/agents/auth-profiles/path-resolve.shared-store.test.ts src/tui/tui-command-handlers.test.ts: 225 passed.pnpm check:changed: passed.pnpm build: passed.Production LOC: +18/-1 (net +17) for the explicit cross-process ownership reload boundary. Tests: +26/-2.
AI-assisted: yes.