Skip to content

feat(agent): target sessions via session field on agent nodes#46

Merged
pallaoro merged 1 commit into
mainfrom
clawflow-seems-to-ignore-the-agent
Jul 8, 2026
Merged

feat(agent): target sessions via session field on agent nodes#46
pallaoro merged 1 commit into
mainfrom
clawflow-seems-to-ignore-the-agent

Conversation

@pallaoro

@pallaoro pallaoro commented Jul 8, 2026

Copy link
Copy Markdown
Member

Problem

do: agent nodes could only set agentIdopenclaw agent --agent <id>. When a session key (e.g. agent:main:slack:channel:agent) was placed in agentId, OpenClaw couldn't resolve it as an agent and silently fell back to main — so the agent target appeared to be ignored. clawflow had no way to target a session at all.

Fix

Add a first-class session field on agent nodes, mapping to OpenClaw's native openclaw 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)
  • They 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.
{ "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 openclaw on PATH (session / bare+agentId / prefixed+agentId / plain agentId / no target / colon-agentId rejected). Full suite 144/144 pass, tsc --noEmit clean.

Bumps to 1.3.0.

🤖 Generated with Claude Code

`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>
@pallaoro
pallaoro merged commit fb9f266 into main Jul 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant