feat(agent): target sessions via session field on agent nodes#46
Merged
Conversation
`do: agent` nodes could only set `agentId` → `openclaw agent --agent <id>`. A session key placed there (e.g. `agent:main:slack:channel:agent`) can't resolve as an agent, so OpenClaw silently fell back to `main` — the agent target was effectively ignored. Add a first-class `session` field mapping to `openclaw agent --session-key`, faithful to OpenClaw's own selector model: `agentId` and `session` compose (a bare key is scoped by `agentId`; an `agent:`-prefixed key is self-scoping and must match `agentId` if both are set — enforced by OpenClaw, not re-asserted here). Validation rejects a session-key-shaped `agentId` with a hint to use `session`. Bumps to 1.3.0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
do: agentnodes could only setagentId→openclaw agent --agent <id>. When a session key (e.g.agent:main:slack:channel:agent) was placed inagentId, OpenClaw couldn't resolve it as an agent and silently fell back tomain— so the agent target appeared to be ignored. clawflow had no way to target a session at all.Fix
Add a first-class
sessionfield on agent nodes, mapping to OpenClaw's nativeopenclaw agent --session-key, faithful to OpenClaw's own selector model:agentId→--agent(a configured agent slug, e.g.main/clawflow)session→--session-key(a session key)agentId; anagent:-prefixed key is self-scoping and must matchagentIdif both are set (enforced by OpenClaw, not re-asserted here).agentIdwith a hint to usesession.{ "do": "agent", "name": "reply", "session": "agent:main:slack:channel:agent", "task": "..." }→
openclaw agent --session-key agent:main:slack:channel:agent --message ...Verification
Reproduced every arg-building path against a fake
openclawon PATH (session / bare+agentId / prefixed+agentId / plain agentId / no target / colon-agentId rejected). Full suite 144/144 pass,tsc --noEmitclean.Bumps to 1.3.0.
🤖 Generated with Claude Code