Repository navigation
Description
What happens
On tip 37d03875 (after #1320), MCP describe_algorithm / list_algorithms already rewrite each card's run into algorithm_spec with model and base_url, and placeholder / plan / apply / diagnose refusals already speak Path A tools. The leftover a host actually reads is the name and kind refusal from describe_algorithm and algorithm_spec.
Those errors come from shared _unknown_algorithm_message / kind_mismatch_message (also used by algorithms show / run). MCP returns them almost unchanged, so a host is sent to a CLI it may not have.
Measured with from agentdescent.mcp import Tools on this tip:
Tools(None).describe_algorithm("nope")["error"]
# describe_algorithm: unknown algorithm 'nope'; available: […] (see `agentdescent algorithms list`)
Tools(None).algorithm_spec("nope", prompt)["error"]
# algorithm_spec: unknown algorithm 'nope'; available: […] (see `agentdescent algorithms list`)
# gepa (text-only) on a skill_dir that holds SKILL.md:
# algorithm 'gepa' applies to kind ['text'], not 'skill_dir'; …
# (agentdescent algorithms list --kind skill_dir);
# to run gepa on one file, target it as text:
# agentdescent algorithms run gepa …/SKILL.md --kind text --model <model> [--base-url <url>];
# … reuse the prompt-inlined cases `agentdescent demo --kind text --dir <dir>` writes
list_algorithms()["note"] also still says Filter with --kind / kind=.
_mcp_gate_wording (#1317 / #1319) does not catch these phrases.
The CLI algorithms show / run wording on the same inputs stays correct for an operator who has the CLI.
Expected
- MCP
describe_algorithm/algorithm_specunknown-name errors namelist_algorithms, notagentdescent algorithms list. - A kind-mismatch error names
list_algorithmswithkind=…when the kind is known, and (when a one-file text retry applies)algorithm_specwithkind=text,path,cases, andmodelandbase_url(never guess those), not CLIalgorithms run/init/demo --kind. list_algorithmsnotefilters with the Path A fieldkind, not CLI--kind.- The CLI
algorithms show/run/initwording is unchanged.
Suggested fix
- Rewrite the shared phrases on the MCP path only (
_mcp_algorithm_error_wording, applied fromdescribe_algorithm,algorithm_spec, and_mcp_gate_wording). Do not changealgorithms/__init__.pyorcli.py. - Pin this in a focused MCP test beside
tests/test_mcp_describe_run.py. changelog.d/<n>-mcp-algorithm-error-wording.md.
Acceptance
describe_algorithm("nope")andalgorithm_spec("nope", …)errors containcall list_algorithmsand do not containagentdescent algorithms list.algorithm_spec("gepa", skill_dir, …)errors containlist_algorithms with kind=skill_dirandalgorithm_specwithkind=text; they do not containagentdescent algorithms run,--model, oragentdescent demo.- CLI
algorithms show nope --jsonstill contains(see \agentdescent algorithms list`)`. - CLI
algorithms run gepa <skill_dir> … --jsonstill containsagentdescent algorithms list --kind skill_dirandagentdescent algorithms run.
Activity