Skip to content

fix(mcp): plan probe refusal next names tools, not CLI verbs - #1310

Merged
Birfy merged 1 commit into
mainfrom
fix/1309-mcp-plan-probe-failed-next
Nov 28, 2026
Merged

Birfy merged 1 commit into
mainfrom
fix/1309-mcp-plan-probe-failed-next

Conversation

@Birfy

@Birfy Birfy commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

Closes #1309

Base: 8062018
Tip SHA: 8c37208

What changed

On tip 8062018, MCP plan already rewrites a successful probe=true next into a capped start (#1303), and a no-probe success already names plan(..., probe=true) then that start (#1296). A refused probe still returned the shared CLI repair sentence untouched:

fix the hint in the error (model name, base URL, or API key variable) and re-run plan --probe
run `agentdescent doctor`, then re-run plan --probe

The same leftover was on each failed probe.rows[].next. A host that followed algorithm_spec or a no-probe plan next would call plan(..., probe=true); when that refused for a config or generic error, it was told to run CLI verbs it may not have.

A ProviderConfigError refusal on MCP plan(..., probe=true) now returns:

next: fix the hint in the error (model name, base URL, or API key variable) and call plan with `spec` and probe=true

A generic probe refusal now returns:

next: call doctor, then call plan with `spec` and probe=true

The failed row's next is rewritten the same way. Subscription and quota refusals stay on the shared tool-neutral sentences. ok: false / ready: false stay the same contract on both surfaces (#1175). No model name is guessed. The tool still does not start a run. The CLI plan --probe next is unchanged. The plan tool description mentions this tool-language refusal next.

changelog.d/1309-mcp-plan-probe-failed-next.md.

Verification

Tip SHA: 8c37208

Ran:

  • pytest -q -o addopts='' tests/test_mcp_plan_probe.py tests/test_plan_probe.py tests/test_mcp.py tests/test_mcp_algorithm_spec.py tests/test_first_run_caps.py → 105 passed
  • python -m tools.changelog_fragments check → 60 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

When plan(..., probe=true) is refused for a provider-config or generic
error, next (and the failed row's next) now names doctor and plan with
probe=true instead of the shared CLI repair. Subscription and quota
refusals stay shared. The CLI plan --probe next is unchanged.

Closes #1309
@Birfy

Birfy commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator Author

Review (Birfy)

Tip SHA: 8c37208
Ran:

  • .github/scripts/risk_gate.py --repo ThinkFlowLab/agentdescent --pr 1310 → T2 (package MCP next-line plus tests and the changelog fragment)
  • pytest -q -o addopts='' tests/test_mcp_plan_probe.py tests/test_plan_probe.py tests/test_mcp.py tests/test_mcp_algorithm_spec.py tests/test_first_run_caps.py at this tip → 105 passed
  • python -m tools.changelog_fragments check → 60 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) is refused for a provider-config or generic error, next (and the failed row's next) now names doctor and plan with probe=true, instead of the CLI repair (re-run plan --probe, run \agentdescent doctor`). Subscription and quota refusals stay on the shared tool-neutral sentences. ok: false/ready: falsestay the same contract on both surfaces. No model name is guessed. The tool still does not start a run. The CLIplan --probe` next is unchanged.
    Verdict: PASS

@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 enabled auto-merge (squash) November 28, 2026 22:25
@Birfy
Birfy merged commit c5de234 into main Nov 28, 2026
12 checks passed
@Birfy
Birfy deleted the fix/1309-mcp-plan-probe-failed-next branch November 28, 2026 22:56
Birfy added a commit that referenced this pull request Nov 29, 2026
Closes #1311

Base: c5de234
Tip SHA: 788ca42

## What changed

On tip `c5de2343` (after #1310), MCP `demo` / `plan` / `algorithm_spec`
already rewrite host-facing `next` into Path A tool language. MCP
`diagnose` still returned the shared `diagnose_payload` recommendations
untouched, so a host was told to run CLI verbs it may not have,
including `agentdescent watch` though Path A has no `watch` tool.

A solved MCP `diagnose` now returns:

```
review the diff: call show with this run_id
preview the write: call apply with this run_id and dry_run=true, then call apply without dry_run
```

A still-running run is followed with `status`, then `diagnose` when it
ends. Cancelled / run-failed / reflector-error / partial-improvement /
unknown / scoring-mismatch recommendations name the matching Path A
tools (`resume`, `show`, `doctor`, `plan`). Verdict, summary, and
evidence stay the same. The CLI `diagnose` / `diagnose --json`
recommendations are unchanged. The `diagnose` tool description mentions
this tool-language `recommendations`.

`changelog.d/1311-mcp-diagnose-recommendations.md`.

## Verification

Tip SHA: 788ca42

Ran:
- `pytest -q -o addopts='' tests/test_mcp_diagnose.py
tests/test_diagnose.py tests/test_mcp.py` → 76 passed
- `python -m tools.changelog_fragments check` → 61 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
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: plan probe refusal next still names CLI doctor / plan --probe

1 participant