openclaw - 💡(How to fix) Fix Bug: Feishu channel does not handle text slash commands (/compact, /new, /stop)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

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.

Root Cause

Possible Root Cause

Fix Action

Workaround

Use webchat/TUI to send /compact to the target agent session. This works correctly.

Code Example

[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)

---

[agent:nested] session=agent:nova:main run=xxx channel=webchat **已执行 `/compact`**

---

{
  "commands": {
    "native": "auto",
    "nativeSkills": "auto",
    "restart": true,
    "ownerDisplay": "raw",
    "ownerAllowFrom": ["feishu:ou_xxx"]
  },
  "channels": {
    "feishu": {
      "enabled": true,
      "connectionMode": "websocket",
      "dmPolicy": "open",
      "groupPolicy": "open"
    }
  }
}
RAW_BUFFERClick to expand / collapse

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

  1. Set up Feishu channel with dmPolicy: "open" and multiple accounts
  2. Send /compact as a DM message to any Feishu bot agent
  3. 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:

  1. 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
  2. Core dispatch (dispatch-*.js):

    • ctx.CommandSource is undefined for feishu messages
  3. 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING