Repository navigation
fix(auth): keep healthy profiles after compaction - #155204
roboclaw-bot merged 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
✅ Maintainer security changes approvedA maintainer approved this revision with an explicit security approval comment.
A later push requires a fresh approval comment for an external contributor's PR. |
|
Codex review: blocked before merge. Reviewed September 22, 2026, 1:31 AM ET / 05:31 UTC (Revision 9). ClawSweeper reviewWhat this changesThe PR keeps healthy automatically selected credentials across conversation compaction, avoids unnecessary session writes, and updates failover documentation and regression coverage. Merge readiness⛔ Blocked before merge - 3 items remain The change remains useful and has convincing runtime proof, with no actionable code defect found. The outstanding concern is acceptance of its broader change to the shipped credential-selection policy. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw selects provider credentials from configured profile order, credential health, and saved session preferences before sending model requests. This change removes conversation compaction from that selection decision while retaining failure-driven fallback. flowchart TD
A[Conversation turn] --> B[Session credential selector]
C[Configured profiles and health] --> B
D[Saved session preference] --> B
E[Compaction completes] --> D
B --> F{Current credential eligible?}
F -->|Yes| G[Keep credential]
F -->|No| H[Select eligible fallback]
Decision needed
Why: The implementation and runtime proof support this behavior, but the released documentation promises compaction rotation and the reported acceptance is not attributable to a maintainer in the available record. Before merge
Agent review detailsSecurityNone. PR surfaceSource -5, Tests +39, Docs +2. Total +36 across 6 files. View PR surface stats
Review metrics
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:
Technical reviewBest possible solution: Keep compaction independent of credential health in the existing selector, with an attributable maintainer decision accepting the changed default for existing profile pools. Do we have a high-confidence way to reproduce the issue? Yes: two healthy automatic profiles and an advanced compaction counter reach the rotation branch on fetched main. Contributor baseline receipts demonstrate the same path; this read-only review did not execute it. Is this the best way to solve the issue? Yes technically: removing the lifecycle trigger from the existing selector is focused and preserves failure recovery; accepting the broader default change remains a product decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 35b95b2aa64f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
|
@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:
|
|
Maintainer action requested for current head
Exact-head behavior proof in the PR body covers explicit primary retention, release-style persisted fallback continuation across Gateway restart and compaction, real A/429 → B/200 failover, and next-turn B persistence. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Current head ClawSweeper remains platinum with sufficient exact-head proof and ready for maintainer look. The fresh CI matrix is running without test failures so far. Maintainer approval is required for this current security-sensitive revision: The explicit |
31e1c16 to
db31514
Compare
|
@clawsweeper re-review |
1 similar comment
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Re-review progress:
|
db31514 to
1e626ca
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Current head Maintainer action needed once CI settles: approve this exact security-sensitive revision with: |
1e626ca to
d22ff0a
Compare
|
@clawsweeper re-review |
|
Current head Maintainer action needed once CI settles: |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
At Josh's explicit request, recording his approval of both the design direction and the security-sensitive changes in revision d22ff0a. This approval covers removing compaction-triggered auth-profile rotation for both explicit orders and implicit pools, including retaining healthy persisted fallback selections, while preserving failure-driven failover and preferred-profile recovery. Posting the required security approval command separately for the automated gate. |
|
/allow-security-sensitive-change |
|
Merged via squash.
|
* commit '739e2410702e0b1ad1d17a6dac07ddc0ab6dbebb': (140 commits) fix(ui): pause passive polling in hidden tabs (#155617) improve(android): keep chat photos outside text bubbles (#155338) fix(ui): preserve saved project after discovery failure (#155619) feat: compare Kitchen Sink Gateway resource costs (#155734) test(gateway): arm clock-jump claim after readiness (#155748) chore(ui): refresh control ui locales (#155700) fix(ci): join archive placement fixtures before teardown (#155751) fix(matrix): keep bot discovery off the Gateway thread (#152122) fix(agents): reconcile late requester recovery receipts (#155357) test(gateway): guard embeddings HTTP fixture lifetimes fix: isolate triage fixture acquisition and cleanup (#155736) refactor(sessions): hydrate saved transcripts off thread (#153325) fix: Claude MCP turns abort before tool timeout (#155663) fix(goals): pause terminal failures and clarify goal states (#155694) fix(test): preserve watcher errors when diagnostic capture fails (#155383) ci: move native runtime proofs to release validation (#155606) fix(auth): decouple compaction from profile rotation (#155204) fix(agents): admit compaction outside retired plugin generations (#151232) perf(ui): reduce automatic session list refetches (#155705) test: avoid unused source repos in release input fixtures (#155733) ...
Keep healthy automatically selected auth profiles across conversation compaction for both explicit orders and implicit pools. Remove compaction-only auth-state writes while preserving failure-driven failover, preferred-profile recovery, route isolation, and user/person-linked pins. The universal behavior change and security-sensitive revision were explicitly approved by Josh. Exact-head hosted CI and required security gates passed. Co-authored-by: Jason O'Neal <[email protected]> Co-authored-by: jalehman <[email protected]>
Related: #148829
What Problem This Solves
Healthy automatically selected authentication profiles changed after conversation compaction even though no authentication failure occurred.
User Impact
Compaction no longer changes a healthy selected credential for explicit or implicit profile pools. Genuine rate-limit, quota, cooldown, disabled-profile, and missing-profile failures still traverse the eligible backup chain. This adds no configuration option or migration.
Why This Change Was Made
Compaction is a conversation-lifecycle event, not an authentication-health signal. The selector previously treated an advanced compaction counter as a reason to rotate credentials and suppressed preferred-profile recovery at that same boundary.
This patch removes both couplings. It also avoids rewriting auth state merely to advance the historical compaction marker. Real auth transitions still persist the selected profile, source, and current marker. Route isolation, user/person-linked pins, preferred-profile recovery, and failure-driven failover remain unchanged.
Maintainer direction on 2026-09-21 was explicit: compaction and authentication failover are orthogonal; compaction must not change auth profiles, auth failure may, and no opt-in setting or migration should restore the old coupling.
Evidence
pnpm check:changed: passed on the validated patch.qaRuntimebuild and runtime-postbuild stamps both name proof headdb31514a425e5d40ceeb693d74b82b6422269b4bwithinputsClean: true.d22ff0a70edff41d88bd2dc8eff624b8b533db9bis a rebase onto currentmain;git range-diff db31514a425^! d22ff0a70ed^!reports the patch as byte-equivalent.Real Behavior Proof
Proof HEAD:
db31514a425e5d40ceeb693d74b82b6422269b4bCurrent PR HEAD:
d22ff0a70edff41d88bd2dc8eff624b8b533db9b(byte-equivalent rebased patch)Claim: The public Gateway compaction path preserves a healthy automatic credential for both explicit and implicit profile pools, while a real quota response still fails over to the next eligible profile.
Exercised surface: Built OpenClaw Gateway, public
sessions.compactGateway RPC, real SQLite session state, productionupdateSessionEntry, and a localhost OpenAI-compatible Responses endpoint. Nothing intercepted the auth selector or request retry path.Environment: Kali Linux x86_64, Node.js 24.21.0, clean exact-head
qaRuntimebuild, disposable OpenClaw homes, isolated Gateways, two synthetic API-key profiles (A,B), and a localhost Responses receiver. No production state, credentials, or external paid service was used.Scenario:
sessions.compact, and send another foreground turn.updateSessionEntry; restart the Gateway, compact, and continue the session.auth.orderconfigured.19fae01395e5e8609011f08e2f638e96c9372c45.Commands:
Relevant output:
Artifact: Redacted driver and complete baseline/candidate JSON receipts:
https://gist.github.com/jason-allen-oneal/089bb0b9e597e0d4894f0c6547e31f2b
SHA-256:
Observed result: On the unfixed baseline, compaction alone changes healthy A to B in both explicit and implicit pools and moves a persisted fallback B back to A. On proof head
db31514a425e5d40ceeb693d74b82b6422269b4b, all three healthy credentials remain unchanged. A real HTTP 429 still advances A to B, and B serves the following turn. The current PR head carries a byte-equivalent patch after rebasing onto currentmain.Not tested: Live third-party quota exhaustion or billing; the receiver returns a protocol-real local HTTP 429. The textual
/compactcommand parser was not exercised; the publicsessions.compactGateway RPC was. The implicit lane did not separately repeat restart and failure scenarios. Concurrent lifecycle replacement and personal-account materialization are covered by focused tests rather than an injected Gateway race. Windows and macOS were not exercised.Separate Review Blockers
Sources