Skip to content

fix(mcp): plan probe success next is the capped start - #1304

Merged
Birfy merged 1 commit into
mainfrom
agent/1303-mcp-plan-probe-next
Nov 28, 2026
Merged

Birfy merged 1 commit into
mainfrom
agent/1303-mcp-plan-probe-next

Conversation

@Birfy

@Birfy Birfy commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

Closes #1303

Base: 521a879
Tip SHA: 9c8d41b

What changed

On tip 521a879, a successful plan --probe already names only the capped evolve (#1217):

next: agentdescent evolve <spec> --max-calls N

MCP plan(spec, probe=true) is the same preflight. After a refused probe it already matches the CLI (ok: false, ready: false, repair next). After a successful probe it returned ok: true and ready: true, but no next field at all. plan_payload does not carry next, and _with_probe only wrote next on a refusal. A host that followed the unprobed MCP plan advice would probe a second time; starting without next can launch the run uncapped.

After a successful probe, MCP plan(..., probe=true) now returns next naming only the capped start:

next: call start with `spec` and max_calls=N

N is estimate.agent_calls_upper_bound, or <N> when no bound is known. A refused probe is unchanged. A successful plan without probe still names plan(spec, probe=true) and then the capped start. The plan tool description mentions this already-probed next. No model name is guessed.

changelog.d/1303-mcp-plan-probe-next.md.

No change to the probe itself, or to MCP algorithm_spec / CLI plan / algorithms run next lines.

Verification

Tip SHA: 9c8d41b

Ran:

  • pytest -q -o addopts='' tests/test_mcp_plan_probe.py tests/test_mcp_algorithm_spec.py tests/test_mcp_algorithm_spec_default_out.py tests/test_mcp_algorithm_spec_target_dir.py tests/test_first_run_caps.py tests/test_mcp.py tests/test_plan_probe.py tests/test_cli_algorithms_run.py → 143 passed
  • python -m tools.changelog_fragments check → 57 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 #1303

Base: 521a879

## What changed

On tip `521a879`, a successful `plan --probe` already names only the
capped evolve (#1217):

```
next: agentdescent evolve <spec> --max-calls N
```

MCP `plan(spec, probe=true)` is the same preflight. After a refused
probe it already matches the CLI (`ok: false`, `ready: false`, repair
`next`). After a successful probe it returned `ok: true` and
`ready: true`, but no `next` field at all. `plan_payload` does not
carry `next`, and `_with_probe` only wrote `next` on a refusal. A
host that followed the unprobed MCP `plan` advice would probe a second
time; starting without `next` can launch the run uncapped.

After a successful probe, MCP `plan(..., probe=true)` now returns
`next` naming only the capped `start`:

```
next: call start with `spec` and max_calls=N
```

`N` is `estimate.agent_calls_upper_bound`, or `<N>` when no bound
is known. A refused probe is unchanged. A successful plan without
`probe` still names `plan(spec, probe=true)` and then the capped
`start`. The plan tool description mentions this already-probed
`next`. No model name is guessed.

`changelog.d/1303-mcp-plan-probe-next.md`.

No change to the probe itself, or to MCP `algorithm_spec` / CLI
`plan` / `algorithms run` next lines.

## Verification

Ran:
- `pytest -q -o addopts='' tests/test_mcp_plan_probe.py
tests/test_mcp_algorithm_spec.py
tests/test_mcp_algorithm_spec_default_out.py
tests/test_mcp_algorithm_spec_target_dir.py tests/test_first_run_caps.py
tests/test_mcp.py tests/test_plan_probe.py
tests/test_cli_algorithms_run.py` → 143 passed
- `python -m tools.changelog_fragments check` → 57 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 risk:T2 Risk tier T2 (package code or an unnamed path), set by the controller from the diff agent-pr Pull request opened by an agent labels Nov 28, 2026
@Birfy

Birfy commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator Author

Review (Birfy)

Tip SHA: 9c8d41b
Ran:

  • .github/scripts/risk_gate.py --repo ThinkFlowLab/agentdescent --pr 1304 → T2 (package MCP next-line plus tests and the changelog fragment)
  • pytest -q -o addopts='' tests/test_mcp_plan_probe.py tests/test_mcp_algorithm_spec.py tests/test_mcp_algorithm_spec_default_out.py tests/test_mcp_algorithm_spec_target_dir.py tests/test_first_run_caps.py tests/test_mcp.py tests/test_plan_probe.py tests/test_cli_algorithms_run.py at this tip → 143 passed
  • python -m tools.changelog_fragments check → 57 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 plan(..., probe=true) succeeds, next now names only the capped start (max_calls from estimate.agent_calls_upper_bound, or <N> when no bound is known), the same already-probed advice the CLI plan --probe already prints, instead of leaving the host without a next. A refused probe is still ok: false / ready: false with a repair next. A successful plan without probe still names plan(spec, probe=true) and then the capped start. No model name is guessed. The probe itself and MCP algorithm_spec / CLI plan / algorithms run next lines are unchanged.
    Verdict: PASS

@Birfy
Birfy enabled auto-merge (squash) November 28, 2026 04:32
@Birfy
Birfy merged commit f0edb1e into main Nov 28, 2026
12 checks passed
@Birfy
Birfy deleted the agent/1303-mcp-plan-probe-next branch November 28, 2026 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-pr Pull request opened by an agent 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: plan(probe=true) success has no next, unlike plan --probe

1 participant