Repository navigation
Description
What happens
On tip 8062018 (after #1308), MCP plan already rewrites a successful probe=true next into a capped start (#1303), and a no-probe success already names plan(..., probe=true) then that start (#1296). A refused probe still returns the shared CLI repair sentence untouched.
After MCP plan(spec, probe=true) hits a ProviderConfigError (for example an endpoint that does not serve the named model), next is:
fix the hint in the error (model name, base URL, or API key variable) and re-run plan --probe
After a generic probe failure (for example HTTP 500), next is:
run `agentdescent doctor`, then re-run plan --probe
The same leftover is on each failed probe.rows[].next. ok / ready are correctly false (#1175), and a subscription or quota refusal is already tool-neutral (renew the subscription…), so those stay shared. A host that followed algorithm_spec or a no-probe plan next would call plan(..., probe=true); when that refuses for a config or generic error, it is told to run CLI verbs it may not have (plan --probe, agentdescent doctor) instead of doctor and plan(..., probe=true).
This is the same leftover-surface class as #1296 / #1303 / #1305 / #1307, now for a refused MCP plan probe. Success already diverged into each surface's verb (#1303); this is the matching failure leftover.
Repro
Fresh clone of ThinkFlowLab/agentdescent at 80620182aaca39297ffb0a7be0147f3d3214f553. pip install -e ".[mcp]". Isolated AGENTDESCENT_HOME. The probe talks to a local HTTP fixture; no provider key is required.
# endpoint returns HTTP 404 UnsupportedModel, or HTTP 500, with FAKE_KEY / FAKE_BASE_URL
from agentdescent.mcp import Tools
r = Tools(store).plan(spec, probe=True)
# r["ok"] is False, r["ready"] is False
# unsupported model: r["next"] ends with "re-run plan --probe"
# generic 500: r["next"] == "run `agentdescent doctor`, then re-run plan --probe"By contrast, a successful MCP plan(..., probe=true) already returns call start with \spec` and max_calls=N, not agentdescent evolve`.
Expected
- After MCP
plan(..., probe=true)is refused for a ProviderConfigError,next(and the failed row'snext) should befix the hint in the error (model name, base URL, or API key variable) and call plan with \spec` and probe=true. It must not sayplan --probeoragentdescent`. - After a generic probe refusal,
next(and the failed row'snext) should becall doctor, then call plan with \spec` and probe=true. It must not sayagentdescent doctororplan --probe`. - Subscription / quota refusals stay on the shared tool-neutral sentences.
ok: falseandready: falsestay the same contract on both surfaces (mcp/cli: a refused --probe reports ok:true+ready:false on the CLI but ok:false and no ready over MCP plan #1175). - The CLI
plan --probe/plan --json --probenextstays on the CLI verbs (re-run plan --probe,run \agentdescent doctor``). - No model name is guessed. The tool still does not start a run.
Suggested fix
- In
agentdescent/mcp.py(_with_probe), afterfirst_failed_next, rewrite a sentence that namesagentdescent doctororplan --probeinto the tool language above. Rewrite the failed row'snextthe same way so it cannot disagree with the payloadnext. Do not changeprobe.py(those strings are still correct for the CLI). - Mention the tool-language refusal
nextin theplantool description. - Pin this in
tests/test_mcp_plan_probe.py(keep the CLI pins intests/test_plan_probe.py; keep the mcp/cli: a refused --probe reports ok:true+ready:false on the CLI but ok:false and no ready over MCP plan #1175 subscription identity test). changelog.d/<n>-mcp-plan-probe-failed-next.md.
Acceptance
- MCP
plan(..., probe=true)on an unsupported-model fixture returnsok: false,ready: false, and anext(and failed rownext) that namesplanwithprobe=true, with noagentdescentCLI verbs and noplan --probe. - MCP
plan(..., probe=true)on a generic HTTP 500 fixture namesdoctorandplanwithprobe=true, notagentdescent doctororplan --probe. - A subscription refusal still has the same
ok/ready/nexttriple on both surfaces. - CLI
plan --json --probestill usesre-run plan --probe/run \agentdescent doctor``. pytest -q -o addopts='' tests/test_mcp_plan_probe.py tests/test_plan_probe.py tests/test_mcp.py tests/test_mcp_algorithm_spec.py tests/test_first_run_caps.pypasses, including the new pins.
Activity