feat(agent): CLI-aligned selector fields, all template-resolvable#47
Merged
Conversation
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>
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.
Summary
Agent-node target fields now mirror the
openclaw agentCLI flags 1:1, and are all template-resolvable so a prior node can compute the target.agent--agentagentId(kept as deprecated alias)sessionKey--session-keysession(kept as deprecated alias)sessionId--session-idchannel--channelagentId→agent,session→sessionKey. Old names kept as deprecated aliases (new name wins if both set); a non-blocking validator warning nudges migration, surfaced viaconsole.warnat run time. Existing flows run unchanged.sessionIdandchannel.agent/sessionKey/sessionId/channelare interpolated (e.g.agent: "{{ route.slug }}"), closing the gap whereagentId/sessionwere passed to the CLI un-interpolated.NODE_FIELD_MODESregistry intypes.tsclassifies 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 forbuildAgentArgs, selector interpolation, alias back-compat, and deprecation warnings🤖 Generated with Claude Code