Skip to content

mcp: plan(probe=true) success has no next, unlike plan --probe #1303

Done

Description

@Birfy

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, next should name only the capped start: call start with spec and max_calls=N, where N is estimate.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, repair next, no start).
  • A successful MCP plan without probe still names plan(spec, probe=true) and then the capped start.
  • MCP algorithm_spec and the CLI plan / algorithms run next lines are unchanged.

Suggested fix

  • In agentdescent/mcp.py (_with_probe or _first_run_next), when the probe ran and succeeded, set payload["next"] to the already-probed form of _first_run_next (capped start only), matching how cmd_plan uses _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 next in the plan tool 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 returns ok: true, ready: true, and next equal to call start with spec and max_calls=<upper bound> (or max_calls=<N> only if no estimate exists), with no probe=true in that string.
  • MCP plan(spec) without probe still names probe=true and a capped start.
  • A refused plan(..., probe=true) is still ok: false / ready: false with a repair next, not start.
  • CLI plan --probe / algorithms run next 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.py passes, including the new pins.

Activity

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