Replies: 4 comments 1 reply
|
已定位根因:长会话(大量 |
|
可选修复方案 监听器已经能获得当前事件: if (event.seq !== state.consumedEvents) { this._foldEvent(session, state, event) 同时在 ReplayState 中暂存当前 Step 的 assistant/chunk,避免 _estimateProviderAssistant() 为读取 sourceEventSeqs 再次访问完整 session.events。 优点:
方案 B:为 Session 增加 O(1) 的 eventAt() 或尾部迭代接口
如果维护者认可该方向,我愿意按方案 A 提交修复 PR,包括事件直折叠、Chunk 有界缓存、冷启动追赶、结果一致性测试和性能回归测试。 |
|
Related thread on long-conversation UX: #5650 (auto-compaction silently resets long sessions; incremental rolling memory proposal). Same "long conversations are not first-class" theme as this O(n²) issue. |
Uh oh!
There was an error while loading. Please reload this page.
实测结果:
events inactive meter active meter
8,000 162 ms 215 ms
16,000 246 ms 404 ms
32,000 476 ms 1,657 ms
32K 时 active/inactive 已达到约 3.5 倍,并呈现二次方增长。
设计建议:
验收标准:
All reactions