Skip to content

Bug: API error messages (401 User not found) leaked to user channel #18937

@jameslu249

Description

@jameslu249

Bug Description

When an API error occurs (e.g., OpenRouter returns "401 User not found"), the error message is incorrectly forwarded to the user's messaging channel instead of being handled silently or logged internally.

Steps to Reproduce

  1. Configure WhatsApp channel with OpenRouter model
  2. System sends periodic heartbeat checks
  3. If the API returns a 401 error during heartbeat processing, the error message "HTTP 401: User not found" is sent to the user's WhatsApp

Expected Behavior

API errors should be:

  • Logged internally
  • Not forwarded to the user's messaging channel
  • Handled gracefully (e.g., retry with backoff or fail silently for heartbeat checks)

Actual Behavior

The raw error message "HTTP 401: User not found" was delivered to the user's WhatsApp channel.

Context

  • OpenClaw version: 2026.2.13
  • Channel: WhatsApp
  • Model: openrouter/moonshotai/kimi-k2.5
  • Session: HEARTBEAT check triggered the error

Error Log (from session history)

{
  "role": "assistant",
  "content": [],
  "stopReason": "error",
  "errorMessage": "401 User not found."
}

The user received this error message in their WhatsApp chat at 2:05 PM (Asia/Shanghai) on 2026-02-17.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions