Repository navigation
fix: invalid Rewind requests interrupt retained sandbox sessions - #190219
Conversation
Validate history selection before workspace retirement and preserve safe conflict recovery guidance. Prove persisted handoff authority and replay at adoption commit. Co-authored-by: shakkernerd <[email protected]>
Worked on by: - @shakkernerd Co-authored-by: shakkernerd <[email protected]> OpenClaw-Publication: 017d6ff3-1856-4efb-bac0-28427ebfec87
|
🦞👀 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: needs maintainer review before merge. What this changesThis PR validates Rewind and branch selections before retiring retained sandboxes and preserves actionable workspace-conflict errors. Example: A retained sandbox receives sessions.rewind with entryId "missing".
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — suspected predecessor, not a causality claim: source commit Possible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR fixes two concrete current-main defects, and no actionable introduced bug was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGateway history handlers delegate to durable, native, or memory session storage; the shared planner selects history, while the workspace owner settles edits and retires runtimes before a valid cut commits. flowchart TD
A[Rewind or branch switch] --> B[Storage adapter]
B --> C[Shared semantic selection]
C --> D[Reject invalid selection]
C --> E[Settle workspace and retire runtime]
E --> F[Revalidate and commit history cut]
F --> G[Return result and publish change]
Technical reviewBest possible solution: Use the existing planner’s selection logic before retirement in every storage adapter, retain transaction-time validation, and disclose only the fixed conflict-recovery instruction. Do we have a high-confidence way to reproduce the issue? Current-main source exposes both failure paths, and the author reports matching base-red regressions; this read-only review executed no target code. Is this the best way to solve the issue? The patch fixes ordering at the existing storage boundary, shares selection with the final planner, and preserves the established conflict message without introducing another state owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 33e7baf17cb1. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +90, Tests +382, Other +2. Total +474 across 10 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel 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 Reviewed November 1, 2026, 5:16 AM ET / 10:16 UTC. |
|
Merged via squash.
|
…nclaw#190219) * fix: preserve retained sandboxes for invalid history cuts Validate history selection before workspace retirement and preserve safe conflict recovery guidance. Prove persisted handoff authority and replay at adoption commit. Co-authored-by: shakkernerd <[email protected]> * fix: invalid Rewind requests interrupt retained sandbox sessions Worked on by: - @shakkernerd Co-authored-by: shakkernerd <[email protected]> OpenClaw-Publication: 017d6ff3-1856-4efb-bac0-28427ebfec87 --------- Co-authored-by: shakkernerd <[email protected]>
Related: #190181
What Problem This Solves
Fixes: an invalid Rewind or branch-switch selection can retire a usable managed sandbox, and a real workspace conflict hides its recovery instruction behind an ineffective retry message.
User Impact
Invalid selections leave the retained runtime and workspace edits untouched. Workspace conflicts explicitly ask users to resolve the conflict before retrying, without exposing internal paths or error text. No schema, configuration, permission, or migration changes.
Why This Change Was Made
The worker, native, and memory adapters preflight through the planner's shared semantic selection before workspace retirement. The final transaction still validates the selection and ownership; preflight is not a reservation. It creates no transcript plan, UUID, or editor payload. A fixed typed workspace-conflict error carries only safe recovery guidance through the handler.
The handoff proof now follows an actual handler-generated persisted receipt through owner resolution and the workspace writer, including refusal at the adoption COMMIT boundary and replay after reopening SQLite. Existing pending-reset and next-cut recovery remain covered.
Evidence
a3751eaf96: a missing-message Rewind issued runtime removal before rejection; a genuine canonical/private conflict returned the generic retry instead of the resolution instruction.a3751eaf96and the complete candidate: scoped-clean, no actionable findings. The reviewer assessed the diff and complete owning-source context; it did not independently execute tests. Hosted ClawSweeper review also completed at10fe706with no findings or before-merge blockers.10fe706; the native watcher reported GREEN. Changed test-file wall times: 89 s for runtime/rejection coverage and 41 s for persisted handoff coverage, including compiler startup. CI test-time sums: 14.457 s for the 10 runtime/rejection cases and 15.524 s for the 4 persisted-handoff cases. These integration tests traverse real Git and both SQLite owners; selector mocks cannot prove runtime preservation or adoption rollback.pr-simplify: shared the managed-workspace fixture and consolidated foreign-receipt cases around one persisted cut instead of repeating full setup/adoption. Net production growth is 90 lines; 382 net regression-test lines are allocated specifically for these production-boundary regressions, with the shared scalar unchanged.Known proof limitation: live-model proof remains unavailable because the existing source-attribution CLI preflight forbids operator agent messages from agent exec. The marker was not removed, and no alternate injection route, live Gateway/session mutation, or deployment was used.
Requested and co-authored by @shakkernerd.
Work sessions
Worked on by