fix(tools): search.py 短前缀 paper_id 导致 get_paper_detail/get_similar/citation_tree 崩 - #61
Merged
Merged
Conversation
…tation_tree 崩 PR #60 修了 read/figures/reasoning,但 search.py 仍有同样 bug: - _get_paper_detail: line 53 用 UUID(paper_id) 重新查(既多余又崩短前缀), 且 line 49 已调 _require_paper 拿到完整论文对象,直接用即可 - _get_similar_papers: line 78 UUID(paper_id) 崩;line 107 返回原始短前缀给 LLM - _get_citation_tree: line 181 传原始 paper_id 给 GraphService.citation_tree, 内部用 paper.id 作 dict key,短前缀不匹配 → root_paper 为 None 修复: - _get_paper_detail: 用 _require_paper 返回的 p 直接构造 data,删重复 UUID 查询 - _get_similar_papers: pid = UUID(paper.id);返回 paper.id 给 LLM - _get_citation_tree: 用 paper.id 传给 citation_tree 实测前:生产 b7e07388 → LLM 先调 get_paper_detail → "badly formed hexadecimal UUID", LLM 改调 search_papers(keyword=b7e07388) → 0 结果 → 放弃。 修复后:get_paper_detail 直接用 _require_paper 解析的完整论文,短前缀可用。 测试: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.
PR #60 修了 read/figures/reasoning 的短前缀 bug,但 search.py 仍有同根 bug:get_paper_detail/get_similar_papers/get_citation_tree 用 UUID(paper_id) 崩短前缀。修复:统一用 _require_paper 返回的 paper.id。测试 69 passed/2 skipped。