这个报错通常是Gateway里还没把 `agentId=zhongyi` 识别进配置,或者 绑定里引用了不存在的 agentId。在 OpenClaw 的多 Agent 配置里,`agents` 里的 `id`、`channels.accounts` 的 key、`bindings.agentId` 这三处要对得上 。
要改的地方
1. 在 `agents` 里注册这个 agent
先确认 `~/.openclaw/openclaw.json` 里有类似配置:
```json
{
"agents": {
"list": [
{
"id": "main"
},
{
"id": "zhongyi",
"name": "zhongyi",
"workspace": "/root/.openclaw/workspace-zhongyi",
"agentDir": "/root/.openclaw/agents/zhongyi/agent"
}
]
}
}
```
`id` 就是 Gateway 真正识别的 agent 标识,后面路由和绑定都要用它 。
2. 检查 `bindings`
如果你在 `bindings` 里写了:
```json
{
"agentId": "zhongyi",
"match": {
"channel": "feishu",
"accountId": "xxx"
}
}
```
那就要保证 `agentId` 一定真的存在于 `agents.list` 中;否则就会出现 `Unknown agent id "zhongyi"` 。
3. 检查 channel 账号 key
如果你是飞书多机器人模式,`channels.feishu.accounts` 里的 key 也要和路由绑定对应,并且不要把 `accountId` 和 `agentId` 混了。官方示例里是“accounts 的 key 对应机器人账号,bindings 再把 accountId 路由到 agentId” 。
4. 重启 Gateway
修改完配置后,要重启 Gateway 才会生效:
```bash
openclaw gateway restart
openclaw gateway status
```
这一步是多 Agent 配置生效的必要步骤 。
最常见的原因
- 只新增了目录,没有把 `zhongyi` 加进 `openclaw.json` 的 `agents.list` 。
- `bindings.agentId` 写成了 `zhongyi`,但实际 `agents.list` 里叫别的名字 。
- 改了配置但没重启 Gateway 。
- 如果你用了 profile,还改错了配置目录,需要确认你改的是当前 profile 对应的状态目录 。
你可以直接对照检查
```bash
openclaw config get bindings
openclaw gateway status