Skip to content

fix: avoid irrelevant background command follow-ups - #162302

Merged
jalehman merged 1 commit into
mainfrom
followup-310/exec-followup-relevance
Oct 1, 2026
Merged

jalehman merged 1 commit into
mainfrom
followup-310/exec-followup-relevance

Conversation

@jalehman

@jalehman jalehman commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

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

  • Red/green: four new prompt assertions failed against the original instructions and passed after the change.
  • Focused suite: 64 passed (38 prompt tests, 26 WebChat runner tests).
  • Runner boundary coverage confirms silent responses publish no assistant message, consume the completion, and do not run again on a stale wake in both reply modes. Existing useful-result tests still publish exactly once.
  • Type-aware lint: zero warnings/errors. Formatting, docs MDX, and git diff --check: passed.
  • Independent autoreview: no actionable findings.

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

Make completion updates conditional on new user-relevant information while preserving outstanding work and useful result delivery.

Local task: followup-0e8
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: S labels Oct 1, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 30, 2026, 10:30 PM ET / October 1, 2026, 02:30 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: cb8de31e4be27a8cf43b1db84da603c8fb00cd98

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused patch with meaningful prompt and settlement coverage, clear validation limits, and no actionable correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied MEMBER classification exempts ordinary contributor proof. Coverage exercises the completion prompt and real runner publication/settlement owners with injected model output; it does not establish live model compliance, and the historical baseline image does not cover this change. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied MEMBER classification exempts ordinary contributor proof. Coverage exercises the completion prompt and real runner publication/settlement owners with injected model output; it does not establish live model compliance, and the historical baseline image does not cover this change. No stored-data contract changes.
Evidence reviewed 10 items Introduced change: The pinned introduction delta changes completion instructions, their prompt tests, WebChat runner coverage, and background-process documentation. Delivery eligibility, publication authority, and storage contracts are unchanged.
Still necessary on main: Current main retains the unconditional instruction to relay successful output or explain failure; it does not contain this relevance guidance.
Latest release comparison: The latest supplied release, v2026.9.7, also retains unconditional completion relay instructions.
Findings None None.
Security None None.

How this fits together

Background 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +5, Tests +58, Docs +1. Total +64 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 15 10 +5
Tests 2 68 10 +58
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 84 20 +64

Review metrics

Metric Value Why it matters
Added runner-case cost 2 cases: 3.08 s and 3.06 s locally The body quantifies the recurring test cost and explains that these cases inspect real publication and event settlement with injected model output.

Technical review

Best 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.

Labels

Label changes:

  • add P2: This is a bounded improvement to background-command follow-up relevance without an established urgent outage or regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied MEMBER classification exempts ordinary contributor proof. Coverage exercises the completion prompt and real runner publication/settlement owners with injected model output; it does not establish live model compliance, and the historical baseline image does not cover this change. No stored-data contract changes.

Label justifications:

  • P2: This is a bounded improvement to background-command follow-up relevance without an established urgent outage or regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied MEMBER classification exempts ordinary contributor proof. Coverage exercises the completion prompt and real runner publication/settlement owners with injected model output; it does not establish live model compliance, and the historical baseline image does not cover this change. No stored-data contract changes.

Evidence

What I checked:

  • Introduced change: The pinned introduction delta changes completion instructions, their prompt tests, WebChat runner coverage, and background-process documentation. Delivery eligibility, publication authority, and storage contracts are unchanged. (src/infra/heartbeat-events-filter.ts:129, cb8de31e4be2)
  • Still necessary on main: Current main retains the unconditional instruction to relay successful output or explain failure; it does not contain this relevance guidance. (src/infra/heartbeat-events-filter.ts:145, 1b9d7e70ae30)
  • Latest release comparison: The latest supplied release, v2026.9.7, also retains unconditional completion relay instructions. (src/infra/heartbeat-events-filter.ts:145, c074824a27c9)
  • Actual merge result: Raw test-merge parent records match the pinned main followed by the exact PR head. Comparing the result against its main parent preserves the focused prompt change; unrelated endpoint drift is not attributed to this PR. (src/infra/heartbeat-events-filter.ts:129, fd8a1d0f5a29)
  • Silence and settlement coverage: The two added runner cases inject NO_REPLY or a heartbeat_respond notify=false result, then inspect committed transcripts, consumed events, silent outcomes, and skipped stale wakes. Existing useful-result publication cases remain. This proves runner composition with injected model output, not live model relevance decisions. (src/infra/heartbeat-runner.webchat-exec-completion.test.ts:314, cb8de31e4be2)
  • Existing response contract: The shared heartbeat instructions already distinguish notify=false from a user-facing notification. The dispatcher consumes inspected completion occurrences after a successful quiet outcome, while failure and cancellation paths preserve their existing handling. (src/infra/heartbeat-dispatch.ts:277, cb8de31e4be2)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • etzelm: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • jalehman: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@jalehman
jalehman merged commit 84d89c2 into main Oct 1, 2026
226 of 227 checks passed
@jalehman
jalehman deleted the followup-310/exec-followup-relevance branch October 1, 2026 05:09
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
Make completion updates conditional on new user-relevant information while preserving outstanding work and useful result delivery.

Local task: followup-0e8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant