Repository navigation
fix(agents): replies fail after restart recovery posts progress - #174745
Conversation
Retain explicit nonfinal source-reply intent when a recovered internal run has no channel source turn. Replay may traverse only marked same-run progress mirrors, without reopening final, unmarked, or other-run replies. Co-authored-by: steipete <[email protected]>
Co-authored-by: steipete <[email protected]>
Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: dae702d6-2300-477a-ad12-580b48aba105
|
🦞👀 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 preserves explicit progress finality and lets restart recovery continue past same-run nonfinal message-tool replies. Example: A recovered run sends “Widget recovery is still working.” with final:false, then the Gateway restarts again.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a current restart-recovery failure through the existing owners, and no actionable introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe message tool persists visible reply mirrors; the embedded runner uses transcript ancestry and current writer authority to decide whether an interrupted user turn can resume. flowchart LR
A[Accepted user turn] --> B[Embedded agent run]
B --> C[Message tool progress]
C --> D[Session transcript]
D --> E[Restart replay owner]
E --> F[Current writer validation]
F --> B
Technical reviewBest possible solution: Preserve explicit progress at production and reuse the existing guarded replay owner without relaxing final-reply or current-writer boundaries. Do we have a high-confidence way to reproduce the issue? Current-main source exposes both missing finality propagation and replay rejection; the PR reports a failing baseline and a passing double-restart regression, but no target code was executed during this review. Is this the best way to solve the issue? The repair addresses the producer omission and the existing replay policy directly, while preserving conservative handling of completed, unmarked, unrelated, and superseded turns. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 38314adc3a4d. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +11, Tests +125, Docs +3. Total +139 across 7 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
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 October 16, 2026, 6:24 PM ET / 22:24 UTC. |
|
Merged via squash.
|
…claw#174745) * fix(agents): preserve progress replies across restart replay Retain explicit nonfinal source-reply intent when a recovered internal run has no channel source turn. Replay may traverse only marked same-run progress mirrors, without reopening final, unmarked, or other-run replies. Co-authored-by: steipete <[email protected]> * test(gateway): prove progress survives repeated cold restart Co-authored-by: steipete <[email protected]> * fix(agents): replies fail after restart recovery posts progress Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: dae702d6-2300-477a-ad12-580b48aba105 --------- Co-authored-by: steipete <[email protected]>
What Problem This Solves
Fixes replies failing with “Session transcript keyed user is outside the current turn” when restart recovery encounters a progress update from the interrupted run.
User Impact
Users can continue interrupted work after a nonfinal progress reply without duplicating their input. Final replies, newer input, unrelated runs, transcript writer fences, and stale-turn protection remain barriers. No configuration or data migration is required; this does not rewrite already-failed transcripts.
Why This Change Was Made
Preserve explicit
final: falseat the message-tool producer, including recovered runs without channel-source context. The existing replay owner then recognizes only marked same-run progress as unfinished work. Progress stays visible in history but is excluded from model input. No new state store, replay owner, compatibility path, or exception to keyed-user ownership is introduced.Worked on by
Work sessions
Evidence
done, no active run, and no keyed-user error. Test body: 18.97s; runner: 39.12s (including worker compilation). Synthetic local model responses exercised real tools, transcript persistence, SIGKILL/restart, and public Gateway APIs; the shared Team Gateway was not changed.The real-process test extends the existing widget-restart fixture rather than adding another Gateway composition. Its additional restart is necessary to prove that progress produced during source-less recovery survives a later process replacement; the focused replay tests cover the narrower acceptance/rejection contract. Exact-head CI passed: run 38973896475, attempt 1, including the required openclaw/ci-gate; the run completed in 10m11s. Independent ClawSweeper review of this head also reported no findings.
View the OpenClaw team session