Skip to content

Keep quiet heartbeats quiet after tool failures - #156174

Merged
pash-openai merged 4 commits into
mainfrom
codex/quiet-heartbeat-tool-failures
Sep 23, 2026
Merged

pash-openai merged 4 commits into
mainfrom
codex/quiet-heartbeat-tool-failures

Conversation

@pash-openai

@pash-openai pash-openai commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A heartbeat can explicitly choose notify=false after a failed tool call and still send a visible “Bash failed” warning. This makes background discovery interrupt the user even after the agent decides there is nothing worth reporting.

Honor the structured notification decision at the final delivery decision, where it covers both synthesized warnings and accumulated tool media. Exact unsent delivery records are marked suppressed so restart recovery cannot later send the warning. Already queued or ambiguous sends retain their existing recovery ownership. An earlier quiet decision never suppresses a later agent-runner crash. The scheduler still records the failure; notify=true and failures without a structured outcome keep their existing behavior.

Evidence

A live background run received an HTTP 403 during an exploratory read, then returned heartbeat_respond with notify=false. Its final delivery still contained a synthesized tool warning. The regression follows failed message, exec, and bash calls through payload assembly and media merging into the notification decision. Runner-level cases check quiet and notified failures against the actual channel send boundary, including exact suppression, sibling preservation, and queued/ambiguous delivery ownership. The three new payload/media regressions fail on the release baseline; 69 focused cases pass with the complete fix on the release line.

The selected release-line run took 33.83 seconds including worker preparation; the three new payload/media cases took 6 milliseconds combined.

@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-23T04:42:35.422141Z b318fac PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Sep 23, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b318fac3a9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@pash-openai
pash-openai enabled auto-merge (squash) September 23, 2026 04:51
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 23, 2026, 1:11 AM ET / 05:11 UTC.

ClawSweeper review

What this changes

The PR suppresses warnings and accumulated media when a completed heartbeat chooses no notification, and retires its exact unsent delivery records while preserving runner failures.

Merge readiness

⛔ Blocked before merge - 2 items remain

This remains a useful, focused fix: inspected main and release code still permit the unwanted warning. The earlier media-suppression finding is addressed, and no blocking code defect was found; after-fix real behavior proof remains required.

Priority: P2
Reviewed head: 39588ecd6151c5e1dd7a6687154198c6431982ea

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is focused and the regressions are meaningful, but after-fix real behavior proof is absent.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: After-fix evidence for heartbeat classification and pending-delivery suppression consists of composed helper tests and runner tests with a mocked channel sender; the live observation describes only the original failure. A real after-fix heartbeat result is still needed. Existing storage shapes and settlement states remain unchanged. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: After-fix evidence for heartbeat classification and pending-delivery suppression consists of composed helper tests and runner tests with a mocked channel sender; the live observation describes only the original failure. A real after-fix heartbeat result is still needed. Existing storage shapes and settlement states remain unchanged. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 10 items Pinned introduced change: Reviewed the merge-base-to-head delta, including both production changes and both test files. Base-only workflow, Android, and provider changes were excluded. The supplied stale test merge was not used to infer merge removals.
Established quiet-heartbeat contract: Documentation defines notify:false as no visible update and gives the structured response precedence over fallback text.
Current main still needs the fix: Main derives shouldSkipMain from normalized content and media without honoring notify:false in the explicit-failure branch; a synthesized warning therefore remains deliverable.
Findings None None.
Security None None.

How this fits together

Heartbeats run background agent checks and pass their results through OpenClaw’s shared reply dispatcher. That dispatcher decides what reaches a channel and records delivery state for restart recovery.

flowchart TD
  A[Background heartbeat] --> B[Tool results and media]
  B --> C[Notification decision]
  C --> D{Quiet completed turn?}
  D -->|Yes| E[Suppress prepared deliveries]
  D -->|No| F[Existing channel delivery]
  E --> G[Record heartbeat outcome]
  F --> G
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: After-fix evidence for heartbeat classification and pending-delivery suppression consists of composed helper tests and runner tests with a mocked channel sender; the live observation describes only the original failure. A real after-fix heartbeat result is still needed. Existing storage shapes and settlement states remain unchanged. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Complete next step (P2) - Add after-fix real behavior proof to the PR body before merge. Screenshots or recordings are preferred when useful; terminal output and logs also count. Redact IP addresses, keys, phone numbers, private endpoints, and other private data. Updating the body should trigger review automatically; otherwise ask a maintainer to comment @clawsweeper re-review.
Agent review details

Security

None.

PR surface

Source +5, Tests +75. Total +80 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 10 5 +5
Tests 2 109 34 +75
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 119 39 +80

Review metrics

None.

Root-cause cluster

Relationship: canonical
Canonical: #156174
Summary: This is the upstream correction; the related PR carries the same repair to a release branch.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep the notification decision at the final delivery boundary and use existing exact-record settlement to prevent quiet warnings from returning through recovery.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: a mutating tool failure followed by notify:false can produce a warning or media that main’s failure classification still permits sending. This review did not execute that path.

Is this the best way to solve the issue?

Yes. Enforcing the existing structured decision after payload assembly covers both warnings and media without changing ordinary reply generation or adding another delivery owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against f45f36e8eb9e.

Labels

Label changes:

  • add P2: Unwanted background warnings violate the documented quiet-heartbeat behavior but have a limited blast radius.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: After-fix evidence for heartbeat classification and pending-delivery suppression consists of composed helper tests and runner tests with a mocked channel sender; the live observation describes only the original failure. A real after-fix heartbeat result is still needed. Existing storage shapes and settlement states remain unchanged. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • add proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The change affects whether heartbeat warnings and attachments appear in Telegram chats, which Test Server userbot evidence can demonstrate.

Label justifications:

  • P2: Unwanted background warnings violate the documented quiet-heartbeat behavior but have a limited blast radius.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: After-fix evidence for heartbeat classification and pending-delivery suppression consists of composed helper tests and runner tests with a mocked channel sender; the live observation describes only the original failure. A real after-fix heartbeat result is still needed. Existing storage shapes and settlement states remain unchanged. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The change affects whether heartbeat warnings and attachments appear in Telegram chats, which Test Server userbot evidence can demonstrate.

Evidence

What I checked:

  • Pinned introduced change: Reviewed the merge-base-to-head delta, including both production changes and both test files. Base-only workflow, Android, and provider changes were excluded. The supplied stale test merge was not used to infer merge removals. (39588ecd6151)
  • Established quiet-heartbeat contract: Documentation defines notify:false as no visible update and gives the structured response precedence over fallback text. Public docs: docs/gateway/heartbeat.md. (docs/gateway/heartbeat.md:133, 39588ecd6151)
  • Current main still needs the fix: Main derives shouldSkipMain from normalized content and media without honoring notify:false in the explicit-failure branch; a synthesized warning therefore remains deliverable. (src/infra/heartbeat-delivery-normalization.ts:192, f45f36e8eb9e)
  • Latest supplied release retains the same behavior: The v2026.9.5 revision also lacks the quiet completed-turn condition in shouldSkipMain. (src/infra/heartbeat-delivery-normalization.ts:192, ec9c1a13db89)
  • Final notification boundary: The new condition suppresses warnings and media only when the agent run did not fail. The dispatcher consumes this classification before producing an outbound final reply, addressing the earlier review concern about media bypassing suppression. (src/infra/heartbeat-delivery-normalization.ts:194, 39588ecd6151)
  • Existing recovery settlement is reused: Quiet replies call the existing suppression owner, which accepts only prepared delivery records. Settlement checks session, intent, and delivery identity; cleanup requires every sibling to be delivered or suppressed. Queued and unknown records remain owned by recovery. No stored format or schema changes are introduced. (src/auto-reply/reply/dispatch-from-config.pending-final.ts:17, 39588ecd6151)

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add redacted after-fix evidence showing a quiet failed-tool heartbeat sends neither its warning nor accumulated media and remains quiet through recovery.

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.

@pash-openai
pash-openai merged commit c19c463 into main Sep 23, 2026
211 checks passed
@pash-openai
pash-openai deleted the codex/quiet-heartbeat-tool-failures branch September 23, 2026 05:20
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 24, 2026
* fix: honor quiet heartbeat outcomes after tool failures

* fix: make heartbeat notification decision cover failure delivery

* fix: retire unsent warnings after quiet heartbeat outcomes

* fix: preserve heartbeat runner failures after an earlier quiet decision
@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant