Skip to content

[Bug] Group chat reply not visible in ClawSwarm client despite successful reply.final callback #9

@chenkechen4244

Description

@chenkechen4244

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

  1. Connect OpenClaw instance to ClawSwarm via agent-install.zh-CN.md guide
  2. Create a group chat in ClawSwarm
  3. Send a message mentioning an agent (e.g. @阿和)
  4. OpenClaw receives the message and processes it
  5. The reply appears in OpenClaw Web UI
  6. 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

  1. Direct messages work fine — the issue appears to be specific to group chats.
  2. Tool result messages ARE synced via webchatMirror (visible in ClawSwarm client for direct chats).
  3. llm_output hook is never triggered — the mirror log shows no llm_output events.
  4. The before_message_write hook is called synchronously by OpenClaw (which expects synchronous handlers), but the plugin registers it as an async function.
  5. The webchat mirror correctly uses HTTP POST to /api/v1/clawswarm/webchat-mirror and gets {ok: true} responses.
  6. The plugin's reply.final callback IS sent successfully via Redis (no DLQ entries).
  7. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions