openclaw - ✅(Solved) Fix Failed tool call narrations leak to Telegram as user-visible messages [2 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#51065Fetched 2026-04-08 01:04:41
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Participants
Timeline (top)
cross-referenced ×2referenced ×2commented ×1

When a tool call fails (e.g., an edit with non-matching oldText), OpenClaw sends the failure narration to the Telegram channel as a user-visible message, e.g.:

⚠️ 📝 Edit: in ~/.openclaw/workspace/MEMORY.md (326 chars) failed

This leaks internal tool call state to the user as separate messages, which is confusing and noisy — especially during multi-step workflows where rapid tool calls can generate 5-7 messages in quick succession.

Error Message

During a build session with frequent file edits, a single failed edit sends a confusing error message to the user. Multiple rapid tool calls can flood the chat with 5-7 narration messages in seconds.

Root Cause

When a tool call fails (e.g., an edit with non-matching oldText), OpenClaw sends the failure narration to the Telegram channel as a user-visible message, e.g.:

⚠️ 📝 Edit: in ~/.openclaw/workspace/MEMORY.md (326 chars) failed

This leaks internal tool call state to the user as separate messages, which is confusing and noisy — especially during multi-step workflows where rapid tool calls can generate 5-7 messages in quick succession.

Fix Action

Fixed

PR fix notes

PR #51091: fix(agent): respect suppressToolErrors for all tools including mutating ones

Description (problem / solution / changelog)

Summary

When a tool call fails (e.g. edit with non-matching oldText), OpenClaw sends a warning narration to the messaging surface (Telegram etc.):

⚠️ 📝 Edit: in ~/.openclaw/workspace/MEMORY.md (326 chars) failed

This is generated in buildEmbeddedRunPayloads via resolveToolErrorWarningPolicy. The config.messages.suppressToolErrors option exists to suppress these warnings, but it was checked after the mutating-tool guard — making it completely ineffective for edit, write, exec and other high-impact tools.

Root cause: suppressToolErrors was checked at the end of the policy function, after if (isMutatingToolError) { return { showWarning: true } }. Since mutating tools always return true first, the suppressToolErrors flag was unreachable for them.

Fix: Move the suppressToolErrors check to the top of the function, before any tool-specific rules. When suppressToolErrors is true, no tool-error warnings are shown to the user — the agent sees the error in context and handles it.

Changes

  • src/agents/pi-embedded-runner/run/payloads.ts: resolveToolErrorWarningPolicy — check suppressToolErrors first

Testing

# In openclaw.yaml — suppress all tool-error warning messages
messages:
  suppressToolErrors: true

After this fix, edit / write / exec tool failures will no longer produce ⚠️ messages in Telegram when suppressToolErrors: true is set.

Fixes #51065

Changed files

  • src/agents/pi-embedded-runner/run/payloads.ts (modified, +6/-3)

PR #51213: fix: filter failed tool call narrations from user-visible messages

Description (problem / solution / changelog)

Summary

  • Filter out narration text from failed tool calls so internal tool failure details are not exposed to users in chat messages.

Change Type

  • Bug fix

Linked Issue

  • Closes #51065

Changed files

  • src/agents/pi-embedded-subscribe.handlers.tools.ts (modified, +7/-4)

Code Example

⚠️ 📝 Edit: in ~/.openclaw/workspace/MEMORY.md (326 chars) failed
RAW_BUFFERClick to expand / collapse

Description

When a tool call fails (e.g., an edit with non-matching oldText), OpenClaw sends the failure narration to the Telegram channel as a user-visible message, e.g.:

⚠️ 📝 Edit: in ~/.openclaw/workspace/MEMORY.md (326 chars) failed

This leaks internal tool call state to the user as separate messages, which is confusing and noisy — especially during multi-step workflows where rapid tool calls can generate 5-7 messages in quick succession.

Steps to Reproduce

  1. Configure Telegram channel with streaming: 'off'
  2. Have the agent make an edit tool call with old_string that doesn't match (deliberate or accidental)
  3. Observe: a ⚠️ 📝 Edit: message is sent to the Telegram chat

Expected Behavior

Failed tool calls should be internal to the agent session. The agent handles the failure and decides what to tell the user. Tool narrations (success or failure) should not be forwarded to the messaging surface.

Environment

  • OpenClaw: 2026.3.13
  • Channel: Telegram
  • Streaming: off
  • Agent model: claude-opus-4-6

Impact

During a build session with frequent file edits, a single failed edit sends a confusing error message to the user. Multiple rapid tool calls can flood the chat with 5-7 narration messages in seconds.

extent analysis

Fix Plan

To prevent tool call failure narrations from being sent to the Telegram channel, we need to modify the OpenClaw code to handle failures internally.

Here are the steps:

  • Modify the edit tool call to catch and handle failures silently
  • Add a check to prevent sending failure narrations to the Telegram channel when streaming is set to 'off'

Example code changes:

# In the edit tool call function
try:
    # existing edit code
except ToolCallError as e:
    # Handle the error internally, e.g., log it
    logger.error(f"Edit tool call failed: {e}")
    # Do not send the failure narration to the Telegram channel
    return

# In the Telegram channel handler
if channel_config['streaming'] == 'off':
    # Do not send tool call narrations to the channel
    narration_handler.disable()

Verification

To verify that the fix worked:

  • Configure the Telegram channel with streaming: 'off'
  • Make an edit tool call with a non-matching oldText
  • Check that no failure narration message is sent to the Telegram channel

Extra Tips

  • Make sure to test the fix with different tool calls and failure scenarios to ensure that it works as expected.
  • Consider adding a configuration option to control whether tool call failures are sent to the Telegram channel or not.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING