Repository navigation
refactor(auth): reuse failure state reset - #135699
vincentkoc wants to merge 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. Reviewed September 3, 2026, 2:12 AM ET / 06:12 UTC. ClawSweeper reviewWhat this changesThe PR deletes a duplicate manual cooldown-reset helper and uses the shared auth-profile failure-state reset routine instead. Merge readiness⛔ Blocked before merge - 2 items remain The introduced call is source-equivalent to the removed helper and correctly consolidates reset behavior, but this auth-profile path has an explicit security code-owner requirement; keep the PR open for that owner review. Priority: P3 Review scores
Verification
How this fits togetherAuth-profile usage state records cooldown and failure data in the profile store. Manual cooldown clearing resets that state, which subsequent provider and model selection reads. flowchart LR
A[Manual cooldown clear] --> B[Locked auth-profile update]
B --> C[Shared failure-state reset]
C --> D[Persisted usage state]
D --> E[Provider and model selection]
Decision needed
Why: Repository policy requires listed-owner involvement for paths with explicit restricted/security ownership, even though the source change is behavior-neutral. Before merge
Agent review detailsSecurityNone. PR surfaceSource -20. Total -20 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain one canonical failure-state reset implementation and merge after the listed security code owner confirms the behavior-preserving refactor. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is a behavior-preserving refactor, and direct source comparison establishes the relevant equivalence without a user-facing failure scenario. Is this the best way to solve the issue? Yes. Reusing the existing owner for failure-state reset removes duplicate policy while preserving the manual clear operation’s guarded locked-update behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2dfb4417c2a8. LabelsLabel 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
History |
7f45f71 to
bd91811
Compare
|
@openclaw/openclaw-secops please provide a non-author approval for exact head Exact-head |
|
Closing as superseded by #140049, landed in signed squash commit 873f424. The replacement contains this PR’s complete intended change: manual cooldown clearing now uses Current |
What Problem This Solves
Maintainer-requested duplication cleanup: manual auth-profile failure clearing carried a private copy of the canonical failure-state reset. Keeping both implementations made future reset-field changes vulnerable to drift.
Why This Change Was Made
src/agents/auth-profiles/usage-state.tsremains the existing owner of reusable auth-profile failure-state normalization. The manual clear path now callsresetAuthProfileFailureState(existing ?? {}), and the duplicateresetUsageStatspath is deleted.The canonical helper was not widened or otherwise changed. Overrides, reset fields, preserved usage history, undefined-stat behavior, locking, owner persistence, profile replacement, successful-use reset, rotation, and provider bypass semantics remain unchanged. There are no configuration, schema, SDK, dependency, transaction, locking, persistence, or recovery changes.
User Impact
No user-visible behavior changes. Auth-profile cooldown clearing continues to reset the same failure fields while preserving unrelated usage history.
Evidence
+4/-24(net-20); tests+0/-0.5dcb228b7f9d40cdb38c4aaff1560fb735ca67ac.src/agents/auth-profiles/usage.test.tssrc/agents/auth-profiles/usage.inherited-owner.test.tssrc/agents/auth-profiles/upsert-with-lock.sqlite.test.tssrc/agents/auth-profiles/profiles.test.tssrc/agents/auth-profiles/order.test.tsnode scripts/check-changed.mjs --dry-run -- src/agents/auth-profiles/usage.tspassed classification.node scripts/check-changed.mjs -- src/agents/auth-profiles/usage.tspassed conflict, ratchet, attribution, registry, wildcard export, duplicate coverage, dependency pin, formatting, plugin boundary, wrapper shadowing, package patch, and core graph-boundary checks. It then stopped in core typechecking because the linked shared install lacksmarkdown-it-cjk-friendly,mdast-util-from-markdown,mdast-util-gfm-table,micromark-extension-gfm-table, andlibphonenumber-js/min.pnpm check:test-typesreached the same missing-dependency blocker after the task-local sparse profile was expanded for its tracked UI config inputs.pnpm check:import-cyclespassed with zero runtime value cycles.pnpm check:madge-import-cyclespassed with zero cycles.git diff --checkpassed.pnpm buildwas not run against an incomplete dependency tree. Available idle ordinary checkouts had different lockfiles, so dependencies were not installed, reconciled, or borrowed in the worktree.Overlap heads were rechecked immediately before push and remained open and unchanged:
ece4917e7b8e5e15b0724757a1efd3d930ce12ef538f2ae85d3439091fba430c50fb20dabbd7a2505fe0eb140a7e63d8c9abe4cd4760dc13ea8433d58637dad9e5282b188f6cfd666ae696431d73ee5cThe acting executor directly inspected the required Codex source at
../codex/codex-rs/cli/src/main.rs:220-245and../codex/codex-rs/cli/src/main.rs:2840-2870. Those sections cover unrelated CLI subcommand, prompt normalization, completion generation, and test-import behavior; this refactor does not affect Codex protocol or runtime contracts.