Repository navigation
fix(auth): reset only the profile replaced by a successful login - #124014
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: passed. Reviewed August 27, 2026, 12:34 AM ET / 04:34 UTC. ClawSweeper reviewWhat this changesThe PR postpones auth-profile mutation until login succeeds, then replaces each returned profile and clears failure state only for that profile. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open for listed auth-owner review: this member-authored, maintainer-labeled PR changes durable profile recovery semantics and remains a viable focused fix; no blocking source-level defect was found at the PR head. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe models-auth command invokes a provider-owned login flow, writes returned credentials and profile usage state into the agent SQLite store, then refreshes gateway auth selection. This change narrows successful-login recovery so unrelated provider profiles retain their cooldown and disabled state. flowchart LR
A[Operator starts provider login] --> B[Models auth command]
B --> C[Provider login flow]
C --> D{Login succeeds?}
D -- No --> E[Leave stored profiles unchanged]
D -- Yes --> F[Locked SQLite profile update]
F --> G[Preserve sibling state and order]
G --> H[Refresh gateway auth state]
Decision needed
Why: This is an intentional compatibility choice for persisted auth routing state, not a mechanical correctness question. Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests -1. Total -1 across 6 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep failed and ordinary successful logins scoped to returned profiles, with explicit provider-wide removal remaining the opt-in recovery path once the listed auth owner confirms it. Do we have a high-confidence way to reproduce the issue? Yes, source and focused regression coverage provide a high-confidence path: make provider login fail or cancel and verify no profile write occurs, then successfully replace one blocked profile and verify sibling state remains intact. Is this the best way to solve the issue? Yes, subject to the explicit recovery-semantics decision: moving the reset into the locked successful credential-replacement boundary is narrower and safer than clearing provider-wide state before provider login. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 71d4a8c3e305. 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 (37 earlier review cycles; latest 8 shown)
|
5aa560c to
691ecf2
Compare
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
691ecf2 to
9420fea
Compare
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞✅ Source: Why human review is needed: What the maintainer can do as a next step: I added |
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞✅ Source: Why human review is needed: What the maintainer can do as a next step: I added |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞✅ Source: Why human review is needed: What the maintainer can do as a next step: I added |
Co-authored-by: Jesse Merhi <[email protected]>
Co-authored-by: Jesse Merhi <[email protected]>
|
🦞✅ Source: Why human review is needed: What the maintainer can do as a next step: I added |
Related: #70903
What Problem This Solves
Fixes an issue where users attempting provider login could have every disabled or cooling-down profile for that provider cleared before the provider returned a successful result. A failed or cancelled login therefore changed durable routing state even though no credential was replaced.
Why This Change Was Made
Provider login now leaves auth state untouched until the provider succeeds. The successful persistence boundary replaces the exact returned profile and clears only that profile's existing failure windows in the same locked SQLite transaction. Explicit
--forceprovider removal is unchanged.This PR intentionally does not add request-generation fencing, multi-agent owner redirection, new Plugin SDK surface, or bundled-provider writer migrations. Those are separate invariants and need separate review.
User Impact
Failed or cancelled login attempts no longer silently re-enable unrelated profiles. A successful login immediately makes only the replaced profile usable while preserving sibling credentials, order, last-good selection, and unrelated usage history.
Evidence
Pre-fix focused command coverage failed because login loaded and cleared provider-wide state before calling the provider and persisted success through the generic writer.
Exact replacement proof:
The SQLite regression proves credential replacement and exact-profile failure reset commit together, sibling profile/state/order remain unchanged, and an injected state-write failure rolls the credential and state back together.
Additional checks:
Production delta: net 0 lines. Test delta: net -1 line.