Skip to content

feat(agent): CLI-aligned selector fields, all template-resolvable#47

Merged
pallaoro merged 1 commit into
mainfrom
is-this-true-one-issue
Jul 8, 2026
Merged

feat(agent): CLI-aligned selector fields, all template-resolvable#47
pallaoro merged 1 commit into
mainfrom
is-this-true-one-issue

Conversation

@pallaoro

@pallaoro pallaoro commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

Agent-node target fields now mirror the openclaw agent CLI flags 1:1, and are all template-resolvable so a prior node can compute the target.

clawflow field CLI flag notes
agent --agent was agentId (kept as deprecated alias)
sessionKey --session-key was session (kept as deprecated alias)
sessionId --session-id new selector
channel --channel new — reply delivery channel
  • CLI-aligned namingagentIdagent, sessionsessionKey. Old names kept as deprecated aliases (new name wins if both set); a non-blocking validator warning nudges migration, surfaced via console.warn at run time. Existing flows run unchanged.
  • New selectorssessionId and channel.
  • All selectors are dynamicagent/sessionKey/sessionId/channel are interpolated (e.g. agent: "{{ route.slug }}"), closing the gap where agentId/session were passed to the CLI un-interpolated.
  • Single source of truth — a declarative NODE_FIELD_MODES registry in types.ts classifies every node field's resolution mode, with a compile-time exhaustiveness guard. Both the runner (interpolation) and the validator (template-ref checks) read it, replacing the scattered per-handler and per-validator field lists.

Bumps to 1.3.1.

Test plan

  • npm run build — clean (compile-time field-mode exhaustiveness check passes)
  • npm test — 151/151 green, incl. new coverage for buildAgentArgs, selector interpolation, alias back-compat, and deprecation warnings

🤖 Generated with Claude Code

Rename agent-node target fields to mirror `openclaw agent` flags 1:1 —
agent→--agent, sessionKey→--session-key, sessionId→--session-id,
channel→--channel — keeping agentId/session as deprecated aliases (new
name wins if both set; non-blocking validator warning surfaced at run
time). Adds the sessionId and channel selectors.

All selector fields are now interpolated, so a prior node can compute the
target (e.g. agent: "{{ route.slug }}"). This is driven by a new
declarative NODE_FIELD_MODES registry in types.ts: the single source of
truth for how each node field is resolved, read by both the runner
(template interpolation) and the validator (template-ref checks), with a
compile-time exhaustiveness guard. Replaces the scattered per-handler and
per-validator field lists, and fixes the gap where agentId/session were
passed to the CLI un-interpolated.

Bumps to 1.3.1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pallaoro
pallaoro merged commit 8cfc3c1 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