Bug Description
When a message is sent in a ClawSwarm group chat, OpenClaw receives the message and processes it correctly. However, the reply generated by the agent is visible in OpenClaw's Web UI but NOT visible in the ClawSwarm client.
Environment
Steps to Reproduce
- Connect OpenClaw instance to ClawSwarm via
agent-install.zh-CN.md guide
- Create a group chat in ClawSwarm
- Send a message mentioning an agent (e.g.
@阿和)
- OpenClaw receives the message and processes it
- The reply appears in OpenClaw Web UI
- The reply does NOT appear in ClawSwarm client
Logs
OpenClaw gateway logs
The plugin's reply.final event is emitted successfully via Redis callback. The webchat mirror (webchat-mirror) also sends intermediate messages (tool calls) to ClawSwarm successfully.
No errors, no DLQ writes. All callbacks sendEvent succeed. reply.final event is sent but not reflected in ClawSwarm UI.
clawswarm-webchat-mirror.log
{"ts":"2026-05-02T14:07:20.692Z","stage":"config_loaded","hasBaseUrl":true,"hasOutboundToken":true}
{"ts":"2026-05-02T14:07:20.730Z","stage":"mirror_payload_sent","messageId":"tool-result:agent:main:main:call_function_xxx","senderType":"assistant"}
The mirror log shows only tool_result messages, and NO llm_output or before_message_write entries.
OpenClaw warning logs
before_message_write handler from clawswarm returned a Promise; this hook is synchronous and the result was ignored.
tool_result_persist handler from clawswarm returned a Promise; this hook is synchronous and the result was ignored.
This warning appears for every hook. The hooks are registered as async functions correctly in the plugin code, but OpenClaw calls them synchronously without awaiting.
Configuration
{
"plugins": {
"allow": ["clawswarm"],
"entries": {
"clawswarm": {"enabled": true, "config": {}}
}
},
"skills": {
"load": {
"extraDirs": ["/home/node/.openclaw/extensions/clawswarm/skills"]
},
"entries": {
"cs-chat": {"enabled": true}
}
},
"channels": {
"clawswarm": {
"accounts": {
"default": {
"enabled": true,
"baseUrl": "http://192.168.0.25:18080",
"outboundToken": "***",
"inboundSigningSecret": "***",
"webchatMirror": {"includeIntermediateMessages": true},
"gateway": {
"baseUrl": "http://192.168.0.25:18789",
"token": "***",
"model": "openclaw",
"stream": true,
"allowInsecureTls": true
},
"agentDirectory": {
"allowedAgentIds": ["main"],
"aliases": {}
}
}
}
}
}
}
Additional Observations
- Direct messages work fine — the issue appears to be specific to group chats.
- Tool result messages ARE synced via
webchatMirror (visible in ClawSwarm client for direct chats).
- llm_output hook is never triggered — the mirror log shows no
llm_output events.
- The
before_message_write hook is called synchronously by OpenClaw (which expects synchronous handlers), but the plugin registers it as an async function.
- The webchat mirror correctly uses HTTP POST to
/api/v1/clawswarm/webchat-mirror and gets {ok: true} responses.
- The plugin's
reply.final callback IS sent successfully via Redis (no DLQ entries).
- Despite all callbacks succeeding, the final reply does not appear in the ClawSwarm group chat.
Possible Root Cause
The reply.final event for group chats may not be correctly routed back to the ClawSwarm client. The difference between direct messages (which work) and group messages suggests a routing issue in how the callback event is processed by the ClawSwarm server when the chat.type is group vs direct.
Bug Description
When a message is sent in a ClawSwarm group chat, OpenClaw receives the message and processes it correctly. However, the reply generated by the agent is visible in OpenClaw's Web UI but NOT visible in the ClawSwarm client.
Environment
Steps to Reproduce
agent-install.zh-CN.mdguide@阿和)Logs
OpenClaw gateway logs
The plugin's
reply.finalevent is emitted successfully via Redis callback. The webchat mirror (webchat-mirror) also sends intermediate messages (tool calls) to ClawSwarm successfully.No errors, no DLQ writes. All callbacks sendEvent succeed. reply.final event is sent but not reflected in ClawSwarm UI.
clawswarm-webchat-mirror.log
{"ts":"2026-05-02T14:07:20.692Z","stage":"config_loaded","hasBaseUrl":true,"hasOutboundToken":true} {"ts":"2026-05-02T14:07:20.730Z","stage":"mirror_payload_sent","messageId":"tool-result:agent:main:main:call_function_xxx","senderType":"assistant"}The mirror log shows only
tool_resultmessages, and NOllm_outputorbefore_message_writeentries.OpenClaw warning logs
This warning appears for every hook. The hooks are registered as
asyncfunctions correctly in the plugin code, but OpenClaw calls them synchronously without awaiting.Configuration
{ "plugins": { "allow": ["clawswarm"], "entries": { "clawswarm": {"enabled": true, "config": {}} } }, "skills": { "load": { "extraDirs": ["/home/node/.openclaw/extensions/clawswarm/skills"] }, "entries": { "cs-chat": {"enabled": true} } }, "channels": { "clawswarm": { "accounts": { "default": { "enabled": true, "baseUrl": "http://192.168.0.25:18080", "outboundToken": "***", "inboundSigningSecret": "***", "webchatMirror": {"includeIntermediateMessages": true}, "gateway": { "baseUrl": "http://192.168.0.25:18789", "token": "***", "model": "openclaw", "stream": true, "allowInsecureTls": true }, "agentDirectory": { "allowedAgentIds": ["main"], "aliases": {} } } } } } }Additional Observations
webchatMirror(visible in ClawSwarm client for direct chats).llm_outputevents.before_message_writehook is called synchronously by OpenClaw (which expects synchronous handlers), but the plugin registers it as anasyncfunction./api/v1/clawswarm/webchat-mirrorand gets{ok: true}responses.reply.finalcallback IS sent successfully via Redis (no DLQ entries).Possible Root Cause
The
reply.finalevent for group chats may not be correctly routed back to the ClawSwarm client. The difference between direct messages (which work) and group messages suggests a routing issue in how the callback event is processed by the ClawSwarm server when thechat.typeisgroupvsdirect.