Repository navigation
Description
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:
- A missing worker CLI.
_missing_cli_messages(shared with the CLI, used byplan_payloadandrequire_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.
- MCP
resumeof a run whose last failure wasQuotaExhausted(orSubscriptionInactive). 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/resumerefusals inerrorname Path A tools and fields (doctor,algorithm_specwithmodelandbase_url,force=true,kind), notagentdescent doctor, notinit/algorithms runwith--model/--base-url, not--force, and not--kind. - A missing-CLI MCP
planorstarterrorcontainsdoctorand does not containagentdescent doctor. - MCP
resumeof aQuotaExhaustedrun namesforce=trueand does not contain--force. - The CLI
plan/evolve/resume/algorithms runwording is unchanged, includingsee \agentdescent doctor`andpass --force`.
Suggested fix
- In
agentdescent/mcp.py(Tools.plan,Tools.start,Tools.resume,Tools.algorithm_spec), rewrite the returnederrorstring into the tool language above. Do not changecli.py(those strings are still correct for the CLI). - Mention the tool-language refusals in the
plan,start, andresumetool descriptions. - Pin this in a focused MCP test (keep the CLI pins in
tests/test_missing_cli_kind_remedy.pyandtests/test_resume_quota_exhausted.py). changelog.d/<n>-mcp-plan-start-wording.md.
Acceptance
- MCP
plan/starton a directory-kind spec whose worker CLI is missing:errorcontainsdoctorand notagentdescent doctor. - CLI
plan --json/_missing_cli_messageson the same spec still containssee \agentdescent doctor``. - MCP
resumeof aQuotaExhaustedrun:errorcontainsforce=trueand not--force. - CLI
resumeof 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.pypasses, including the new pins.
Activity
fix(mcp): algorithm_spec placeholder refusals name tools, not CLI (#1320