Repository navigation
Description
What happens
On tip 500cdc9b83 (after #1324), MCP algorithm_spec already rewrites error, warnings, and next through _mcp_gate_wording for placeholders, kind flags, and see \agentdescent doctor`. The leftover a host actually reads is the shared init reporter's **worker-selection** copy, which still names CLI --agent/agentdescent doctor`.
algorithm_spec builds the spec via algorithms_run_payload (the same helper as init / algorithms run). That helper appends:
- a note when it auto-picks a worker CLI on PATH:
override with \--agent `` - a warning when no worker CLI is on PATH:
Run \agentdescent doctor`, install a CLI, or re-run with `--agent ` / edit `agent.ref` before `plan``
algorithm_spec does not run _mcp_gate_wording on notes, and _mcp_gate_wording does not rewrite those two strings anyway (it only catches see \agentdescent doctor`andor omit --agent for the default`). The CLI wording on the same inputs is correct for an operator who has the CLI.
Measured with from agentdescent.mcp import Tools on this tip, on a skill_dir evoskill card, with --model / --base-url filled so the call is otherwise ok or only refused for the missing CLI:
# opencode on PATH (success path; host reads notes):
# notes: ["agent: `opencode` (the worker CLI found on PATH; override with `--agent <ref>`)"]
# warnings: []
# next: already in tool language (plan(..., probe=true) then start with max_calls)
# PATH with claude / codex / dsh / opencode removed (failed plan; host reads warnings):
# warnings: ["no worker CLI (claude, codex, dsh, opencode) is on PATH; wrote the
# placeholder agent `claude_code`. Run `agentdescent doctor`, install a CLI,
# or re-run with `--agent <ref>` / edit `agent.ref` before `plan`"]
# error: already rewritten to "call `doctor`" (the refusal path is fine)
# next: already in tool language
algorithm_spec already has an agent field (and doctor is a Path A tool). A host following the note/warning is told to pass a CLI flag it cannot pass.
Expected
- MCP
algorithm_specsuccess-pathnotesfor an auto-picked worker name the Path A fieldagent(re-callalgorithm_specwithagent), not CLI--agent. - MCP
algorithm_specno-worker-CLIwarningsnamedoctorandagent, notagentdescent doctor/--agent. - The CLI
init/algorithms runwording is unchanged (--agent <ref>,agentdescent doctor).
Suggested fix
- On the MCP path only: run
_mcp_gate_wordingoveralgorithm_spec'snotes(it already coverserror/warnings/next). Extend_mcp_gate_wordingwith the two leftover phrases. Do not changecli.py. - Pin this in a focused MCP test beside
tests/test_mcp_algorithm_spec_placeholder_wording.py/tests/test_mcp_plan_start_wording.py. changelog.d/<n>-mcp-algorithm-spec-agent-wording.md.
Acceptance
- With a worker CLI on PATH, MCP
algorithm_specon evoskill / a skill_dir (model and base_url filled):notescontainagentas a field/tool argument and do not contain--agent. - With no worker CLI on PATH, the same call's
warningscontaindoctorand do not containagentdescent doctoror--agent. - CLI
init <skill> --algorithm evoskill --model … --base-url … --jsonstill containsoverride with \--agent ``. - CLI
init/algorithms runwith no worker CLI on PATH still containsRun \agentdescent doctor`and--agent `.
Activity