fix(benchmark): handle non-object baseline validation - #146
Open
97Three wants to merge 1 commit into
Open
Conversation
Signed-off-by: 97three <2212371308@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue
Closes #144
问题与改动
当 baseline 文件是合法 JSON、但顶层不是 object(例如
[])时,load_benchmark_report()原本会抛出未被 CLI 捕获的TypeError,导致命令显示 Python traceback。本 PR:
ValueError的BenchmarkReportError;使用专用异常可以避免在 CLI 最外层捕获所有
TypeError,从而掩盖其他程序错误。验证
非法 baseline 现在返回退出码
2,并输出:不再显示 traceback。
风险与兼容性
风险较低。修改仅影响 benchmark baseline 顶层类型错误的异常分类,合法 baseline 的读取和比较行为保持不变。
不涉及数据库迁移、Schema、依赖、凭据、GitHub 写入、Harness、Runner 或性能变化。
自动化辅助
使用 Codex 辅助问题定位、代码实现和测试准备。我已理解相关调用链,检查完整 diff,并确认修复前后的复现结果和测试结果。
Checklist