Skip to content

fix #94053: keep heartbeat plain-text replies private in message-tool mode - #94587

Closed
ztexydt-cqh wants to merge 1 commit into
openclaw:mainfrom
ztexydt-cqh:fix/issue-94053-heartbeat-tool-only-privacy
Closed

ztexydt-cqh wants to merge 1 commit into
openclaw:mainfrom
ztexydt-cqh:fix/issue-94053-heartbeat-tool-only-privacy

Conversation

@ztexydt-cqh

@ztexydt-cqh ztexydt-cqh commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #94111, which addresses the same issue with a similar fix. Closing this duplicate.

@openclaw-barnacle openclaw-barnacle Bot added size: XS triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels Jun 18, 2026
@clawsweeper

clawsweeper Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 18, 2026, 9:17 AM ET / 13:17 UTC.

Summary
The PR changes the heartbeat runner so plain text heartbeat replies are suppressed when message-tool mode expected heartbeat_respond but the model did not call it, and adds a focused regression test for the text case.

PR surface: Source +10, Tests +21. Total +31 across 2 files.

Reproducibility: yes. the issue has a high-confidence source reproduction path: configure messages.visibleReplies: "message_tool", return a no-tool heartbeat final payload, and current main falls through to durable channel delivery when shouldSkipMain is false. I did not execute it because this review is read-only.

Review metrics: 1 noteworthy metric.

  • Message-Delivery Gate: 1 heartbeat main-reply suppression gate changed. The PR changes the condition that decides whether a heartbeat final payload reaches durable channel delivery, which is the core privacy-sensitive behavior under review.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #94053
Summary: This PR is one of several candidate fixes for the same open heartbeat message-tool-only privacy bug; no candidate has merged into current main.

Members:

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

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Fix the no-tool suppression so it covers media-bearing main payloads as well as text-only payloads.
  • [P1] Add real after-fix proof from a live Telegram setup or recorder-backed runner path showing that no channel message is sent, with private details redacted.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body describes a test-harness path and notes live Telegram was not tested; please add redacted screenshot, terminal/live output, logs, recording, or linked artifact proof and update the PR body so ClawSweeper can re-review.

Mantis proof suggestion
A live Telegram transcript would materially prove that no no-tool heartbeat final reply is sent to the configured chat after the patch. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram live: verify a heartbeat with messages.visibleReplies=message_tool and no heartbeat_respond call produces no Telegram chat message.

Risk before merge

  • [P1] The patch still permits a no-tool heartbeat final payload with media to reach channel delivery, leaving the message-tool-only privacy contract incomplete.
  • [P1] The PR body supplies only test-harness/mock proof and says live Telegram behavior was not tested; an external PR needs real after-fix behavior proof before merge.
  • [P1] Multiple open sibling PRs target the same linked issue, so maintainers should choose one canonical fix path to avoid duplicated review and divergent behavior.

Maintainer options:

  1. Fix Whole-Payload Suppression (recommended)
    Update the guard so no-tool message-tool-only heartbeat replies suppress both text and media main payloads, while preserving explicit internal-notice and intentional exec-completion exceptions.
  2. Accept Text-Only Scope
    Maintainers could intentionally limit this PR to the reported text leak, but that would leave the same source-reply privacy contract incomplete for media payloads.
  3. Pick A Canonical Sibling
    If another same-root-cause PR has stronger proof or cleaner guard shape, pause this PR and route the linked issue to that canonical replacement instead.

Next step before merge

  • [P1] The PR needs contributor or maintainer follow-up for both a code fix and real behavior proof; ClawSweeper should not take over proof that only the contributor’s setup can provide.

Security
Cleared: No dependency, workflow, script, credential, or supply-chain change was found; the remaining security-relevant privacy concern is captured as the functional delivery finding.

Review findings

  • [P2] Suppress media payloads when the heartbeat tool is not used — src/infra/heartbeat-runner.ts:1947
Review details

Best possible solution:

Land one canonical fix that suppresses the whole no-tool heartbeat main payload under message-tool-only mode, except explicit internal notices and any source-proven relayable exec-completion exception, with regression coverage and real Telegram or recorder-backed runner proof.

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

Yes, the issue has a high-confidence source reproduction path: configure messages.visibleReplies: "message_tool", return a no-tool heartbeat final payload, and current main falls through to durable channel delivery when shouldSkipMain is false. I did not execute it because this review is read-only.

Is this the best way to solve the issue?

No, this is only a partial fix. The right shape is the same runner-level guard, but it must suppress the whole main reply payload in message-tool-only mode and include real behavior proof, not only a text-only unit case.

Full review comments:

  • [P2] Suppress media payloads when the heartbeat tool is not used — src/infra/heartbeat-runner.ts:1947
    The new no-tool suppression still goes through !normalized.hasMedia, so a final payload with mediaUrls and no heartbeat_respond call will bypass shouldSkipMain, keep mediaUrls from replyPayload, and be sent by the durable channel batch. In message_tool_only, no message/heartbeat tool call means no source reply, so the tool-missing suppression needs to drop the whole main payload except explicit internal notices or intentional relayable exec completions.
    Confidence: 0.88

