Repository navigation
Description
What happens
On tip 23b1b1eb (0.11.0, after #1294), the MCP form of algorithms run tells a host to start a paid run without a probe and without a per-call cap.
agentdescent algorithms run NAME PATH CASES --model … --base-url … already plans and then prints:
next: agentdescent plan <spec> --probe, then agentdescent evolve <spec> --max-calls 19
MCP algorithm_spec is documented as the same verb. After a successful call it returns the estimate (agent_calls_upper_bound: 19 on the same 12-case, 1×1 trial) but its next is:
show the user this estimate; after their yes, call start with `spec`
There is no plan(spec, probe=true) step, and start is not told to pass max_calls from that estimate. A host that follows the tool's own next — rather than the skill / slash-command prose — will start the run unprobed and uncapped. SKILL.md and the Claude/Codex/OpenCode algorithms.md / evolve.md commands already say the opposite: run plan with probe=true, do not start if it refuses, and pass max_calls.
A related gap on the same Path A surface: MCP plan(spec) with the default probe=false returns ok: true and no next field at all. The CLI counterpart, a bare agentdescent plan <spec>, does name plan --probe, then evolve --max-calls N. So the MCP plan/start path does not carry the preflight and cap that #1218 put on the CLI plan next line.
This is the same leftover-surface class as #1201 / #1228 / #1217, now for algorithm_spec.next (and the silent MCP plan success).
Repro
Fresh clone of ThinkFlowLab/agentdescent at 23b1b1eb. pip install -e ".[mcp]". Isolated AGENTDESCENT_HOME. Same 12-case text fixture as demo --kind text.
CLI control (works):
agentdescent algorithms run gepa ./prompt.txt ./cases.jsonl \
--model deepseek-v4-flash \
--base-url https://ark.cn-beijing.volces.com/api/coding/v3 \
--rounds 1 --workers 1 --out spec.json --json
# "next": "agentdescent plan …/spec.json --probe, then agentdescent evolve …/spec.json --max-calls 19"MCP (measured with a stdio Path A client):
algorithm_spec({
name: "gepa",
path: "<abs>/prompt.txt",
cases: "<abs>/cases.jsonl",
model: "deepseek-v4-flash",
base_url: "https://ark.cn-beijing.volces.com/api/coding/v3",
rounds: 1,
workers: 1
})
# ok: true
# estimate.agent_calls_upper_bound: 19
# next: "show the user this estimate; after their yes, call start with `spec`"
# no ready, no probe, no max_calls in next
plan({spec}) # probe omitted / false
# ok: true, no "next" key, no ready
plan({spec, probe: true}) # only if a live key is present; a refusal is already correct
# ok: false, ready: false, next: <repair>
The success next is hardcoded in agentdescent/mcp.py (algorithm_spec):
result["next"] = ("show the user this estimate; after their yes, call "
"start with `spec`")Expected
- A successful
algorithm_specshould tell the host the same two first-run steps the CLI already prints: show the estimate; after yes,plan(spec, probe=true); if that refuses, follow itsnextand do notstart; otherwisestartwithspecandmax_callsequal toestimate.agent_calls_upper_bound(or a smaller trial cap). - A successful MCP
planwithprobe=falseshould carry anextthat namesplan(spec, probe=true)and a cappedstart, matching the CLIplannext line. A refused probe is alreadyok: false/ready: false/ repairnext— leave that contract alone. - No model name is guessed.
algorithm_specstill does not have to probe itself (same as CLIalgorithms runwithout--probe).
Suggested fix
- Change the
algorithm_specsuccessnextinagentdescent/mcp.pyto nameplan(..., probe=true)andstart(..., max_calls=<upper bound>). - Give a successful MCP
plan(no probe) anextin the same shape, so a host that calledplandirectly is not left without a next step. - Extend the MCP / first-run tests that pin
algorithm_spec/planpayloads. changelog.d/<n>-mcp-algorithm-spec-next.md.
No change to the probe-refusal contract (ok: false, ready: false). No change to the placeholder-refusal behaviour of init / algorithms run / plan.
Acceptance
- MCP
algorithm_specon a plan-ready target returns anextthat includesplanwithprobe=trueandstartwithmax_calls(the estimate'sagent_calls_upper_bound, or a clearly marked placeholder only if no estimate exists). - MCP
plan(spec)withoutprobereturns anextthat names a probe and a cappedstart. - A refused
plan(..., probe=true)is stillok: false/ready: falsewith a repairnext, notstart. - CLI
algorithms run --jsonis unchanged (plan --probe, thenevolve --max-calls N). - Tests pin the new strings.
Activity
fix(mcp): algorithm_spec failed-plan next names plan(probe=true) (#1306)
fix(mcp): demo next names Path A tools, not CLI verbs (#1308)
fix(mcp): plan probe refusal next names tools, not CLI verbs (#1310)