Repository navigation
Description
What happens
On tip c5de2343 (after #1310), MCP demo / plan / algorithm_spec already rewrite host-facing next into Path A tool language. MCP diagnose still returns the shared diagnose_payload recommendations untouched, so a host is told to run CLI verbs it may not have.
After MCP diagnose on a solved run, recommendations include:
review the diff: `agentdescent show <run_id>`
preview the write: `agentdescent apply <run_id> --dry-run`, then rerun it without --dry-run
Other verdicts leak the same way:
- cancelled:
agentdescent resume <run_id> - running:
agentdescent watch <run_id>, thenagentdescent diagnose <run_id>— and Path A has nowatchtool (the host should pollstatus, then calldiagnosewhen it ends) - run-failed (no log):
agentdescent show <run_id>; a generic failure also saysrun \agentdescent doctor` before retrying` - reflector-error:
(\agentdescent doctor`)` - partial-improvement:
agentdescent show <run_id> --json - unknown:
run \show --json``
This is the same leftover-surface class as #1307 / #1309, now for diagnose recommendations. The CLI diagnose / diagnose --json wording stays correct for an operator who has the CLI.
Repro
Fresh clone of ThinkFlowLab/agentdescent at c5de2343c6956cd909b6708d742e8b758ef3442d. pip install -e ".[mcp]". No provider key is required; show_payload can be stubbed.
from agentdescent.mcp import Tools
from agentdescent.diagnose import diagnose_payload
# Tools.diagnose currently returns diagnose_payload(...).to_dict() unchanged
r = Tools(store).diagnose(run_id)
# solved: "agentdescent show" / "agentdescent apply … --dry-run" in r["recommendations"]
# running: "agentdescent watch" in r["recommendations"]
# CLI diagnose --json still names those same CLI verbs, which is intendedBy contrast, MCP demo already says call show with this run_id and call apply with this run_id and dry_run=true, not agentdescent show / apply --dry-run.
Expected
- After MCP
diagnose,recommendationsname Path A tools (show,applywithdry_run=true,resume,status,doctor,plan,diagnose), notagentdescent …CLI verbs, and not--dry-run/watch. - A still-running run's recommendations tell the host to poll
status, then calldiagnosewhen it ends. They must not namewatch. - Verdict, summary, and evidence stay the same as the shared payload.
run_idmay still belatest/laston the way in; recommendations that need an id use the resolved one, as today, without echoinglatest. - The CLI
diagnose/diagnose --jsonrecommendations stay on the CLI verbs (agentdescent show,apply --dry-run,resume,watch,doctor). - No model name is guessed. The tool still does not start, apply, or resume a run by itself.
Suggested fix
- In
agentdescent/mcp.py(Tools.diagnose), afterdiagnose_payload(…).to_dict(), rewriterecommendationsinto the tool language above. Do not changediagnose.py(those strings are still correct for the CLI). - Mention the tool-language recommendations in the
diagnosetool description. - Pin this in a focused MCP test (keep the CLI pins in
tests/test_diagnose.py). changelog.d/<n>-mcp-diagnose-recommendations.md.
Acceptance
- MCP
diagnoseon a solved stub returns recommendations that nameshowandapplywithdry_run=true, with noagentdescentand no--dry-run. - MCP
diagnoseon a running stub namesstatusanddiagnose, notwatch. - MCP
diagnoseon cancelled / run-failed / reflector-error / partial-improvement / unknown stubs names the matching Path A tools (resume,show,doctor,plan) and contains noagentdescentCLI verbs. - CLI
diagnose --jsonstill usesagentdescent show/apply --dry-run/resume/watch/doctor. pytest -q -o addopts='' tests/test_mcp_diagnose.py tests/test_diagnose.py tests/test_mcp.pypasses, including the new pins.
Activity