Feishu Agent Bind
/install feishu-agent-bind
Feishu Group → Agent Binding
Route a Feishu group to a specific agent with isolated workspace.
Prerequisites
- Agent must exist in
agents.list(create viaopenclaw agents add \x3Cid>) - Agent must have its own workspace (NOT shared with main)
- Gateway running
Steps
1. Ensure agent has independent workspace
# Check current config
openclaw config get agents.list | jq '.[] | select(.id=="\x3CagentId>") | .workspace'
If workspace is shared with main (~/.openclaw/workspace), create a dedicated one:
mkdir -p ~/.openclaw/workspace-\x3CagentId>/memory
Write at minimum SOUL.md and AGENTS.md into the new workspace. Then update config:
import json
with open(os.path.expanduser('~/.openclaw/openclaw.json')) as f:
c = json.load(f)
for a in c['agents']['list']:
if a['id'] == '\x3CagentId>':
a['workspace'] = os.path.expanduser(f'~/.openclaw/workspace-\x3CagentId>')
break
with open(os.path.expanduser('~/.openclaw/openclaw.json'), 'w') as f:
json.dump(c, f, indent=2, ensure_ascii=False)
2. Add group to channels.feishu.groups (optional but recommended)
# Add group config
fs_groups = c['channels']['feishu'].setdefault('groups', {})
fs_groups['\x3Cchat_id>'] = {'requireMention': False}
3. Add binding with accountId (CRITICAL)
Must include accountId matching the Feishu account (usually "main"), otherwise the binding is silently ignored during route matching.
bindings = c.get('bindings', [])
bindings.append({
"agentId": "\x3CagentId>",
"match": {
"channel": "feishu",
"peer": {"kind": "group", "id": "\x3Cchat_id>"},
"accountId": "\x3Cfeishu_account_id>" # e.g. "main"
}
})
c['bindings'] = bindings
Or via CLI:
# Get existing bindings first
openclaw config get bindings
# Set all bindings (existing + new)
openclaw config set --json bindings '[...existing..., {"agentId":"\x3CagentId>","match":{"channel":"feishu","peer":{"kind":"group","id":"\x3Cchat_id>"},"accountId":"main"}}]'
4. Clean up stale sessions
If the group was previously handled by another agent, delete its old session to avoid cache issues:
# Find old sessions
openclaw sessions --all-agents --json | grep "\x3Cchat_id>"
# Delete from the old agent's session store
python3 -c "
import json, glob
for f in glob.glob(os.path.expanduser('~/.openclaw/agents/*/sessions/sessions.json')):
with open(f) as fh: d = json.load(fh)
keys = [k for k in d if '\x3Cchat_id>' in k]
if keys:
for k in keys: del d[k]
with open(f,'w') as fh: json.dump(d, fh)
print(f'Cleaned {f}: {keys}')
"
5. Restart gateway
openclaw gateway restart
6. Verify
# Check bindings
openclaw config get bindings
# Check sessions hit the right agent
openclaw status | grep "\x3Cchat_id>"
# Should show agent:\x3CagentId>:feishu:group:\x3Cchat_id>
Pitfalls (learned the hard way)
-
Missing
accountIdin binding: Binding withoutaccountIddefaults to matching account"default", not"main". The Feishu plugin passes its actual account ID (e.g."main"), so the binding is never matched. Always setaccountIdexplicitly. -
Shared workspace: If multiple agents share the same workspace, they read the same SOUL.md/BOOTSTRAP.md and confuse identities. Always use separate workspaces.
-
Stale sessions: Old sessions cached under a different agent persist after binding changes. Delete them manually.
-
Gateway restart required: Binding changes need a full gateway restart to take effect.
-
openclaw agents bindCLI pitfall: The CLI commandopenclaw agents bind --agent X --bind feishu:\x3Cchat_id>setsaccountId=\x3Cchat_id>instead ofpeer.id=\x3Cchat_id>. This is wrong for group routing. Useconfig set --json bindingsdirectly instead. -
Binding order matters: When multiple bindings match, first one wins. Put specific peer bindings before account-level bindings.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install feishu-agent-bind - After installation, invoke the skill by name or use
/feishu-agent-bind - Provide required inputs per the skill's parameter spec and get structured output
What is Feishu Agent Bind?
Bind a Feishu group chat to a specific OpenClaw agent. Use when user wants to route a Feishu group to a dedicated agent (e.g., devops, hr, pm). Covers agent... It is an AI Agent Skill for Claude Code / OpenClaw, with 160 downloads so far.
How do I install Feishu Agent Bind?
Run "/install feishu-agent-bind" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Feishu Agent Bind free?
Yes, Feishu Agent Bind is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Feishu Agent Bind support?
Feishu Agent Bind is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Feishu Agent Bind?
It is built and maintained by Embracex1998 (@embracex1998); the current version is v1.0.1.