Skip to content

mcp: plan probe refusal next still names CLI doctor / plan --probe #1309

Done

Description

@Birfy

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's next) should be fix the hint in the error (model name, base URL, or API key variable) and call plan with \spec` and probe=true. It must not say plan --probeoragentdescent`.
  • After a generic probe refusal, next (and the failed row's next) should be call doctor, then call plan with \spec` and probe=true. It must not say agentdescent doctororplan --probe`.
  • Subscription / quota refusals stay on the shared tool-neutral sentences. ok: false and ready: false stay 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 --probe next stays 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), after first_failed_next, rewrite a sentence that names agentdescent doctor or plan --probe into the tool language above. Rewrite the failed row's next the same way so it cannot disagree with the payload next. Do not change probe.py (those strings are still correct for the CLI).
  • Mention the tool-language refusal next in the plan tool description.
  • Pin this in tests/test_mcp_plan_probe.py (keep the CLI pins in tests/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 returns ok: false, ready: false, and a next (and failed row next) that names plan with probe=true, with no agentdescent CLI verbs and no plan --probe.
  • MCP plan(..., probe=true) on a generic HTTP 500 fixture names doctor and plan with probe=true, not agentdescent doctor or plan --probe.
  • A subscription refusal still has the same ok / ready / next triple on both surfaces.
  • CLI plan --json --probe still uses re-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.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