Skip to content

mcp: algorithm_spec placeholder refusal still names CLI --model/--base-url and says to edit the spec #1319

Done

Description

@Birfy

What happens

On tip fb519a67 (after #1318), MCP describe_algorithm / list_algorithms already name algorithm_spec with model and base_url, and a successful algorithm_spec (those fields passed) already points next at plan(..., probe=true) and a capped start. #1317 also rewrites one different shared error phrase (re-run init / \algorithms run` with `--model` / `--base-url``) into tool language.

The leftover a host actually reads is the placeholder refusal from algorithm_spec itself, when model / base_url were omitted. That path still speaks CLI, and its next does not name the repair the tool already accepts.

Measured over the stdio MCP server (python -m agentdescent.cli mcp), algorithm_spec on a 12-task text fixture, rounds=1, workers=1, no model / base_url:

ok: false
warnings:
  `agent.model` and `agent.default_base_url` in <spec> are placeholders: ...
  Fill them in, or re-run with `--model` / `--base-url`; `plan` refuses the spec until then
error:
  agent.model is still the placeholder '<your-model>' that `init` wrote; ...
  agent.default_base_url is still the placeholder '<your-endpoint-url>' that `init` wrote; ...
next:
  fix the written spec, then call plan with that spec and probe=true; if that refuses, follow its next and do not start

A host following warnings is sent to CLI flags it may not have. A host following next is told to hand-edit the written spec and then plan, not to re-call algorithm_spec with model and base_url (never guess those). The error also attributes the placeholders to init, which this tool is not.

_mcp_gate_wording (#1317) does not catch this: it only rewrites error (not warnings or next), and only the exact bare-OpenCode phrase, not _starter_model_warnings's re-run with \--model` / `--base-url`or_placeholder_messages's that `init` wrote`.

The same call with model and base_url is ok: true and next is already in tool language (call plan with \spec` and probe=true…call start with `spec` and max_calls=19`). The gap is only the placeholder refusal.

Repro

Fresh clone of ThinkFlowLab/agentdescent at fb519a67b89ecaf486974534c30725504ed48e4e. pip install -e ".[mcp]". No provider key is required.

agentdescent demo --kind text --dir ./demo-text

Then, over MCP stdio (or from agentdescent.mcp import Tools):

# Tools(...).algorithm_spec(
#     name="gepa",
#     path="./demo-text/prompt.txt",
#     cases="./demo-text/cases.jsonl",
#     rounds=1, workers=1,
#     out="./gepa.spec.json",
#     # model / base_url omitted
# )
# warnings contain: re-run with `--model` / `--base-url`
# error contains: that `init` wrote
# next: "fix the written spec, then call plan ... probe=true"

By contrast, describe_algorithm("gepa")["run"] already says call algorithm_spec with name=gepa, path=<your-prompt.txt>, cases=<your-cases.jsonl>, and model and base_url (never guess those).

The CLI algorithms run wording on the same omission stays correct for an operator who has the CLI (re-run with \--model` / `--base-url``).

Expected

  • MCP algorithm_spec placeholder refusals in warnings, error, and next name Path A fields (algorithm_spec with model and base_url), not CLI --model / --base-url, and not init.
  • next tells the host to re-call algorithm_spec with model and base_url (never guess those), and not to start; it does not say "fix the written spec, then call plan".
  • The CLI algorithms run / init warning and next are unchanged.

Suggested fix

  • In Tools.algorithm_spec, rewrite placeholder warnings / error / next into the tool language above (extend _mcp_gate_wording and also apply it to warnings, and replace the failed-plan next when the failure is still-unfilled placeholders). Do not change cli.py (those strings are still correct for the CLI).
  • Pin this in a focused MCP test beside tests/test_mcp_plan_start_wording.py.
  • changelog.d/<n>-mcp-algorithm-spec-placeholder-wording.md.

Acceptance

  • MCP algorithm_spec without model / base_url on a valid text fixture: ok is false; warnings and error contain algorithm_spec and model / base_url as tool fields; they do not contain --model, --base-url, or `init`; next names re-calling algorithm_spec with model and base_url and does not say to edit the spec and then plan.
  • The same call with model and base_url is unchanged (ok: true, next still names plan with probe=true and a capped start).
  • CLI algorithms run … --json without --model / --base-url still contains re-run with \--model` / `--base-url``.
  • pytest -q -o addopts='' tests/test_mcp_plan_start_wording.py tests/test_mcp_algorithm_spec.py tests/test_mcp.py passes, including the new pins.

Activity

  1. added
    bug
    area:plugins
    area:cli
    on Nov 30, 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