Bug: Feishu channel does not handle text slash commands (/compact, /new, /stop, etc.)
Environment
- OpenClaw: 2026.5.7 (eeef486)
- @openclaw/feishu plugin: 2026.5.7
- Channel: Feishu (websocket mode)
- OS: macOS 26.4.1 (arm64), node 25.5.0
Description
Text slash commands like /compact, /new, /stop are not executed when received through the Feishu channel. The messages are dispatched directly to the agent as plain text without passing through the slash command handler.
The same /compact command works correctly via webchat/TUI.
Steps to Reproduce
- Set up Feishu channel with
dmPolicy: "open" and multiple accounts
- Send
/compact as a DM message to any Feishu bot agent
- Observe Gateway logs
Expected Behavior
Gateway should intercept /compact and execute the compaction, as it does on webchat.
Actual Behavior
Gateway logs show the message is dispatched directly to the agent:
[feishu] feishu[nova]: received message from ou_xxx in oc_xxx (p2p)
[feishu] feishu[nova]: Feishu[nova] DM from ou_xxx: /compact
[feishu] feishu[nova]: dispatching to agent (session=agent:nova:main)
[feishu] feishu[nova]: dispatch complete (queuedFinal=false, replies=0)
No command handling occurs. The agent receives /compact as plain text and may ignore it or reply with a confused response.
On webchat/TUI, the same command produces:
[agent:nested] session=agent:nova:main run=xxx channel=webchat **已执行 `/compact`**
Code Investigation
I traced the message flow through the minified source:
-
Feishu plugin (@openclaw/feishu/dist/monitor.account-*.js):
- Sets
CommandBody: agentFacingContent (which is ctx.content, the raw message text /compact)
- Passes it via
textForCommands: ctxPayload.CommandBody to core.channel.turn.run()
- Does not set
CommandSource in the context payload
-
Core dispatch (dispatch-*.js):
ctx.CommandSource is undefined for feishu messages
-
Core reply handler (get-reply-*.js):
shouldHandleTextCommands() from commands-text-routing-*.js is called with commandSource: undefined
- This function returns
true when cfg.commands?.text !== false (which is our case, default is true)
- So
allowTextCommands = true and the slash command path should be entered
resolveSlashCommandName() correctly detects /compact from the text
However, despite all this appearing correct, the command is never actually handled. The agent receives the raw /compact text instead of the command being intercepted.
Possible Root Cause
The issue may be in how core.channel.turn.run() processes the inbound message from the feishu adapter before reaching get-reply. The CommandBody is being set correctly by the plugin, but somewhere in the turn pipeline, the message is dispatched to the agent without first checking for slash commands.
Alternatively, there may be a session routing or early-return in the dispatch layer that skips command handling for plugin channel messages.
Config
{
"commands": {
"native": "auto",
"nativeSkills": "auto",
"restart": true,
"ownerDisplay": "raw",
"ownerAllowFrom": ["feishu:ou_xxx"]
},
"channels": {
"feishu": {
"enabled": true,
"connectionMode": "websocket",
"dmPolicy": "open",
"groupPolicy": "open"
}
}
}
Workaround
Use webchat/TUI to send /compact to the target agent session. This works correctly.
Bug: Feishu channel does not handle text slash commands (
/compact,/new,/stop, etc.)Environment
Description
Text slash commands like
/compact,/new,/stopare not executed when received through the Feishu channel. The messages are dispatched directly to the agent as plain text without passing through the slash command handler.The same
/compactcommand works correctly via webchat/TUI.Steps to Reproduce
dmPolicy: "open"and multiple accounts/compactas a DM message to any Feishu bot agentExpected Behavior
Gateway should intercept
/compactand execute the compaction, as it does on webchat.Actual Behavior
Gateway logs show the message is dispatched directly to the agent:
No command handling occurs. The agent receives
/compactas plain text and may ignore it or reply with a confused response.On webchat/TUI, the same command produces:
Code Investigation
I traced the message flow through the minified source:
Feishu plugin (
@openclaw/feishu/dist/monitor.account-*.js):CommandBody: agentFacingContent(which isctx.content, the raw message text/compact)textForCommands: ctxPayload.CommandBodytocore.channel.turn.run()CommandSourcein the context payloadCore dispatch (
dispatch-*.js):ctx.CommandSourceisundefinedfor feishu messagesCore reply handler (
get-reply-*.js):shouldHandleTextCommands()fromcommands-text-routing-*.jsis called withcommandSource: undefinedtruewhencfg.commands?.text !== false(which is our case, default is true)allowTextCommands = trueand the slash command path should be enteredresolveSlashCommandName()correctly detects/compactfrom the textHowever, despite all this appearing correct, the command is never actually handled. The agent receives the raw
/compacttext instead of the command being intercepted.Possible Root Cause
The issue may be in how
core.channel.turn.run()processes the inbound message from the feishu adapter before reachingget-reply. TheCommandBodyis being set correctly by the plugin, but somewhere in the turn pipeline, the message is dispatched to the agent without first checking for slash commands.Alternatively, there may be a session routing or early-return in the dispatch layer that skips command handling for plugin channel messages.
Config
{ "commands": { "native": "auto", "nativeSkills": "auto", "restart": true, "ownerDisplay": "raw", "ownerAllowFrom": ["feishu:ou_xxx"] }, "channels": { "feishu": { "enabled": true, "connectionMode": "websocket", "dmPolicy": "open", "groupPolicy": "open" } } }Workaround
Use webchat/TUI to send
/compactto the target agent session. This works correctly.