Skip to content

fix(mcp): algorithm_spec failed-plan next names plan(probe=true) - #1306

Merged
Birfy merged 1 commit into
mainfrom
fix/1305-mcp-algorithm-spec-failed-next
Nov 28, 2026
Merged

Birfy merged 1 commit into
mainfrom
fix/1305-mcp-algorithm-spec-failed-next

Conversation

@Birfy

@Birfy Birfy commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

Closes #1305

Base: f0edb1e
Tip SHA: 5e40eb8

What changed

On tip f0edb1e, a successful MCP algorithm_spec already rewrites next into host tool language (#1296 / #1298):

next: show the user this estimate; after their yes, call plan with `spec` and probe=true; if that refuses, follow its next and do not start; otherwise call start with `spec` and max_calls=N

When the written spec then failed to plan (missing cases path, too few tasks, and the other algorithms_run_payload failure paths that return next), the tool left the CLI retry untouched:

next: agentdescent plan <spec_path> --probe

A host that followed the success-path next would call the plan tool; a host that followed this failed-path next was told to run a CLI verb it may not have.

A failed-plan algorithm_spec now returns:

next: fix the written spec, then call plan with that spec and probe=true; if that refuses, follow its next and do not start

The algorithm_spec tool description mentions this failed-plan next. No model name is guessed. The tool still does not start a run or probe. A successful algorithm_spec next and the CLI algorithms run failed-plan next are unchanged.

changelog.d/1305-mcp-algorithm-spec-failed-next.md.

Verification

Tip SHA: 5e40eb8

Ran:

  • pytest -q -o addopts='' tests/test_mcp_algorithm_spec.py tests/test_mcp_algorithm_spec_default_out.py tests/test_mcp_algorithm_spec_target_dir.py tests/test_mcp_plan_probe.py tests/test_cli_algorithms_run.py tests/test_mcp.py tests/test_first_run_caps.py tests/test_plan_probe.py → 144 passed
  • python -m tools.changelog_fragments check → 58 changelog fragment(s) OK
  • python -m tools.gen_api_docs --check → docs/api.md is up to date
    Not run:
  • Full offline suite locally — the CI test matrix is the line

Closes #1305

Base: f0edb1e
Tip SHA: c9549894a3e5c3f305765f09bbb31d5479c59578

## What changed

On tip `f0edb1e`, a successful MCP `algorithm_spec` already rewrites
`next` into host tool language (#1296 / #1298):

```
next: show the user this estimate; after their yes, call plan with `spec` and probe=true; if that refuses, follow its next and do not start; otherwise call start with `spec` and max_calls=N
```

When the written spec then failed to plan (missing `cases` path, too few
tasks, and the other `algorithms_run_payload` failure paths that return
`next`), the tool left the CLI retry untouched:

```
next: agentdescent plan <spec_path> --probe
```

A host that followed the success-path `next` would call the `plan` tool;
a host that followed this failed-path `next` was told to run a CLI verb
it may not have.

A failed-plan `algorithm_spec` now returns:

```
next: fix the written spec, then call plan with that spec and probe=true; if that refuses, follow its next and do not start
```

The `algorithm_spec` tool description mentions this failed-plan `next`.
No model name is guessed. The tool still does not start a run or probe.
A successful `algorithm_spec` next and the CLI `algorithms run`
failed-plan next are unchanged.

`changelog.d/1305-mcp-algorithm-spec-failed-next.md`.

## Verification

Ran:
- `pytest -q -o addopts='' tests/test_mcp_algorithm_spec.py tests/test_mcp_algorithm_spec_default_out.py tests/test_mcp_algorithm_spec_target_dir.py tests/test_mcp_plan_probe.py tests/test_cli_algorithms_run.py tests/test_mcp.py tests/test_first_run_caps.py tests/test_plan_probe.py` → 144 passed
- `python -m tools.changelog_fragments check` → 58 changelog fragment(s) OK
- `python -m tools.gen_api_docs --check` → docs/api.md is up to date
Not run:
- Full offline suite locally — the CI test matrix is the line
@github-actions github-actions Bot added the risk:T2 Risk tier T2 (package code or an unnamed path), set by the controller from the diff label Nov 28, 2026
@Birfy

Birfy commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator Author

Review (Birfy)

Tip SHA: 5e40eb8
Ran:

  • .github/scripts/risk_gate.py --repo ThinkFlowLab/agentdescent --pr 1306 → T2 (package MCP next-line plus tests and the changelog fragment)
  • pytest -q -o addopts='' tests/test_mcp_algorithm_spec.py tests/test_mcp_algorithm_spec_default_out.py tests/test_mcp_algorithm_spec_target_dir.py tests/test_mcp_plan_probe.py tests/test_cli_algorithms_run.py tests/test_mcp.py tests/test_first_run_caps.py tests/test_plan_probe.py at this tip → 144 passed
  • python -m tools.changelog_fragments check → 58 changelog fragment(s) OK
  • python -m tools.gen_api_docs --check → docs/api.md is up to date
    Not run:
  • Full offline suite locally — the CI test matrix on this tip is the line
    Findings:
  • No actionable defects. When MCP algorithm_spec writes a spec that then fails to plan, next now names a fix of the written spec and then plan(..., probe=true) in tool language, instead of the CLI retry agentdescent plan <path> --probe. A successful algorithm_spec next still names plan(spec, probe=true) and then the capped start. The CLI algorithms run failed-plan next is unchanged. No model name is guessed. The tool still does not start a run or probe.
    Verdict: PASS

@Birfy
Birfy enabled auto-merge (squash) November 28, 2026 10:30
@Birfy
Birfy merged commit f9c35b5 into main Nov 28, 2026
12 checks passed
@Birfy
Birfy deleted the fix/1305-mcp-algorithm-spec-failed-next branch November 28, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:T2 Risk tier T2 (package code or an unnamed path), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp: algorithm_spec failed-plan next still says agentdescent plan --probe, not plan(spec, probe=true)

1 participant