Repository navigation
Description
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-textThen, 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_specplaceholder refusals inwarnings,error, andnextname Path A fields (algorithm_specwithmodelandbase_url), not CLI--model/--base-url, and notinit. nexttells the host to re-callalgorithm_specwithmodelandbase_url(never guess those), and not to start; it does not say "fix the written spec, then call plan".- The CLI
algorithms run/initwarning andnextare unchanged.
Suggested fix
- In
Tools.algorithm_spec, rewrite placeholderwarnings/error/nextinto the tool language above (extend_mcp_gate_wordingand also apply it towarnings, and replace the failed-plannextwhen the failure is still-unfilled placeholders). Do not changecli.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_specwithoutmodel/base_urlon a valid text fixture:okis false;warningsanderrorcontainalgorithm_specandmodel/base_urlas tool fields; they do not contain--model,--base-url, or`init`;nextnames re-callingalgorithm_specwithmodelandbase_urland does not say to edit the spec and thenplan. - The same call with
modelandbase_urlis unchanged (ok: true,nextstill namesplanwithprobe=trueand a cappedstart). - CLI
algorithms run … --jsonwithout--model/--base-urlstill containsre-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.pypasses, including the new pins.
Activity
fix(mcp): placeholder error always names model and base_url