Skip to content

[BUG] query --template-info 对缺失模板仍返回退出码 0 #112

Closed

Description

@codeasier

问题描述

pt-snap query --template-info <缺失模板> 会打印 Error: Template '...' not found(cli.py:368)但不抛出异常,进程以退出码 0 结束。该行为已被 tests/test_cli.py::test_query_template_info_not_found 断言固化。

影响

依赖退出码的调用方(脚本、agent 预检)无法区分成功与失败。pt-snap-memory-peak-breakdown skill 的模板预检因此被迫改为检查输出内容而非退出码(PR #108 评审意见,SKILL.md Mandatory Preflight 第 4 步)。

复现步骤

pt-snap query --template-info does_not_exist
echo $?
# 输出错误信息后打印 0

期望行为

模板缺失时应返回非零退出码(同时保留现有错误文案),并同步更新 tests/test_cli.py 与 tests/test_contract_cli_mcp.py 中相关契约。

参考

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions