Skip to content

cli: algorithms run failed-plan next still says plan <spec>, omitting --probe #1299

Done

Description

@Birfy

What happens

On tip b5980f8b (0.11.0, after #1298), a failed agentdescent algorithms run still tells the user to re-plan without --probe.

A successful algorithms run already prints:

next: agentdescent plan <spec> --probe, then agentdescent evolve <spec> --max-calls N

init, a successful plan, the demo footers, and the first-run docs all name that same preflight. But when algorithms run writes a spec and plan refuses it (too few tasks, a missing cases path, leftover placeholders), both the human line and --json next drop --probe:

next: fix <spec>, then agentdescent plan <spec>
"next": "agentdescent plan <spec>"

Following that retry skips the preflight every other first-run surface has been teaching since #1218 / #1232: a dead key, endpoint, model or subscription is only found inside a later evolve (or never, if the user also skips --max-calls). The retry is hardcoded in agentdescent/cli.py as retry_line = f"agentdescent plan {out}". MCP algorithm_spec uses the same payload and only rewrites next on success, so a failed call returns the same short CLI line.

This is the same leftover-surface class as #1295 / #1201, now for the failed-plan path of algorithms run.

Repro

Fresh clone of ThinkFlowLab/agentdescent at b5980f8b. pip install -e ".[mcp]". Isolated AGENTDESCENT_HOME so this does not touch a real host tree. A 1-case text fixture is enough (plan refuses fewer than 4 tasks).

agentdescent algorithms run gepa ./prompt.txt ./cases.jsonl --out spec.json \
  --model m --base-url https://example.test/v1
# exit 2; error: at least 4 tasks
# next: fix /abs/spec.json, then agentdescent plan /abs/spec.json

agentdescent algorithms run gepa ./prompt.txt ./cases.jsonl --out spec.json \
  --model m --base-url https://example.test/v1 --json
# "next": "agentdescent plan /abs/spec.json"

By contrast, the same command with enough cases already names the preflight and the cap.

Expected

  • After algorithms run writes a spec and plan refuses it, the human next: line and --json next should be fix <spec>, then agentdescent plan <spec> --probe / agentdescent plan <spec> --probe. No model name is guessed. The line still must not recommend evolve.
  • Pre-stage failures (unknown algorithm, kind mismatch) stay as they are; only the post-write retry line changes.
  • MCP algorithm_spec keeps inheriting that payload next on the failed path.

Suggested fix

  • In agentdescent/cli.py (algorithms_run_payload), set retry_line = f"agentdescent plan {out} --probe".
  • Update the pins in tests/test_cli_algorithms_run.py that currently expect the short form, and assert the short form is gone.
  • changelog.d/<n>-algorithms-run-retry-probe.md.

No change to the plan-refusal behaviour itself, and no change to the successful algorithms run / algorithm_spec next lines.

Acceptance

  • algorithms run that writes a spec and then fails plan prints next: fix <spec>, then agentdescent plan <spec> --probe, and --json next is agentdescent plan <spec> --probe.
  • The same --json next is what a failed MCP algorithm_spec returns.
  • pytest -q -o addopts='' tests/test_cli_algorithms_run.py tests/test_first_run_caps.py tests/test_mcp_algorithm_spec.py passes, including the updated pins.

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions