Repository navigation
fix: avoid irrelevant background command follow-ups - #162302
Conversation
Make completion updates conditional on new user-relevant information while preserving outstanding work and useful result delivery. Local task: followup-0e8
|
Codex review: needs maintainer review before merge. Reviewed September 30, 2026, 10:30 PM ET / October 1, 2026, 02:30 UTC. ClawSweeper reviewWhat this changesThe PR tells background-command completion turns to report new, relevant results and otherwise remain silent, with documentation and coverage for both reply modes. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main still requests unconditional completion recaps. No actionable introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherBackground commands enqueue completion events that wake the originating agent conversation. The heartbeat runner supplies completion instructions, then either publishes the agent's update or settles the event silently. flowchart TD
A[Background command finishes] --> B[Completion event queue]
B --> C[Heartbeat runner]
C --> D[Completion relevance instructions]
D --> E[Agent continues authorized work]
E --> F{User update needed?}
F -->|Yes| G[Publish useful result]
F -->|No| H[Settle silently]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +5, Tests +58, Docs +1. Total +64 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use the existing completion prompt owner to continue authorized work while notifying users only about outstanding results, changed outcomes, or unresolved problems. Do we have a high-confidence way to reproduce the issue? Unclear for the live model symptom: current source demonstrably requests unconditional recaps for nonempty deliverable completions, but this review did not reproduce an irrelevant follow-up with a real model. Is this the best way to solve the issue? Yes. Adjusting the existing completion instructions is a narrow solution that preserves useful delivery and continuation; disabling completion wakes would also suppress needed work. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1b9d7e70ae30. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Make completion updates conditional on new user-relevant information while preserving outstanding work and useful result delivery. Local task: followup-0e8
Related: #148360
What Problem This Solves
Fixes: background command completions prompt irrelevant follow-up messages after their results were already handled or superseded.
User Impact
User impact: the agent is instructed to stay silent for routine, duplicate, superseded, or already-recovered results, while still delivering requested results and reporting meaningful outcome changes or new actionable failures.
This is a model instruction, not a deterministic notification filter. Completion turns still run and can continue outstanding authorized work. No configuration changes or migration are required.
Why This Change Was Made
Completion delivery eligibility should permit a useful update, not require a recap of every command. Replace the unconditional relay instruction with relevance guidance and the existing silence contract for both normal replies and
heartbeat_respond. Preserve WebChat delivery, queue settlement, explicitly disabled delivery, and diagnostic guidance for failures without captured output.Evidence
git diff --check: passed.Command:
pnpm test src/infra/heartbeat-events-filter.test.ts src/infra/heartbeat-runner.webchat-exec-completion.test.ts --maxWorkers=1.Measured local cost: 120.29 seconds total command wall time (baseline 128.43 seconds). Individual Vitest durations: prompt file 0.437 seconds (baseline 0.551); WebChat runner file 116.02 seconds (baseline 124.16). The two added runner cases took 3.08 and 3.06 seconds and reuse the existing fixture to exercise real publication and event settlement rather than just helper strings. Worker compilation/import overhead is included; these measurements do not establish a performance improvement. CI timing was not yet available when opening.
Validation limits: model output is mocked in runner tests. This verifies prompt assembly and publication/settlement behavior, not live model compliance. No live Gateway/UI test or full repository suite was run.
View the OpenClaw team session