Repository navigation
fix: session archive completes after forced stop - #125614
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 1:42 AM ET / 05:42 UTC. ClawSweeper reviewWhat this changesThis PR makes forced embedded-run terminalization settle the matching local worker-turn claim so a stopped workspace session can complete archive draining. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessNo blocking source defect found: the patch releases the exact durable claim at its lifecycle owner and preserves replacement fencing. Keep this maintainer-owned PR open until its current merge result receives exact-head lifecycle validation. Priority: P2 Review scores
Verification
How this fits togetherWorkspace-backed agent sessions register an embedded run and a durable local worker-turn claim. The archive lifecycle aborts active work and waits for both the embedded run and claim to drain before archiving the session. flowchart LR
A[Stopped workspace session] --> B[Embedded agent run]
B --> C[Local worker-turn claim]
B --> D[Forced terminalization]
D --> E[Exact claim settlement]
E --> F[Archive lifecycle drain]
F --> G[Archived session]
Decision needed
Why: The patch deliberately changes when durable worker-turn authority is released, so the final merge result needs an owner decision after session-state validation. Before merge
Agent review detailsSecurityNone. PR surfaceSource +51, Tests +131. Total +182 across 6 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the exact-handle settlement path, then validate the composed force-stop/archive/replacement scenario on the final merge result before landing. Do we have a high-confidence way to reproduce the issue? Yes, from source: leave a local embedded turn unresolved past abort grace, force-terminalize it, then archive the session and observe the durable claim drain. This read-only review did not execute the scenario. Is this the best way to solve the issue? Yes, subject to exact-head validation: the repair releases state at the claim owner and keeps archive as an authoritative consumer rather than adding an archive-side bypass. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5d098cd36fca. 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
HistoryReview history (1 earlier review cycle)
|
Forced embedded-run terminalization now settles the exact closure-bound local placement claim, preserving replacement fencing and allowing archive to drain. Closes #125555
fd0d965 to
38620b6
Compare
|
Land-ready at exact prepared head Native preparation completed with:
Local proof completed before preparation: The composed source-blind forced-stop/archive/replacement scenario passed twice, and fresh P0/P1 autoreview found no accepted/actionable findings. The pre-fix regression failed for the intended ClawSweeper’s latest review has no findings. Its rank-up move—mechanical current-main refresh plus exact-head validation—is complete. The patch identity stayed stable, the review is under 12 hours, and the post-review change was mechanical, so no re-review was requested. The first PR head had a Best-fix verdict: best. Forced terminalization now settles the exact closure-bound claim captured by the local-turn owner and authoritative embedded handle. Archive remains a consumer of authoritative state, and claim identity/generation validation keeps replacement claims fenced. Production is +62/-13 (net +49), justified by this cross-owner exact-authority seam; tests/test support are +134/-1. Proof gap: Post-fix live Gateway proof was not repeated because deterministic triggering requires intentionally wedging an internal run beyond abort grace; the after-proof is the real SQLite placement/archive owner boundary. |
|
Merged via squash.
|
Forced embedded-run terminalization now settles the exact closure-bound local placement claim, preserving replacement fencing and allowing archive to drain. Closes openclaw#125555
Closes #125555
What Problem This Solves
Fixes an issue where operators stopping a workspace-backed session could be unable to archive it when the embedded run required forced terminalization. The session appeared killed and had no remaining process, but its durable local turn claim remained active, so every archive attempt returned “did not finish stopping; retry the archive.”
Why This Change Was Made
Forced terminalization now invokes the exact claim-settlement closure captured by the local turn owner and bound to the authoritative embedded-run handle. Normal completion and forced recovery share that idempotent, replacement-fenced cleanup path; archive remains a consumer of authoritative lifecycle state and does not gain a stale-claim bypass.
The regression composes the real SQLite placement store, a deliberately unresolved local run, forced killed-state persistence, archive drain, replacement claim acquisition, and late completion of the old run.
AI-assisted implementation; maintainer reviewed the complete diff and behavior.
User Impact
Stopped sessions no longer remain permanently unarchivable after a forced stop. Transcripts and worktrees keep their existing preservation behavior, while stale local execution authority is released at its owning lifecycle boundary.
Evidence
Before (live managed Gateway, redacted):
chat.abortsucceeded.sessions.patchfailed twice withTimed out waiting for session <id> turn claim releaseand the user-visible retry error.Regression proof:
mainfor the intended reason:Timed out waiting for session session-worker-turn turn claim release.node scripts/run-vitest.mjsacross 11 lifecycle/worker-turn files: 108 tests passed.node scripts/check-changed.mjs -- <six changed paths>passed core and core-test lanes, including typecheck, lint, import cycles, and database guards.pnpm buildpassed; no ineffective dynamic-import warning was introduced.git diff --checkpassed.Proof boundary:
LOC classification: