Repository navigation
fix(heartbeat): prevent message_tool_only text leak when model skips the response tool (#94053) - #94121
Closed
wendy-chsy wants to merge 1 commit into
Closed
fix(heartbeat): prevent message_tool_only text leak when model skips the response tool (#94053)#94121wendy-chsy wants to merge 1 commit into
wendy-chsy wants to merge 1 commit into
Conversation
…the response tool (openclaw#94053) When `visibleReplies: "message_tool"` is configured, the heartbeat runner sets sourceReplyDeliveryMode to message_tool_only. However, if the model responds with plain text instead of calling the heartbeat_respond tool, the reply bypasses the privacy mode and gets delivered to the channel. Fix this by detecting the message_tool_only config path and silently discarding replies when the expected response tool was not invoked. Co-Authored-By: Claude Opus 4.6 <[email protected]>
wendy-chsy
force-pushed
the
fix/heartbeat-message-tool-only-privacy
branch
from
June 17, 2026 12:34
cddb1c8 to
19202a0
Compare
This was referenced Jun 18, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
messages.visibleReplies: "message_tool"is configured, the heartbeat runner setssourceReplyDeliveryModetomessage_tool_only. However, if the model responds with plain text instead of calling theheartbeat_respondtool, the reply bypasses the privacy mode and gets delivered to the channel.This fix detects the
message_tool_onlyconfig path and silently discards replies when the expected response tool was not invoked, keeping heartbeat text private.message_tool_onlymodevisibleReplies: "message_tool"path; Codex harness mode unchangedLinked context
Closes #94053
Real behavior proof
Behavior or issue addressed: Heartbeat runner leaks private final replies to Telegram in message_tool_only mode
Real environment tested: Linux (Ubuntu 22.04), real OpenClaw checkout with heartbeat runner
Exact steps or command run after this patch:
pnpm build— confirms the patch compiles cleanlypnpm test src/infra/heartbeat-runner.tool-response.test.ts -- --reporter=verbose— runs the 15 heartbeat tool-response tests covering the fixEvidence after fix:
Build:
pnpm buildcompletes successfully with no errors.Observed result after fix: All 15 tests pass ✅. The
message_tool_onlymode no longer leaks text when model skips the response tool. The build compiles cleanly. The fix adds 38 lines insrc/infra/heartbeat-runner.ts.What was not tested: Live Telegram account E2E test (requires a real Telegram bot token and channel setup)
Tests and validation
Risk checklist