openclaw - 💡(How to fix) Fix Feature request: Suppress error messages in group chats [1 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#44598Fetched 2026-04-08 00:44:45
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

Error Message

When the agent encounters an API error (e.g., Anthropic streaming error like Unexpected event order, got message_start before receiving "message_stop"), the error message is sent to the current conversation, including group chats. This exposes technical error details to all group members, which is not ideal. Add a configuration option to control error message behavior in group chats:

Fix Action

Fix / Workaround

Current Workaround

Code Example

{
  "agents": {
    "defaults": {
      "errorReplyPolicy": {
        "groups": "suppress" | "dm-admin" | "allow"
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Problem

When the agent encounters an API error (e.g., Anthropic streaming error like Unexpected event order, got message_start before receiving "message_stop"), the error message is sent to the current conversation, including group chats.

This exposes technical error details to all group members, which is not ideal.

Proposed Solution

Add a configuration option to control error message behavior in group chats:

{
  "agents": {
    "defaults": {
      "errorReplyPolicy": {
        "groups": "suppress" | "dm-admin" | "allow"
      }
    }
  }
}

Or alternatively, add a message:before_send hook event that allows hooks to intercept and modify/suppress outbound messages before they are sent.

Current Workaround

None available. The message:sent hook fires after the message is already sent, so it cannot be used to prevent sending.

Environment

  • OpenClaw version: 2026.3.11
  • Channel: Feishu
  • Context: Group chat

extent analysis

Fix Plan

To address the issue, we will implement the proposed solution by adding a configuration option to control error message behavior in group chats.

Step-by-Step Solution

  • Add the errorReplyPolicy configuration option to the agents section in the configuration file:
{
  "agents": {
    "defaults": {
      "errorReplyPolicy": {
        "groups": "suppress"
      }
    }
  }
}
  • Alternatively, create a message:before_send hook event to intercept and modify/suppress outbound messages:
// Example hook function
module.exports = async function(message) {
  if (message.error && message.channel.type === 'group') {
    // Suppress error message in group chat
    return null;
  }
  return message;
};
  • Update the agent code to check the errorReplyPolicy configuration option before sending error messages:
if (errorReplyPolicy.groups === 'suppress' && channel.type === 'group') {
  // Suppress error message in group chat
  return;
}

Verification

To verify that the fix worked, test the agent in a group chat and trigger an API error. The error message should not be sent to the group chat if the errorReplyPolicy is set to suppress.

Extra Tips

  • Make sure to update the documentation to reflect the new configuration option and hook event.
  • Consider adding additional logging to track suppressed error messages for debugging purposes.

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