Repository navigation
fix: 按最近有效事件保留流式重放日志 - #342
Merged
helsome merged 1 commit intoOct 20, 2026
Merged
Conversation
8 tasks
3 of 5 tasks
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.
改动说明
StreamEventHistory按最近活跃顺序淘汰 run,但StreamEventLog.load()超过maxRuns时仍按首次出现顺序裁剪。交错的 run 事件写入日志后,一个刚产生新事件的旧 run 可能在重启时被删除,导致原本可用的重放历史丢失。例如
maxRuns = 2,写入顺序为active#1 → idle#1 → active#2 → newest#1:原实现保留 idle/newest,修复后保留 active/newest,并完整保留 active 的两条事件。关联 Issue
Refs #27
本 PR 修复持久化重放日志的 run 保留策略问题。
测试报告(正式审核前必填)
环境
c6da4a4d3),通过npx --yes bun运行。10.0.26300。ec0b8d2791f343495533a7425e6d3ecab97977b2。03729b076ed74c8d694b327a6fbe9f69b06a35c3。实际执行命令与结果
修复前回归验证:保留原实现,仅添加本 PR 的两项回归测试。
修复后验证:在上述验证提交上执行。
已知失败 / Baseline
修复后聚焦测试无失败,全部工作区类型检查通过。修复前的 1 项失败用于证明新增用例能复现原实现缺陷。
验证边界
本次未执行全仓测试。集成测试使用实际
LocalRuntimeAdapter、RunManager和临时文件仓储,工具结果来自 fixture;未调用真实模型或金融 provider,未执行 Electron GUI 验证。UI 截图
Scope / 后续
本 PR 交付
StreamEventLog.load()的 run 保留顺序修复,以及裁剪、磁盘重载和游标重放的回归测试。日志格式和保留上限保持兼容。#27 中真实模型输出、tool call、citation 及 GUI 取消/中断等整体协议验收,仍需单独验证;本 PR 的局部验证不代表这些验收全部完成。