Skip to content

mcp: plan and start refusals still say see agentdescent doctor #1317

Done

Description

@Birfy

What happens

On tip ca769cfb (after #1316), MCP demo / plan (next after a probe) / algorithm_spec / diagnose / describe_algorithm / apply / show already rewrite host-facing next, recommendations, card run, and apply/show refusals into Path A tool language. MCP plan, start, resume, and algorithm_spec still return the shared CLI wording in error when a worker CLI is missing or a spent-quota resume is refused, so a host is told a CLI verb or flag it may not have.

Two leftovers a host actually reads:

  1. A missing worker CLI. _missing_cli_messages (shared with the CLI, used by plan_payload and require_cli_on_path) ends every remedy with:
see `agentdescent doctor`

MCP plan / start (and algorithm_spec when the written spec then fails plan, and resume when a plugin host is missing) surface that string unchanged. Path A already has a doctor tool.

  1. MCP resume of a run whose last failure was QuotaExhausted (or SubscriptionInactive). The shared refusal names the CLI flag:
pass --force to retry now

The resume tool already documents force=true. The CLI resume wording stays correct for an operator who has the CLI.

A third leftover in the same error field: a bare isolated opencode plus a gateway key says re-run init / \algorithms run` with `--model` / `--base-url`. Path A builds that spec with algorithm_specand the fieldsmodelandbase_url`.

The same leftover-surface class as #1307 / #1309 / #1311 / #1313 / #1315, now for plan/start/resume/algorithm_spec error strings.

Repro

Fresh clone of ThinkFlowLab/agentdescent at ca769cfb5fc38c8847c2f2e5a6d81d698ed39826. pip install -e ".[mcp]". No provider key is required.

from agentdescent import cli
from agentdescent.mcp import Tools
from tests.test_missing_cli_kind_remedy import _clis, _skill_spec

# With no worker CLI on PATH (see the test helper):
# msgs = cli._missing_cli_messages(spec)
#   "... see `agentdescent doctor`"
# Tools(...).plan(spec.to_dict())["error"]  # same string today
# Tools(...).start(spec.to_dict())["error"]  # same string today

# Tools.resume of a QuotaExhausted run:
#   "... pass --force to retry now"

By contrast, MCP plan(probe=true) already says call doctor, not agentdescent doctor, and the resume tool description already says force=true.

Expected

  • MCP plan / start / algorithm_spec / resume refusals in error name Path A tools and fields (doctor, algorithm_spec with model and base_url, force=true, kind), not agentdescent doctor, not init / algorithms run with --model / --base-url, not --force, and not --kind.
  • A missing-CLI MCP plan or start error contains doctor and does not contain agentdescent doctor.
  • MCP resume of a QuotaExhausted run names force=true and does not contain --force.
  • The CLI plan / evolve / resume / algorithms run wording is unchanged, including see \agentdescent doctor`andpass --force`.

Suggested fix

  • In agentdescent/mcp.py (Tools.plan, Tools.start, Tools.resume, Tools.algorithm_spec), rewrite the returned error string into the tool language above. Do not change cli.py (those strings are still correct for the CLI).
  • Mention the tool-language refusals in the plan, start, and resume tool descriptions.
  • Pin this in a focused MCP test (keep the CLI pins in tests/test_missing_cli_kind_remedy.py and tests/test_resume_quota_exhausted.py).
  • changelog.d/<n>-mcp-plan-start-wording.md.

Acceptance

  • MCP plan / start on a directory-kind spec whose worker CLI is missing: error contains doctor and not agentdescent doctor.
  • CLI plan --json / _missing_cli_messages on the same spec still contains see \agentdescent doctor``.
  • MCP resume of a QuotaExhausted run: error contains force=true and not --force.
  • CLI resume of the same run still contains --force.
  • pytest -q -o addopts='' tests/test_mcp_plan_start_wording.py tests/test_missing_cli_kind_remedy.py tests/test_resume_quota_exhausted.py tests/test_mcp_plan_probe.py tests/test_mcp.py passes, including the new pins.

Activity

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