Skip to content

plugin/MCP: the #1048 preflight probe is CLI-only — MCP plan has no probe, and no host skill mentions it #1094

Closed

Description

@Birfy

现象

#1048 给 CLI 加了 plan --probe / algorithms run --probe,但走插件/MCP 的宿主(Claude Code、Codex、dsh、OpenCode、Grok Bot)拿不到这道预检:

  1. MCP plan 工具签名只有 spec, usd_per_call, budget_usd(agentdescent/mcp.py 的 Tools.plan 与注册的 plan 工具),没有 probe 参数;algorithms_run 一类工具也没有。
  2. agentdescent install 写出的所有宿主说明里都没有提到 probe。实测在一个临时 --home 里装齐 5 个宿主后:
agentdescent install {opencode,grok-bot,claude-code,codex,dsh} --home /tmp/hp
for f in $(find /tmp/hp -name '*.md'); do echo "$f probe=$(rg -c -- 'probe' $f)"; done

12 个 SKILL.md / command / prompt / HOST.md 全部 probe=(0 次),而每个 SKILL.md 都有约 20 处讲 plan。

  1. 在同一个 CodingPlan 已过期的 Ark 账号下,直接在进程里调 MCP 的 plan:
from agentdescent.mcp import Tools
Tools().plan(json.load(open("agentdescent.gepa.spec.json")))   # -> ok=True,没有 probe 字段

同一个 spec 走 CLI plan --probe 会报 SubscriptionInactive 并 exit 1。也就是说,插件用户照宿主说明「plan → 用户确认 → start」走,会在 start 之后才发现 key/订阅/模型名是坏的,run store 里多一条失败 run。CLI 用户和插件用户的体验不一致(插件通用性)。

预期

  • MCP plan(以及 algorithms run 对应的工具,如果有)接受可选 probe: bool = False;为 true 时调用和 CLI 相同的 probe_payload(spec),把结果放进返回值的 probe 字段;失败时 next 指向修复动作而不是 start(和 CLI 侧的修法保持同一语义)。
  • 默认仍为 false,保持 plan "免费、什么都不跑" 的承诺。
  • 宿主共享的 SKILL.md 模板(各宿主由同一模板生成)在 plan 那一步加一句:第一次用某个 model/endpoint 时,先 plan --probe(MCP: plan(spec, probe=true)),probe 失败就把它的 next 告诉用户,不要调 start。

建议修法

  • agentdescent/mcp.py:Tools.plan 和注册函数加 probe 参数,复用 agentdescent.probe.probe_payload。
  • 更新共享的宿主 skill/command 模板与 docs/plugins.md 中 MCP plan 的说明。

验收

  • 单测:本地 HTTP stub 返回 Ark InvalidSubscription 400 时,Tools().plan(spec, probe=True) 返回 probe.ok == False 且 next 不是 start;返回 200 时 probe.ok == True;probe 省略时返回值与改动前一致。
  • agentdescent install <每个宿主> --home <tmp> 之后,每个生成的 SKILL.md 都包含 probe 指引(加一条测试断言)。
  • doctor --home <tmp> 各宿主仍为 ok。

Activity

  1. added
    enhancementNew feature or request
    area:pluginsHost plugins and installers: Claude Code, Codex, DSH, OpenCode, MCP server
    on Nov 15, 2026
  2. self-assigned this
    on Nov 19, 2026
  3. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Nov 19, 2026
  4. HugoXK commented on Nov 19, 2026

    @HugoXK
    Collaborator

    Branch: agent/1094-mcp-plan-probe; draft PR #1170 (Fixes #1094).

    Red first at f8efc731, with only tests/test_mcp_plan_probe.py swapped in:

    TypeError: Tools.plan() got an unexpected keyword argument 'probe'
    AssertionError: assert 'probe' in '---\nname: agentdescent\n…'
    

    3 failed, 1 passed. The pass is the default-path row, which pins the existing plan key set so the new parameter cannot change what a plain plan returns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-workingAn agent has claimed this issue (the claim comment names the branch)area:pluginsHost plugins and installers: Claude Code, Codex, DSH, OpenCode, MCP serverenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions