Skip to content

fix: suppress truncated silent heartbeat replies - #170650

Closed
glenn-agent wants to merge 1 commit into
openclaw:mainfrom
glenn-agent:glenn-agent/fix-170158-heartbeat-no-r
Closed

glenn-agent wants to merge 1 commit into
openclaw:mainfrom
glenn-agent:glenn-agent/fix-170158-heartbeat-no-r

Conversation

@glenn-agent

Copy link
Copy Markdown
Contributor

Summary

  • suppress heartbeat/background delivery when a model emits a truncated silent-reply prefix like NO_R
  • keep existing canonical NO_REPLY handling unchanged
  • add regression coverage for the truncated acknowledgement so it does not reach channel delivery

Fixes #170158.

Testing

  • pnpm test src/infra/heartbeat-runner.ack-token-heartbeat-acks.test.ts --maxWorkers=1
  • node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo
  • git diff --check

Notes

  • pnpm check:changed was attempted in the disposable worktree; all earlier ratchets and production core typecheck passed, but the full changed-file gate currently fails in an unrelated core test graph on src/commands/config-preflight-snapshot.test.ts importing missing readConfigPreflightSnapshot from ./config-preflight-snapshot.js.

@clawsweeper

clawsweeper Bot commented Oct 13, 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.

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. size: XS labels Oct 13, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 13, 2026
@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR suppresses truncated NO_REPLY prefixes during final heartbeat delivery.

Example: A heartbeat returns NO_R with showOk disabled.

  • Before: The configured recipient receives NO_R.
  • After: The heartbeat finishes without sending the fragment.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused repair addresses a real bug, but a configured acknowledgement defect remains and required real-behavior proof is absent.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Recipients see unexplained NO_R fragments from periodic heartbeat checks.
Reason: The suppression repair has clear value; the linked report's separate cross-account routing allegation remains unverified and outside this patch.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep this PR open: it addresses a current heartbeat suppression bug, but its new classification bypasses configured OK acknowledgements.

Priority: P2
Reviewed head: 5c39703efe1ff0329506827ff37520400f931db2

Before merge

  • Add real behavior proof - The complete PR body and discussion supply test commands but no shipped-entry-point observations; the added case uses runHeartbeatOnce with mocked agent output and channel sends. Provide sanitized Telegram Test Server screenshots, recordings, or logs for the changed heartbeat scenarios, redacting IPs, API keys, phone numbers, and non-public endpoints. 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.
  • Honor showOk when classifying truncated quiet replies (P2) - For a successful scheduled heartbeat returning NO_R with automatic replies and showOk enabled, this new predicate sets normalized.silent=true and clears the text. The acknowledgement branch at line 202 still recognizes only complete silent payloads, so it returns silent=true; heartbeat-dispatch.ts:388 then skips the configured HEARTBEAT_OK send. Recognize the same truncated quiet reply in that acknowledgement decision and extend the existing table with showOk enabled, while retaining unconditional silence for exec relays.
  • Explain or restore the original intent of Configured quiet acknowledgement semantics - 2a40409: Canonical quiet heartbeat replies honor showOk, while event relays and message-tool privacy retain unconditional silence.

Findings

  • [P2] Honor showOk when classifying truncated quiet replies — src/infra/heartbeat-delivery-normalization.ts:82-83

Provenance

  • Configured quiet acknowledgement semantics changes intended behavior without addressing why it exists (2a40409: Canonical quiet heartbeat replies honor showOk, while event relays and message-tool privacy retain unconditional silence.)

Tests

  • Missing end-to-end proof: Telegram Test Server evidence must show scheduled NO_R suppression, configured OK acknowledgement delivery, and an ordinary alert reaching its recipient; a failing-base regression run was not supplied.
Agent review details

How this fits together

The shared heartbeat classifier receives agent reply payloads and produces acknowledgement, failure, or delivery outcomes for the channel dispatcher.

flowchart TD
A[Scheduled heartbeat] --> B[Agent reply payload]
B --> C[Heartbeat normalization]
C --> D[Outcome classification]
D --> E[Quiet acknowledgement]
D --> F[Configured channel delivery]
Loading

Technical review

Best possible solution:

Recognize truncated quiet replies consistently while preserving configured acknowledgements, ordinary alerts, structured content, and existing routes.

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

Source establishes that a successful heartbeat with automatic replies, a valid destination, and final NO_R reaches delivery on current main; no target code or tests were executed.

Is this the best way to solve the issue?

The shared normalization owner is the appropriate repair boundary, but quiet-token recognition must also reach its existing acknowledgement decision.

Full review comments:

  • [P2] Honor showOk when classifying truncated quiet replies — src/infra/heartbeat-delivery-normalization.ts:82-83
    For a successful scheduled heartbeat returning NO_R with automatic replies and showOk enabled, this new predicate sets normalized.silent=true and clears the text. The acknowledgement branch at line 202 still recognizes only complete silent payloads, so it returns silent=true; heartbeat-dispatch.ts:388 then skips the configured HEARTBEAT_OK send. Recognize the same truncated quiet reply in that acknowledgement decision and extend the existing table with showOk enabled, while retaining unconditional silence for exec relays.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Silent acknowledgement normalization keeps the original intent (fb9a62e: Suppress silent exec acknowledgements at the shared delivery owner while retaining meaningful and structured output.)
  • Shared normalization implementation keeps the original intent (d264306: Consolidate infrastructure variants without changing behavior, public contracts, or ownership.)
  • Runner delivery-policy table keeps the original intent (711e57e: Consolidate overlapping test setup while preserving independent behavior contracts.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • ruel225: Raw commit 2a40409 adds src/infra/heartbeat-delivery-normalization.ts:214 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2a404095754f; files: src/infra/heartbeat-delivery-normalization.ts)

PR surface

Source +1, Tests +5. Total +6 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 3 2 +1
Tests 1 5 0 +5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 8 2 +6

Root-cause cluster

Relationship: same_root_cause
Canonical: #170158
Summary: Both open PRs repair the same final heartbeat prefix-recognition gap; neither currently provides the required real-behavior proof.

Members:

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Periodic control-token messages create bounded user-facing confusion without evidence of an unavailable workflow.
  • merge-risk: 🚨 message-delivery: The new unconditional silence classification suppresses an explicitly configured HEARTBEAT_OK acknowledgement.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. This PR directly changes whether Telegram receives heartbeat fragments and configured acknowledgements.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 13, 2026, 12:51 AM ET / 04:51 UTC.

@steipete

Copy link
Copy Markdown
Contributor

Thanks @glenn-agent for identifying the leak and adding the regression. #170190 now covers it at the shared sentinel owner, including configured acknowledgements and final delivery across channels. Closing this one as superseded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: NO_R keeps popping up in telegram chat

2 participants