Fix citation link mapping for duplicate URLs and unstable cite_index#276
Fix citation link mapping for duplicate URLs and unstable cite_index#276CJackHwang merged 4 commits intomainfrom
Conversation
…复来源且 cite_index 缺失或不稳定时,位置索引被压缩,部分 [citation:x] 无法找到对应链接。修复后改为保留上游结果的原始顺序(包括重复 URL),从而保证按位置回填 citation 时不会丢号。
修复重复 URL 且 cite_index 不稳定时 citation 映射不完整的问题
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0a2fc42dad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| func (c *citationLinkCollector) addOrdered(url string) { | ||
| if _, ok := c.seen[url]; ok { | ||
| return | ||
| } | ||
| c.seen[url] = struct{}{} | ||
| c.ordered = append(c.ordered, url) |
There was a problem hiding this comment.
Reinstate de-dup for refreshed results lists
addOrdered now appends every URL occurrence, so when the stream sends multiple response/fragments/*/results updates for the same fragment (especially o:"SET" refreshes with overlapping URLs), the ordered slice accumulates duplicates and shifts fallback index mapping in build(). In that case later markers (e.g. [citation:3]) can resolve to an earlier repeated URL instead of the newly added source, producing wrong citation links in responses that rely on nil/unstable cite_index values.
Useful? React with 👍 / 👎.
更新为AGPL3.0
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
Fix citation link mapping for duplicate URLs and unstable cite_index
📝 补充信息 | Additional Information
无