fix(tools): 短前缀 paper_id 导致 skim/deep_read/embed/figures/reasoning 崩 - #60
Merged
Conversation
根因:_require_paper 支持短前缀(≥8 hex 自动模糊匹配完整 UUID),但 handler 里的 `UUID(paper_id)` 直接解析原始短前缀(如 "b7e07388"), 报 "badly formed hexadecimal UUID string"。 system prompt 示例 F 明确教用户"直接传 b7e07388",但 handler 崩了, agent 可用性受损(LLM 按指令调工具却失败)。 修复:handler 用 `paper.id`(_require_paper 已 resolve 成完整 UUID), 不再用原始 paper_id 调 UUID()。涉及: - read.py: _skim_paper / _deep_read_paper / _embed_paper(3 处 pid = UUID(paper.id)) - figures.py: _analyze_figures 改用 _require_paper 统一解析 + UUID(paper.id) - reasoning.py: _reasoning_analysis 改用 _require_paper + UUID(paper.id) figures.py/reasoning.py 此前自己管理 session 且 UUID(paper_id) 对短前缀崩, 改用 _require_paper 后统一走 detached-but-loaded 模式,与 read.py 一致。 测试:69 passed / 2 skipped(无回归)。
🔍 OpenCode PR Review Required这是一个受保护的分支,merge 前需要进行 code review。 请运行以下命令进行 OpenCode review: 或者在 PR 页面评论 This is an automated reminder from PR Review Gate. |
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.
Critical 工具层 bug(与 PR #59 同根,detached session 修复后的延伸)
现象:用户传短前缀 paper_id(如
b7e07388,system prompt 示例 F 明确教这种用法),confirm resume 执行 skim_paper 报badly formed hexadecimal UUID string,action_result success=false。根因:
_require_paper支持短前缀(≥8 hex 自动模糊匹配完整 UUID),但 handler 里的UUID(paper_id)直接解析原始短前缀会崩——短前缀不是合法 UUID 字符串。修复:handler 用
paper.id(_require_paper已 resolve 成完整 UUID),不再用原始 paper_id 调UUID()。涉及:read.py:_skim_paper / _deep_read_paper / _embed_paper(3 处pid = UUID(paper.id))figures.py:_analyze_figures 改用_require_paper统一解析 +UUID(paper.id)reasoning.py:_reasoning_analysis 改用_require_paper+UUID(paper.id)figures.py/reasoning.py 此前自己管理 session 且
UUID(paper_id)对短前缀崩,改用 _require_paper 后统一走 detached-but-loaded 模式(与 PR #59 的 read.py 一致)。实测:生产 b7e07388 短前缀 confirm resume skim_paper → 修复前
success=false "badly formed hexadecimal UUID",修复后应成功。测试:69 passed / 2 skipped(无回归)。