Skip to content

[FEATURE] Agent 友好化改造:全命令 --json + pt-snap-helper 引导技能 + 移除 MCP #136

Closed
6 of 6 issues completed

Description

@codeasier

功能描述

把 pt-snap-cli 当作 Agent 的一等用户来设计。Agent 友好化不等于「给命令加 --json」,而是覆盖完整调用链:

发现能力 → 构造正确调用 → 判断结果完整性 → 正确解释数据 → 失败可恢复 → 产物可追溯

本 issue 是总纲与路线图,不限于当前三个子任务;具体交付以 sub-issue 跟踪,按优先级推进。

使用场景

Agent(加载或不加载技能)通过 CLI 完成 PyTorch 内存快照分析:从 help / helper 发现能力,用结构化输出准确调用与修正,能判断证据是否完整、字段语义是否被误读,并追溯每次分析实际使用的数据库与设备。

路线图

P0 — 调用契约(决定其余改造能否被 Agent 用起来)

P1 — 结果完整性与语义

P2 — 后续迭代(本 issue 只登记方向,不立子任务)

横切验收:Agent 端到端评估

评估基线已由 #145 落入 tests/skills/suites/pt-snap-agent-e2e(含 pre-change 记录)。产品改完后用同一套件对比,不要用 #145 关闭本总纲。

在 tests/skills 既有评估框架上增加端到端场景(各子 issue 的验收也应支持以下行为):

场景 验证行为
无预装技能,仅 CLI 能从 --help 找到 helper 并获取引导
模板名 / 参数拼错 依据结构化错误码修正调用
多数据库 / 多设备并存 明确使用用户指定目标,结果信封可追溯
查询返回截断结果 主动分页或注明证据不完整
trace 末尾存在存活块 不直接断言「确认泄漏」
数据库缺失 / 无设备 不把失败当作空结果
import 成功 从结构化结果获得产物路径与 focus 变更

评估指标:任务成功率、调用次数、输出大小、错误结论率(改造前后对比)。

验收标准

Activity

  1. codeasier commented on Sep 18, 2026

    @codeasier
    OwnerAuthor

    #145 only landed the Agent CLI evaluation baseline. It must not close this parent issue: remaining product work is still on #137, #138, #140, #141, #142. P0 items already done elsewhere: #139 via #144, #120 via #126, plus tracked #112 via #143.

  2. codeasier commented on Sep 18, 2026

    @codeasier
    OwnerAuthor

    阶段性进度(2026-09-18,origin/main d5b7b51)

    P0 已完成 3/4,P1 已完成 1/3。总纲保持 OPEN。

    已合入

    Issue PR 内容
    #112 #143 缺失模板非零退出码
    #139 #144 pt-snap-helper + --help epilog
    #121 #127 去掉 rag extra 与 executor 死 loader
    #120 #126 未声明参数拒绝 + choices
    — #145 Agent CLI 评估基线(不得关闭本 issue)
    #137 #146 移除 MCP
    #141 #147 模板字段语义元数据

    任务图(剩余)

    #138 全命令 --json    ← 下一步,无 PR
      ├─ #140 分页 / has_more / 超时
      └─ #142 能力清单与数据库概览(最好等 #138 信封)
    #139 阶段 2 措辞终验 ← 等 #138
    #145 套件复跑 vs pre-change ← 产品改完后
    

    合入时记下的约束

    下一步:从最新 main 开 #138。

  3. codeasier commented on Sep 19, 2026

    @codeasier
    OwnerAuthor
  4. added a commit that references this issue on Sep 24, 2026
  5. codeasier commented on Sep 24, 2026

    @codeasier
    OwnerAuthor

    v0.4.0 已发布:PyPI pt-snap-cli==0.4.0 与 GitHub Release 均成功(workflow https://github.com/codeasier/pt-snap-cli/actions/runs/35952928649)。

    验收确认:

    • 干净 venv pip install pt-snap-cli==0.4.0,pt-snap --version 输出 0.4.0,--help 提供 pt-snap skill install pt-snap-helper --json 引导。
    • Agent E2E 覆盖 10 个场景,post-change 任务成功率 1.0、错误结论率 0。
    • 干净 wheel Agent 验收已进入 CI 与 release gate(helper 安装、import、capabilities、overview、peak query)。

    关闭本总纲。

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions