-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Bug: Feishu channel does not handle text slash commands (/compact, /new, /stop) #79409
Copy link
Copy link
Open
wangdingxin/openclaw
#1Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
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.