Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
openclaw agent --session-id <uuid> is silently ignored when --agent <id> is specified. The CLI always routes to the agent's main session, regardless of --session-id or --to values. This makes it impossible to route CLI-sent messages to non-main sessions (e.g., group chat sessions created via webhook).
Steps to reproduce
- Configure an agent (e.g.
myagent) in openclaw.json
- Create a group chat session via channel webhook (session key:
agent:myagent:feishu:group:oc_xxx, session ID: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee)
- Run:
openclaw agent --agent myagent --session-id aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee --message 'test' --deliver
- Observe: message appears in
agent:myagent:main session, not the targeted group session
Expected behavior
Per docs at https://docs.openclaw.ai/tools/agent-send:
--session-id <id>: Use an explicit session id to reuse an existing session
--session-id should override --agent's default main session routing and deliver the message to the specified session.
Actual behavior
| Flags |
Actual Session Key |
Expected |
--agent myagent |
agent:myagent:main |
correct |
--agent myagent --session-id <uuid> |
agent:myagent:main |
should use session-id |
--agent myagent --to 'chat:oc_xxx' |
agent:myagent:main |
should derive from --to |
--session-id <uuid> (no --agent) |
agent:main:main |
wrong agent config |
OpenClaw version
2026.3.31
Operating system
macOS 26.2 (ARM64)
Install method
npm global
Model
glm-5-turbo (zai)
Provider / routing chain
zai -> glm-5-turbo
Additional provider/model setup details
Reproducible with any model/provider. The routing logic is independent of the LLM backend.
Logs, screenshots, and evidence
Gateway log confirms all CLI-routed messages go to the agent's main session:
2026-04-04T08:39:48.846+08:00 [feishu] feishu[default]: dispatching to agent (session=agent:alice:main)
--json output from --session-id (without --agent) confirms it falls back to the default main agent:
{
"sessionId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"sessionKey": "agent:main:main",
"workspaceDir": "/home/user/.openclaw/workspace-main"
}
Impact and severity
Medium. Blocks programmatic routing to non-main sessions via CLI. Workaround available (route to main session only).
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
openclaw agent --session-id <uuid>is silently ignored when--agent <id>is specified. The CLI always routes to the agent's main session, regardless of--session-idor--tovalues. This makes it impossible to route CLI-sent messages to non-main sessions (e.g., group chat sessions created via webhook).Steps to reproduce
myagent) inopenclaw.jsonagent:myagent:feishu:group:oc_xxx, session ID:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee)openclaw agent --agent myagent --session-id aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee --message 'test' --deliveragent:myagent:mainsession, not the targeted group sessionExpected behavior
Per docs at https://docs.openclaw.ai/tools/agent-send:
--session-idshould override--agent's default main session routing and deliver the message to the specified session.Actual behavior
--agent myagentagent:myagent:main--agent myagent --session-id <uuid>agent:myagent:main--agent myagent --to 'chat:oc_xxx'agent:myagent:main--session-id <uuid>(no --agent)agent:main:mainOpenClaw version
2026.3.31
Operating system
macOS 26.2 (ARM64)
Install method
npm global
Model
glm-5-turbo (zai)
Provider / routing chain
zai -> glm-5-turbo
Additional provider/model setup details
Reproducible with any model/provider. The routing logic is independent of the LLM backend.
Logs, screenshots, and evidence
Gateway log confirms all CLI-routed messages go to the agent's main session:
--jsonoutput from--session-id(without--agent) confirms it falls back to the defaultmainagent:{ "sessionId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "sessionKey": "agent:main:main", "workspaceDir": "/home/user/.openclaw/workspace-main" }Impact and severity
Medium. Blocks programmatic routing to non-main sessions via CLI. Workaround available (route to main session only).