Repository navigation
feat(mcp): let the plan tool run the preflight probe (#1094) - #1170
Conversation
Red first: on f8efc73 Tools.plan() has no probe parameter (TypeError) and every generated SKILL.md has zero occurrences of "probe". The default-path row pins the old key set so adding the parameter cannot change what plain plan returns.
A host driving the MCP server could only call plan, which runs nothing, so an expired subscription surfaced after start as a failed run. plan now takes probe: bool = False and, when true, returns the same probe_payload rows the CLI's plan --probe prints; a refusal makes the result ok=false and points next at the repair action, never at start. The helper that picks that sentence moves to probe.py so both surfaces share one source, and the shared host SKILL.md teaches the probe step on a first model. Default plan is unchanged.
|
Tip SHA: Base: Ran — fresh clone at this sha,
Independently, with my own stub server and my own 8-task spec (
Not run:
No UI surface: one MCP tool argument and its JSON payload, plus docs and host-skill text; nothing is rendered, so no screenshot applies. Non-blocking:
Verdict: PASS — advisory QA verdict at |
|
Fresh clone at the named sha ( Contract. Default path unchanged. Generated artefacts are exact, not just "regenerated". Tests and gates. At the tip: Non-blocking — MCP refusal wording ( Non-blocking — docs ( Not run: Merge path: the owner's PASS at this tip and the explicit click; nothing here approves or merges. |
|
Advisory read at T3 by path ( Tip SHA: b7dfd33
Findings:
No UI surface: an MCP tool argument plus plugin docs; nothing rendered changes. |
|
Self-review (Birfy) Tip SHA: b7dfd33
|
Fixes #1094
What changed
The CLI has had
plan --probesince #1048, but a host driving the MCP server could only callplan, which runs nothing: an expired subscription or a wrong model name surfaced only afterstart, as a failed run. This gives the tool the same preflight and teaches every installed host to ask for it.agentdescent/mcp.py:Tools.plan(spec, usd_per_call=None, budget_usd=None, probe: bool = False)(line 665) and the registeredplanwrapper (line 1389) takeprobe. When true_with_probe(line 405) addsprobe: the sameprobe_payload(spec)object the CLI prints. A refusal setsok: falseandnextto the repair action, never tostart.agentdescent/probe.py:first_failed_next()(line 157) moves here fromcli.py(_first_failed_probe_next), so the CLI (cli.py:58, call sites 2577/4835) and the tool pick a refusal'snextfrom one place.agentdescent/integrations/SKILL.md(line 143): theplanstep now says to run the first use of a model/endpoint with the probe on (plan --probe, MCPplan(spec, probe=true)), and that a refusal'snextgoes to the user with nostart.docs/plugins.md(line 248 flow, line 261 bullet): the Path A flow and theplanbullet describe the probe on both surfaces.integrations/claude-code/skills/agentdescent/SKILL.mdandintegrations/dsh-agentdescent/lib/index.js;changelog.d/1094-mcp-plan-probe.md.Out of scope: no second probe implementation in
mcp.py, no MCP tool wrapsalgorithms run(none exists —algorithm_specwrites a spec).Red first (at
f8efc731, onlytests/test_mcp_plan_probe.pyswapped in)3 failed, 1 passed. The pass is the default-path row (test_omitting_the_probe_returns_exactly_the_old_payload), which pins the 9-key payload so the new parameter cannot change what a plainplanreturns.Verification
Tip SHA: b7dfd33
Ran:
pytest -q tests/test_mcp_plan_probe.py→4 passedtests/test_mcp.py tests/test_mcp_meta.py tests/test_api_docs.py tests/test_mcp_plan_probe.py tests/test_plan_probe.py tests/test_integrations.py→181 passed, 8 skippedpython3 -m tools.gen_api_docs --check→docs/api.md is up to datepython3 -m tools.changelog_fragments check→81 changelog fragment(s) OKplantool schema at the tip, read through the SDK (installed on this box) —probeis in it:probe0 times atf8efc731.Not run:
pytest -q— stopped at 73%; CI's fivetest (3.9–3.13)legs are the gate.mkdocs build --strict— did not complete on this box:fonts.google.comconnect timeout. CIbuildis the line.Acceptance rows (where they are implemented / pinned):
InvalidSubscriptionstub →ok is False,probe.ok is False,nexthas nostartmcp.py:405+probe.py:157; test attest_mcp_plan_probe.py:105probe.ok is True, planokstays truemcp.py:405; test attest_mcp_plan_probe.py:116probeomitted → payload key set unchanged (9 keys, baseline captured atf8efc731)test_mcp_plan_probe.py:41,125host_statusokintegrations/SKILL.md:143; test attest_mcp_plan_probe.py:131tests/test_plan_probe.pystill green (CLI side of #1048)No UI surface: one MCP tool argument plus its JSON payload and the docs/host-skill text; nothing is rendered.