Repository navigation
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. |
|
Codex review: blocked before merge. What this changesAllows reset of canonical Main when restart recovery both archived and tombstoned it. Example: An operator resets agent:main:main with archiveReason restart-recovery and a recovery tombstone.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it addresses a current recovery failure with a focused patch, but extending the deliberate archived-session reset restriction still needs an owner decision. Priority: P1 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherGateway session-reset requests enter the existing lifecycle owner, which checks authorization and session state before cleaning up runtimes and committing a transcript reset boundary. flowchart TD
A[Operator reset request] --> B[Gateway authorization]
B --> C[Session reset owner]
C --> D[Recovery and archive eligibility]
D --> E[Runtime cleanup]
E --> F[SQLite reset boundary]
F --> G[Fresh authenticated turn]
Technical reviewBest possible solution: Approve the narrow existing-reset exception, preserving ordinary archive restrictions, transcript history, and fresh authorization. Do we have a high-confidence way to reproduce the issue? Current-main eligibility deterministically rejects an archived recovery tombstone; the linked incident and supplied before/after handler evidence corroborate that path, without a new run during this review. Is this the best way to solve the issue? The patch is the smallest complete reset remedy: it changes eligibility in the existing lifecycle owner and reuses canonical Main resolution, while leaving broader recovery presentation and successor behavior separate. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3840d14ad2a3. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +10, Tests +125. Total +135 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)Reviewed October 18, 2026, 8:25 PM ET / October 19, 2026, 00:25 UTC (Revision 4). |
|
@clawsweeper re-review Added real isolated Gateway proof on unchanged head |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Addressed the new inspectability request: the body now embeds the captured synthetic run’s terminal output and selected actual authenticated RPC response fields for before/after reset, retained-history reopening, read-tool result, and completed assistant final. These are existing run captures on unchanged @steipete — the remaining product choice is whether canonical Main with a restart-recovery archive and tombstone should use the existing reset operation in place. Manual archives, non-Main archives and other refusals remain covered. Please review that narrow exception; no owner approval is assumed. |
|
🦞👀 Re-review progress:
|
|
Response to the behavior decision in the current review. The body now answers the archived-Main reset question against #130196: keep the tombstone fence for ordinary work, while allowing the existing authorized reset owner its narrowly guarded Main exception. It acknowledges that archived-row refusal was deliberate and does not argue for general archive reopening. |
|
@clawsweeper re-review Conflicts are resolved at |
|
🦞👀 Re-review progress:
|
* fix(sessions): reset Main archived by restart recovery Preserve the narrow reset policy and regression coverage from #176086 on current main. Extend the existing Gateway recovery boundary proof through recovery archival, explicit reset, and a fresh authenticated turn. Co-authored-by: Paul Bohm <[email protected]> * test(sessions): seed internal restart recovery metadata Use the internal persisted entry contract for the Gateway recovery fixture. Co-authored-by: Paul Bohm <[email protected]> --------- Co-authored-by: Paul Bohm <[email protected]>
|
Thank you @enki — this landed as #176675 (squash e522989), a maintainer rewrite of your change onto current main after the session-controller cutover, with you as co-author on the commit. It keeps your fix as written: an authorized reset can recover the canonical Main session after restart recovery archived it. Closing this one as landed via #176675. |
* fix(sessions): reset Main archived by restart recovery Preserve the narrow reset policy and regression coverage from openclaw#176086 on current main. Extend the existing Gateway recovery boundary proof through recovery archival, explicit reset, and a fresh authenticated turn. Co-authored-by: Paul Bohm <[email protected]> * test(sessions): seed internal restart recovery metadata Use the internal persisted entry contract for the Gateway recovery fixture. Co-authored-by: Paul Bohm <[email protected]> --------- Co-authored-by: Paul Bohm <[email protected]>
* fix(sessions): reset Main archived by restart recovery Preserve the narrow reset policy and regression coverage from #176086 on current main. Extend the existing Gateway recovery boundary proof through recovery archival, explicit reset, and a fresh authenticated turn. Co-authored-by: Paul Bohm <[email protected]> * test(sessions): seed internal restart recovery metadata Use the internal persisted entry contract for the Gateway recovery fixture. Co-authored-by: Paul Bohm <[email protected]> --------- Co-authored-by: Paul Bohm <[email protected]> (cherry picked from commit e522989) Co-authored-by: RomneyDa <[email protected]>
* fix(sessions): reset Main archived by restart recovery Preserve the narrow reset policy and regression coverage from #176086 on current main. Extend the existing Gateway recovery boundary proof through recovery archival, explicit reset, and a fresh authenticated turn. Co-authored-by: Paul Bohm <[email protected]> * test(sessions): seed internal restart recovery metadata Use the internal persisted entry contract for the Gateway recovery fixture. Co-authored-by: Paul Bohm <[email protected]> --------- Co-authored-by: Paul Bohm <[email protected]> (cherry picked from commit e522989) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 4d61fc8) Release adaptation: applied the 2026.10.7 adaptation; kept 2026.10.10's embeddedRunMock test import that the 10.7 hunk dropped.
What Problem This Solves
Fixes an explicit reset being refused when restart recovery has archived and tombstoned the agent’s canonical Main session, leaving its default chat route unusable.
User Impact
An authorized operator can reset the affected Main session through the existing API. Reset retains its physical session identity and transcript and starts a fresh model context; it does not resume or replay the interrupted task. No configuration change or migration is required.
Why This Change Was Made
The reset-only exception requires both a restart-recovery tombstone and a restart-recovery archive reason on the configured canonical Main key. Ordinary archives and archived non-Main sessions retain their existing refusal behavior. Provider-review, model-selection, expected-session identity, plugin ownership, and runtime cleanup guards remain in their existing owners.
Related: #173412, #137264. This complements #173579’s in-place recovery for unarchived sessions; it does not change its UI or continuation contract. #130196’s shared work-start tombstone fence remains intact.
Behavior decision
The review asks whether authorized reset may restore canonical Main archived and tombstoned by restart recovery. I recommend the narrow exception because Main is a stable ingress target: requiring replacement-session routing leaves callers unable to use their established conversation even when they invoke the prescribed reset remedy.
The security invariant in #130196 is that ordinary work cannot cross a tombstone fence; an already-authorized reset owns that transition. The eligibility change stays inside that owner and requires canonical Main, a recovery tombstone, and restart-recovery archival. Ownership, model-lock, stale-session, manual-archive and non-Main restrictions remain. Reset starts fresh context and does not replay the interrupted request; physical identity and retained history stay available.
The original PR explicitly retained archived-row refusal, so this is a deliberate policy extension. The owner choice is whether recovery-created archival should prevent an otherwise-authorized operator from using the existing reset. The exact-head Gateway/reset/fresh-turn proof supports the narrow exception without arguing for general reopening of archived sessions.
Current upstream conflict repair
Refreshed head
794f1dc77381dd1c3bb3306fd22faf7610f69200is a true merge of the prior PR head and pinned upstream00575becc9fce53efc73b319a16fa71e6f4123b9. The narrow canonical-Main reset condition is unchanged. The test conflict retains upstream's controller admission coverage and the PR's transcript-history checks, while removing the retired embedded-run mock import.Fresh checks on the merged source pass: the complete reset-cleanup owner suite (21 tests; 93.18 seconds wrapper wall time), production core types, owner Gateway-server test types, scoped typed lint, formatting, whitespace, and independent P0–P2 review. The reviewer found no actionable issue in the two-file PR diff; unprovided surrounding upstream modules were outside its independent coverage. The merge preserves both parent histories and adds no schema or permission change beyond the existing proposed reset exception.
New-head CI is pending. Earlier full Gateway/reset/fresh-turn captures retain their original source qualifications; they are not presented as a new runtime capture on this merged head. The behavior decision above remains unresolved.
Evidence
The existing Gateway reset-cleanup handler fixture reproduces the defect: default and custom-key Main reset cases fail before the repair while three archive-policy controls pass. Afterward, all 23 owning cases pass, including the new model-lock and stale-identity controls. The successful cases read the persisted transcript before and after reset, retaining its prior events and physical session ID while adding the reset boundary and clearing recovery/archive metadata.
Strict targeted production/test types, type-aware scoped lint, formatting, and fresh independent review through P2 pass. All fixtures are synthetic. The final full owning run took 103.50s Vitest / 111.74s wrapper, including 52.49s cold artifact preparation; it extends the existing Gateway cleanup owner rather than introducing another fixture or suite. Exact-head broad PR CI now passes (CI gate); hosted per-file timing has not been extracted. No operator Gateway or live session was changed for this proof.
Real Gateway reset and usable-turn proof
On exact head
f1c01bab5aee, an isolated real Gateway accepted an authenticatedsessions.resetfor synthetic canonical Main with both restart-recovery archive metadata and a tombstone. The physical session ID stayed the same, archive/tombstone state cleared, and the original synthetic message remained exactly retrievable through the canonical historymessageIdreopen. The default history tail correctly showed the new Reset context boundary.A fresh authenticated turn then traversed the production embedded runtime, real HTTP/OpenAI SDK, and actual read-tool filesystem I/O. The second provider request contained the synthetic file receipt; the correlated assistant final confirmed completion. Provider response frames were scripted on loopback; no external provider or operator state was used. The task Gateway/provider stopped and fixture state was removed. Existing 23-case owner coverage separately proves archive/model-lock/stale-identity refusals. This does not resolve the maintainer policy decision.
Captured output from the synthetic Gateway run
The following is the test process’s captured terminal result, formatted as JSON. It ran the exact PR head; all inputs and identifiers belong to the disposable fixture.
{ "syntheticOnly": true, "head": "f1c01bab5aee2355881c3c33386d5b3a3ae9d63f", "transport": "Real Gateway + authenticated WebSocket RPC + loopback HTTP/OpenAI SDK; provider wire responses scripted; real read-tool filesystem I/O", "externalProviderContacted": false, "offlineFixtureSeeded": true, "gatewayReady": true, "authenticatedOwner": true, "preconditionArchivedTombstonedMain": true, "realGatewayResetSucceeded": true, "physicalIdentityRetained": true, "exactPriorMessageRetainedViaHistoryReopen": true, "newContextResetBoundaryVisible": true, "archiveAndTombstoneCleared": true, "actualProviderReadToolOffered": true, "actualReadReceiptReachedNextProviderRequest": true, "freshAuthenticatedTurnProviderFinal": true, "passed": true, "gatewayStopped": true, "providerStopped": true, "fixtureRemoved": true, "providerRequests": 2 }Selected fields from its saved authenticated RPC responses follow. Unrelated response fields are omitted; values shown here are copied from the captures. The retained message is byte-for-byte equal to the pre-reset message, including its stored metadata (the harness checks the complete object).
{ "sessions.describe before reset": { "key": "agent:main:main", "sessionId": "fc41aae2-e1bd-4b16-9d20-b095b9fee734", "archived": true, "restartRecoveryStatus": "tombstoned", "status": "failed" }, "sessions.describe after reset": { "key": "agent:main:main", "sessionId": "fc41aae2-e1bd-4b16-9d20-b095b9fee734", "archived": false }, "chat.history reopened retained message": { "role": "user", "content": "SYNTHETIC_RETAINED_HISTORY_3351" }, "chat.history fresh tool result and final": [ { "role": "toolResult", "content": [ { "type": "text", "text": "SYNTHETIC_READ_RECEIPT_7264" } ] }, { "role": "assistant", "content": [ { "type": "text", "text": "SYNTHETIC_MAIN_RESET_USABLE_8429" } ], "stopReason": "stop" } ] }