Repository navigation
fix: unblock sessions after force-clearing stalled startup - #139265
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: needs maintainer review before merge. Reviewed September 5, 2026, 3:57 PM ET / 19:57 UTC. ClawSweeper reviewWhat this changesReleases stalled startup’s session claim when its reply is force-cleared, rejects late continuations, isolates new admissions from inherited claims, and supplies the prepared plan for a Codex test. Merge readiness✅ Ready for maintainer review This remains a useful repair for a current-main defect. No blocking findings remain, and the supplied Gateway recovery evidence supports the unchanged production candidate. Priority: P1 Review scores
Verification
How this fits togetherSession admission reserves a session before sandbox startup and model execution. Recovery must release that reservation while preventing abandoned work from interfering with the next reply. flowchart TD
A[Incoming message] --> B[Session claim admission]
B --> C[Sandbox startup]
C --> D[Model execution and reply]
B --> E[Reply recovery barrier]
E --> F[Release exact old claim]
F --> A
F --> G[Reject abandoned continuation]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +39, Tests +271. Total +310 across 5 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. Technical reviewBest possible solution: Keep settlement in the existing claim owner and attach it before startup; the added wiring is justified because backend registration cannot protect the earlier interval. Do we have a high-confidence way to reproduce the issue? Yes: hold startup after claim acquisition but before backend registration, force-clear, then send another message. Current source exposes the gap, and the supplied baseline Gateway run demonstrates it; this reviewer did not execute it. Is this the best way to solve the issue? Yes: the repair extends the existing exact-claim lifecycle at admission. Backend-only cleanup starts too late, while session-wide claim clearing could release a successor. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6b1314938d6d. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Thanks @johan-eilertsen. Landed as 1321b60e. Verification complete for 94f48f09.
The guarded merge and resulting source were verified. Contributor credit is preserved. |
…139265) Release the exact admitted claim when recovery force-clears a turn stalled before backend registration. Fence the old continuation so the next message can answer without losing its replacement claim. Use the existing prepared runtime-plan fixture in the context-propagation test to avoid unintended real-provider loading while retaining its assertions and timeout. Closes openclaw#139242. Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #139242.
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR.
What Problem This Solves
Fixes an issue where users cannot get another reply after force-clearing a turn stalled in sandbox startup, before its backend run handle is registered.
Why This Change Was Made
Bind the existing exact-claim settlement to the reply operation immediately after local admission. Keep its assertion in the admitted execution lane so abandoned startup and late results cannot execute under or release a replacement claim. Fresh child admission gets its own settlement context.
User Impact
The next message can run after recovery. The abandoned turn cannot deliver a late answer or release its successor's claim. Existing registered-handle cleanup remains available.
Evidence
Verified current-main baseline
676845210acb1d5eb8667ae6d0811a8e7b6f0f2band product candidatea818086565a03cf767b816038574b8573ea66855through isolated, built Gateways:aborted=false drained=false forceCleared=truechat.sendThe fixture uses the shipped sandbox plugin interface and real SSH workspace preparation. Recovery calls the shipped
abortAndDrainAgentHarnessRuninterface used by the production recovery owner. A deterministic QA provider holds the successor response while the old startup is released. Admission, queues, SQLite claims, runtime execution, and Gateway delivery are real; no claim-store writes or restart substitute for recovery. This is isolated Gateway proof, not authenticated Telegram or native Codex-provider proof.Controls passed: normal completion; registered backend recovery and exact release; another session's claim and answer preserved; non-forced recovery leaves an unsettled startup claim intact. The registered product control drained cooperatively; existing focused tests cover the noncooperative force-clear branch.
worker-turn-launcher.test.tsandworker-turn-launcher.claim-recovery.test.ts.git diff --check.94f48f09cb3a664f9e3b81d0d4ec4c124e463fb8adds only that test correction to the tested product candidate. Runtime, build, dependency, and provider-fixture inputs are unchanged, so the original builds and all 10 acceptance clauses retain their actual tested identities. Fresh checks and review run on the new head.Production +50/−11 (net +39), tests +271: this extends the existing settlement owner rather than adding a new recovery mechanism or configuration. Separate follow-ups: direct CLI pre-backend claim recovery remains a pre-existing sibling gap; sandbox subprocess cancellation remains outside this repair.
AI-assisted implementation and verification.