Overall correctness: patch is incorrect
Overall confidence: 0.86

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against aad0559de0e2.

Label changes

Label changes:

  • add P2: This is a bounded but real heartbeat privacy bug that can leak background source replies into configured channels.
  • add merge-risk: 🚨 message-delivery: The diff changes heartbeat channel-delivery suppression and can still misdeliver no-tool media payloads if merged as-is.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body describes a test-harness path and notes live Telegram was not tested; please add redacted screenshot, terminal/live output, logs, recording, or linked artifact proof and update the PR body so ClawSweeper can re-review.
  • add mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. This changes visible Telegram delivery by preventing a heartbeat reply from appearing in chat, which is suitable for short Telegram proof.

Label justifications:

  • P2: This is a bounded but real heartbeat privacy bug that can leak background source replies into configured channels.
  • merge-risk: 🚨 message-delivery: The diff changes heartbeat channel-delivery suppression and can still misdeliver no-tool media payloads if merged as-is.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body describes a test-harness path and notes live Telegram was not tested; please add redacted screenshot, terminal/live output, logs, recording, or linked artifact proof and update the PR body so ClawSweeper can re-review.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. This changes visible Telegram delivery by preventing a heartbeat reply from appearing in chat, which is suitable for short Telegram proof.
Evidence reviewed

PR surface:

Source +10, Tests +21. Total +31 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 11 1 +10
Tests 1 21 0 +21
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 32 1 +31

What I checked:

  • Current main source-reply mode: Current main passes sourceReplyDeliveryMode: "message_tool_only" when the heartbeat response tool is enabled, so the heartbeat runner is explicitly entering the source-reply privacy mode before resolving the final payload. (src/infra/heartbeat-runner.ts:1817, aad0559de0e2)
  • Current main leak path: Current main computes shouldSkipMain from normalized ack stripping, media, and relayable exec state; when it is false, replyPayload media URLs are retained and the payload is sent through sendDurableMessageBatch. (src/infra/heartbeat-runner.ts:1937, aad0559de0e2)
  • PR suppression gap: The PR adds suppressMainBecauseToolNotUsed, but still combines it with !normalized.hasMedia, so a no-tool main reply with media remains deliverable. (src/infra/heartbeat-runner.ts:1947, 99c3637884e1)
  • Payload contract: Reply payloads support mediaUrl and mediaUrls, and sendability treats media as outbound content, so the media exception is not theoretical in this delivery path. (src/plugin-sdk/reply-payload.ts:160, aad0559de0e2)
  • Repository policy evidence: Root policy says message_tool_only final visible replies must come through the current-source message tool and that no message call means no source reply; the Telegram maintainer note also asks for real Telegram proof for visible Telegram behavior. (AGENTS.md:274, aad0559de0e2)
  • Related issue context: The linked issue is still open, includes concrete Debian/Telegram reproduction steps and logs for the text leak, and has several same-root-cause PR attempts but no merged fix yet.

Likely related people:

  • neeravmakwana: Authored the merged heartbeat message-tool delivery policy PR that made heartbeat runs enter message_tool_only for configured message-tool/Codex-runtime cases. (role: introduced behavior; confidence: high; commits: bd9c78f957b8; files: src/infra/heartbeat-runner.ts, src/infra/heartbeat-runner.tool-response.test.ts)
  • joshavant: Merged the heartbeat message-tool policy PR and recently authored a heartbeat delivery fix in the same runner file. (role: merger and adjacent owner; confidence: medium; commits: bd9c78f957b8, 3643de4ba7b6; files: src/infra/heartbeat-runner.ts)
  • jalehman: Recently merged a broad session cleanup lifecycle seam that touched the heartbeat runner and is in the live history for this file. (role: recent area contributor; confidence: medium; commits: 968190e5a7fe; files: src/infra/heartbeat-runner.ts)
  • vincentkoc: Local current-main blame for the heartbeat reply/delivery block points to a recent refactor commit by Vincent Koc that carried the current implementation forward. (role: recent refactor carrier; confidence: medium; commits: 95b6df834350; files: src/infra/heartbeat-runner.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added 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. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jun 18, 2026
@clawsweeper
clawsweeper Bot temporarily deployed to qa-live-shared June 18, 2026 13:21 Inactive
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels Jun 18, 2026
@openclaw-mantis

Copy link
Copy Markdown
Contributor

Mantis Telegram Desktop Proof

Summary: Mantis captured native Telegram Desktop before/after GIFs showing the heartbeat reply visible on Main and suppressed in This PR.

Main screenshot This PR screenshot
Baseline native Telegram Desktop screenshot Candidate native Telegram Desktop screenshot
Main This PR
Baseline native Telegram Desktop proof GIF Candidate native Telegram Desktop proof GIF

Motion-trimmed clips:

Raw QA files: https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-94587/run-27762279618-1/index.json

This branch was previously deployed

1 inactive deployment
qa-live-shared — 99c36378 Deployed Jun 18, 2026 by clawsweeper[bot] via Run agentic native Telegram proof #191145
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant