Skip to content

mcp: algorithm_spec worker-selection notes/warnings still name CLI --agent / agentdescent doctor #1325

Done

Description

@Birfy

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_spec success-path notes for an auto-picked worker name the Path A field agent (re-call algorithm_spec with agent), not CLI --agent.
  • MCP algorithm_spec no-worker-CLI warnings name doctor and agent, not agentdescent doctor / --agent.
  • The CLI init / algorithms run wording is unchanged (--agent <ref>, agentdescent doctor).

Suggested fix

  • On the MCP path only: run _mcp_gate_wording over algorithm_spec's notes (it already covers error / warnings / next). Extend _mcp_gate_wording with the two leftover phrases. Do not change cli.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_spec on evoskill / a skill_dir (model and base_url filled): notes contain agent as a field/tool argument and do not contain --agent.
  • With no worker CLI on PATH, the same call's warnings contain doctor and do not contain agentdescent doctor or --agent.
  • CLI init <skill> --algorithm evoskill --model … --base-url … --json still contains override with \--agent ``.
  • CLI init / algorithms run with no worker CLI on PATH still contains Run \agentdescent doctor`and--agent `.

Activity

  1. added
    bug
    area:plugins
    area:cli
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliarea:pluginsbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions