fix(pipeline): L2 runner 零记录时返回现有 cursor 而非 void#99
Open
yuanrengu wants to merge 2 commits into
Open
Conversation
VectorStore 和 JSONL fallback 路径在 0 记录时返回 void,导致
runL2 无法更新 last_extraction_updated_time,每次 L2 运行都全量
扫描而非增量查询。
修复:零记录时返回 { latestCursor: cursor },让 runL2 保留已有
cursor。提取失败路径保持 void 返回以保留重试语义。
Closes Tencent#98
Signed-off-by: yuanrengu <heyonggang0811@126.com>
当 L2 runner 返回 void(零记录或提取失败)且 last_extraction_updated_time 仍为空字符串时,将其设为当前时间。防止每次 L2 运行都全量扫描。 已有 cursor 时提取失败不推进,保留重试语义。 Closes Tencent#98 Signed-off-by: yuanrengu <heyonggang0811@126.com>
Collaborator
|
您的修复、测试方案很周到,感谢您的贡献!我们会尽快开始review,有结果会及时同步。 |
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.
Summary
修复 L2 runner 在零记录/提取失败时不返回 cursor 导致
last_extraction_updated_time永不推进的问题。改动 1:
src/utils/pipeline-factory.ts(runner 侧)VectorStore 和 JSONL fallback 路径在 0 记录时返回
{ latestCursor: cursor }而非void,让runL2保留已有 cursor。提取失败路径保持void返回以保留重试语义。改动 2:
src/utils/pipeline-manager.ts(runL2 侧)当 runner 返回 void 且
last_extraction_updated_time仍为空字符串时,将其初始化为当前时间。这解决了 runner 侧改动无法覆盖的边界情况:首次运行时 cursor 为空,cursor || undefined仍为undefined,返回{ latestCursor: undefined }与return;效果相同。各场景行为
"""2024-01-01""2024-01-01"""max(updatedAt)"2024-01-01""2024-01-01"""与 PR #2 的区别
PR #2 将
latestCursor计算移到if块外并无条件返回,导致提取失败(如 LLM 超时)时 cursor 也会推进到max(records.updatedAt),未成功提取的记录被永久跳过。本 PR 仅在零记录路径返回 cursor,提取失败时保留原始的重试语义。Test plan
npx vitest run)Closes #98