docs(agents): fix stale command syntax and sub_agents claim in Named Commands#3684
Merged
Conversation
…Commands
The Named Commands section used the shell-style $1/$2 positional
syntax for command argument substitution, but the resolver
(pkg/runtime/commands.go) only recognises JS template expressions
(${args[0]}, ${args.join(" ")}, ${tool_name({...})}) and the legacy
!tool_name(key=value) call form. $1/$2 are silently left as literal
text in the rendered instruction.
The section also claimed a command's target agent must be listed in
the current agent's sub_agents array. agentRouter.SetValidated resolves
the target through team.Agent(name), which scans every agent in the
team (pkg/team/team.go), not just the current agent's sub_agents; the
schema's CommandConfig.agent doc confirms this ('must be defined in the
team configuration'). Correct the docs to match.
Named Commands only showed ${args.join(" ")} in examples without
explaining the other supported forms. Add a concise list covering
positional args, joined args, template tool-call expansion, and the
legacy !tool_name() form, verified against pkg/runtime/commands.go
and pkg/js/eval_test.go.
Sayt-0
approved these changes
Jul 16, 2026
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.
What
Fixes two pre-existing factual errors in the "Named Commands" section of
docs/configuration/agents/index.md:$1/$2placeholders with the actually-supported forms:${args[0]},${args.join(" ")},${tool_name({...})}, and the legacy!tool_name(key=value)form. Adds a concise "Argument and expansion syntax" explanation.sub_agents; the target can be any agent defined in the team.Notes
Docs-only. Verified against
pkg/runtime/commands.go,pkg/runtime/agent_router.go,pkg/team/team.go,agent-schema.json, and the runtime/js tests. Passes canonical check + markdownlint.Note
This PR (#3684) and #3683 both touch
docs/configuration/agents/index.md. Whichever merges second will need a trivial rebase.