Repository navigation
fix: stop repeated browser replies after background child work - #166362
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 October 6, 2026, 8:30 PM ET / October 7, 2026, 00:30 UTC. ClawSweeper reviewWhat this changesThe PR preserves the actual reply destination when background work resumes a conversation and strengthens existing browser and Slack regression checks. Merge readiness✅ Ready for maintainer review This repair remains necessary: current main and the latest release retain the faulty destination assignment. The introduced change addresses the source-supported cause without weakening completion classification; no actionable patch defect was found. Priority: P1 Review scores
Verification
How this fits togetherThe heartbeat runner resumes conversations after background commands finish. Its reply context feeds child spawning and completion settlement, which determine whether a final answer has satisfied the conversation’s delivery obligation. flowchart TD
A[Background command finishes] --> B[Heartbeat runner]
C[Conversation delivery route] --> B
B --> D[Reply context]
D --> E[Private child work]
E --> F[Parent final answer]
F --> G[Completion settlement]
G --> H[Complete or retry]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0, Tests +14. Total +14 across 3 files. View PR surface stats
Review metricsNone. 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 reply destinations faithful to the resolved conversation route while preserving the existing evidence requirements for external delivery. Do we have a high-confidence way to reproduce the issue? Yes: the linked report gives a precise Gateway/browser sequence, and current-main destination propagation and settlement classification support its failure mechanism. This review did not run the sequence. Is this the best way to solve the issue? Yes: correcting the destination at the heartbeat context producer is narrower than adding classifier exceptions and retains unresolved external-delivery safeguards. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8e667761db3e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Fixed: browser conversations no longer repeat final replies after background work delegates and yields. |
…w#166362) Preserve browser reply destinations when background completion delegates and yields, so the final reply settles once. Fixes openclaw#166344.
Fixes #166344.
What Problem This Solves
A background command can resume a browser conversation, delegate a private child, and yield while that child finishes. The parent's final answer appears in the chat, but the completion record rejects it and starts another synthesis turn, producing repeated answers without another user message.
The failure comes from the internal wake sender being copied into the reply destination. Child work then inherits
{to: "heartbeat"}without a channel, which the completion classifier correctly treats as an unresolved destination.User Impact
Browser continuations retain their session-only reply destination, so the parent can complete its owed final answer once. Resolved external channel destinations still carry their account and thread context, and unresolved external delivery continues to require evidence. Private child output, intentional silence, and cancellation or replacement checks retain their existing behavior. No configuration or data migration is required.
Why This Change Was Made
The heartbeat execution context now takes
Tofrom the resolved delivery destination and respects the existing originating-context suppression.Fromcontinues to identify the wake sender. This corrects the value before the shared tool context passes it to child spawning, rather than adding destination exceptions in the completion classifier.Two existing tests now check the absent browser destination and the resolved Slack destination. The implementation changes one assignment; the real Gateway/browser recorder remains a task-specific proof fixture.
Evidence
An isolated Linux Gateway and its served Control UI reproduced the original behavior with a loopback Responses provider. Exec completion, child spawning, yield, transcript publication, and settlement all used the normal runtime. The browser retained two identical finals after reload; the provider recorded one child and two settlement requests. A Node debugger observation at the actual classifier call showed a successful visible terminal reply rejected solely with the malformed destination. The owner regression also failed on the original
To: "heartbeat"value.Remote validation passed on the candidate: all 45 selected static checks, all selected production and test type graphs, the selected plugin-boundary compile/canary, the full runtime build, 805 Node tests across 66 files, 78 mocked UI tests across 23 files, and the browser-extension E2E. The Node batch retained one existing Mac-only APFS skip. The trusted private-key scan and production dependency audit also passed. Independent source review and repository autoreview found no actionable defects in their scopes.
Single-worker commands
pnpm test <file> --maxWorkers=1took 30.88 seconds forheartbeat-runner.sender-prefers-delivery-target.test.tsand 102.64 seconds forheartbeat-runner.webchat-exec-completion.test.ts. The latter's existing 23 cases exercise real dispatcher and SQLite publication, visibility, silence, replacement, and event retention; their case count and fixture runs are unchanged.The integrated real Gateway/browser scenario passed on the candidate combined with main: one child, one settlement request, and one final reply before and after reload. The actual classifier accepted the visible reply; child delivery ended as delivered and its pending wake was removed. Required CI passed, and ClawSweeper awarded Platinum with no findings on the exact PR head.
Visual evidence
Background completion, child yield, and one final reply
proof.webm
Visual verification
69d6e071b9ac5c7181b318d0ccab9effd9e04fa3