Repository navigation
Description
What happens
On tip 521a879 (0.11.0, after #1302), a successful agentdescent plan --probe already drops the preflight from next and names only the capped evolve (#1217):
next: agentdescent evolve <spec> --max-calls N
--json next is the same string, and --probe is not in it.
MCP plan(spec, probe=true) is documented as the same preflight. After a refused probe it already matches the CLI (ok: false, ready: false, next is the repair, #1175). After a successful probe it returns ok: true and ready: true, but no next field at all.
plan_payload does not carry next. _with_probe only writes next on a refusal. So a host that just completed a successful probe is left without the capped start the CLI already names, and without the plan(spec, probe=true) plus capped start that an unprobed MCP plan has named since #1296 / #1298. Following the unprobed advice would probe a second time; starting without next can launch the run uncapped.
This is the same leftover-surface class as #1217 / #1296 / #1301, now for the success path of MCP plan(..., probe=true).
Repro
Fresh clone of ThinkFlowLab/agentdescent at 521a879. pip install -e ".[mcp]". Isolated AGENTDESCENT_HOME. A reachable OpenAI-compatible endpoint (or a stub that returns 200) is enough for the probe to succeed.
CLI control (works):
agentdescent plan spec.json --probe
# exit 0; probe ok
# next: agentdescent evolve spec.json --max-calls N
agentdescent plan spec.json --probe --json
# "next": "agentdescent evolve spec.json --max-calls N"MCP (same spec, probe=true):
plan({spec, probe: true}) # stub or live endpoint returns 200
# ok: true, ready: true, probe.ok: true
# no "next" key
By contrast, MCP plan({spec}) with probe omitted already returns:
next: "call plan with `spec` and probe=true; if that refuses, follow its next and do not start; otherwise call start with `spec` and max_calls=N"
Expected
- After MCP
plan(spec, probe=true)succeeds,nextshould name only the cappedstart:call start withspecand max_calls=N, whereNisestimate.agent_calls_upper_bound(or<N>if no bound is known). No model name is guessed. The host should not be told to probe again. - A refused probe on this tool stays as it is (
ok: false,ready: false, repairnext, nostart). - A successful MCP
planwithoutprobestill namesplan(spec, probe=true)and then the cappedstart. - MCP
algorithm_specand the CLIplan/algorithms runnext lines are unchanged.
Suggested fix
- In
agentdescent/mcp.py(_with_probeor_first_run_next), when the probe ran and succeeded, setpayload["next"]to the already-probed form of_first_run_next(cappedstartonly), matching howcmd_planuses_capped_evolve_next(..., already_probed=True). - Pin this in
tests/test_mcp_plan_probe.py. The existing unprobed-plan and refusal pins stay. - Mention the successful-probe
nextin theplantool description. changelog.d/<n>-mcp-plan-probe-next.md.
No change to the probe itself, or to the refusal contract.
Acceptance
- MCP
plan(spec, probe=true)that succeeds returnsok: true,ready: true, andnextequal tocall start withspecand max_calls=<upper bound>(ormax_calls=<N>only if no estimate exists), with noprobe=truein that string. - MCP
plan(spec)withoutprobestill namesprobe=trueand a cappedstart. - A refused
plan(..., probe=true)is stillok: false/ready: falsewith a repairnext, notstart. - CLI
plan --probe/algorithms runnext lines are unchanged. pytest -q -o addopts='' tests/test_mcp_plan_probe.py tests/test_mcp_algorithm_spec.py tests/test_plan_probe.py tests/test_first_run_caps.pypasses, including the new pins.
Activity
fix(mcp): demo next names Path A tools, not CLI verbs (#1308)
fix(mcp): plan probe refusal next names tools, not CLI verbs (#1310)