Bug type
Behavior bug (incorrect output/state without crash)
Summary
When OpenClaw's webchat heartbeat polling triggers an agent response, the system incorrectly sets the delivery context to the Feishu channel and attempts to deliver messages to heartbeat as a Feishu user ID, causing the Feishu API to return an invalid user ID error.
Steps to reproduce
- Configure multiple channels (webchat + feishu)
- Bind main agent to feishu channel via bindings config
- Webchat heartbeat polling sends a message with
from: "heartbeat", provider: "webchat"
- Main agent responds to the heartbeat message
- System incorrectly sets
deliveryContext.channel to "feishu"
- Message delivery fails and enters delivery-queue for retry loop
Expected behavior
- Webchat heartbeat messages should NOT trigger cross-channel delivery
- The
heartbeat placeholder should be recognized and skipped for delivery
deliveryContext.channel should follow the message origin channel, not be overwritten by agent bindings
Actual behavior
Feishu API returns error: Invalid ids: [heartbeat]. The message delivery fails and enters delivery-queue, causing retry loops on every gateway restart. Error log shows:
code: 99992360
msg: The request you send is not a valid {user_id} or not exists
OpenClaw version
2026.3.1
Operating system
Windows 11
Install method
npm global
Logs, screenshots, and evidence
Session state in sessions.json shows:
{
"agent:main:main": {
"origin": {
"from": "heartbeat",
"to": "heartbeat",
"provider": "webchat"
},
"deliveryContext": {
"channel": "feishu" // Should be "webchat" or no delivery
}
}
}
Delivery queue entry:
{
"to": "heartbeat",
"accountId": "main",
"sessionKey": "agent:main:feishu:direct:heartbeat",
"text": "..."
}
Impact and severity
Affected: Users with multi-channel setup (webchat + feishu)
Severity: Medium (causes API errors and retry loops)
Frequency: 100% repro when heartbeat triggers agent response
Consequence: Gateway logs fill with errors, delivery-queue accumulates failed entries
Additional information
Root Cause: The deliveryContext inheritance logic incorrectly uses the agent's channel binding instead of the message origin channel.
Workaround: Disable or reduce heartbeat task frequency to avoid triggering this bug.
Suggested Fix:
- Heartbeat messages (
from: "heartbeat") should be identified as system messages and not trigger message delivery
deliveryContext should be derived from message origin (provider field), not from agent's channel bindings
- Add validation to prevent using placeholder IDs like "heartbeat" as real user IDs
Bug type
Behavior bug (incorrect output/state without crash)
Summary
When OpenClaw's webchat heartbeat polling triggers an agent response, the system incorrectly sets the delivery context to the Feishu channel and attempts to deliver messages to
heartbeatas a Feishu user ID, causing the Feishu API to return an invalid user ID error.Steps to reproduce
from: "heartbeat",provider: "webchat"deliveryContext.channelto"feishu"Expected behavior
heartbeatplaceholder should be recognized and skipped for deliverydeliveryContext.channelshould follow the message origin channel, not be overwritten by agent bindingsActual behavior
Feishu API returns error:
Invalid ids: [heartbeat]. The message delivery fails and enters delivery-queue, causing retry loops on every gateway restart. Error log shows:OpenClaw version
2026.3.1
Operating system
Windows 11
Install method
npm global
Logs, screenshots, and evidence
Impact and severity
Affected: Users with multi-channel setup (webchat + feishu)
Severity: Medium (causes API errors and retry loops)
Frequency: 100% repro when heartbeat triggers agent response
Consequence: Gateway logs fill with errors, delivery-queue accumulates failed entries
Additional information
Root Cause: The
deliveryContextinheritance logic incorrectly uses the agent's channel binding instead of the message origin channel.Workaround: Disable or reduce heartbeat task frequency to avoid triggering this bug.
Suggested Fix:
from: "heartbeat") should be identified as system messages and not trigger message deliverydeliveryContextshould be derived from message origin (providerfield), not from agent's channel bindings