Refactor/ai agent data structure - #4070
Merged
Merged
Conversation
Contributor
PR CI 汇总状态:全部通过
由 pull_request test workflow 自动生成 |
…nRefreshAIReviewRuleSelect
1. 将内存数据currentCasualTaskID移动到状态机中 2. 给item和group渲染定义新增nodeId字段,代表组的标识 3. 删除ReActChatRenderElement定义里的cacheOrder和dataOrigin,以及相关定义枚举 4. 完善了状态机里dispatchStreamingNode字段的处理逻辑和定义 5. 调整数据逻辑机里的handleSendMessage方法(未完成) 6. 新增公共方法handleTaskPlanEnd,处理任务规划结束后的所有数据和状态的变化、调整了pushLogToOtherWindow逻辑 7. 调整所有grpc流数据的处理逻辑
perf:抽离组单纯的UI组件
initLoading 期间允许发 recovery_history;仅非初始化的 grpcLoadMore 防重入。dequeue 用渲染树 items 判断前端临时问题是否已上屏,避免 contents 被视窗回收后 replaceItemToken 失效。
- useLoadOlder 对齐之前useLoadHistory:startReached 触发 recovery_history、 firstItemIndex 前插补偿防视口跳动、loading 期间请求排队结束后补发 - rangeChanged/scrollToIndex 按绝对 index 换算 firstItemIndex 偏移 - Header 转圈改用真实在途状态 grpcLoadMoreLoading - 视窗 hydrate/方向预取/淘汰逻辑保持不变
先注释视窗回收删除 contents 的逻辑,避免问题 uuid 在 dequeue 替换前被清掉导致对不上。 fix:删除不需要得提示
perf:wf如果当前有正在执行得会话,需要先关闭当前会话;然后再重启点击得会话;如果当前点击得会话处于执行中得状态,那么就提示点击得会话正在执行中,不让切换 fix:修复点击任务详情在深度会话和任务tab之间反复切换问题
- handleLoadMore: 消息处理中(casualLoading/taskStatus=processing)禁止 gRPC 向上加载,排队等处理结束后补发;IDB hydrate 不受影响 - handleSendMessage: grpcLoadMoreLoading 期间禁止发送消息,提示稍后再发 - 两道闸门对称,避免 gRPC 历史查询与流式写入并发导致后端表死锁 - chatStore: 加载 immer MapSet 插件(execFileRecord 为 Map) - AIReActChatContents: defaultItemHeight 调整为 32,注释 increaseViewportBy - AIAgentChatTemplate: 去掉 defaultItemHeight
打字机 hook 里用 shouldType 控制: 只有组件生命周期内status=start 才启用打字,挂载即 end (IDB 缓存历史)直接对齐完整内容不打字。 - aiStream: 抽取 dispatchStreamToUI 公共方法,历史/实时统一首包上屏 - useTypedStream: 新增 shouldTypeRef,未见 start 时 alignToFull 不打字 - 流结束后直接对齐全文,不把积压再慢慢打完 - AIReActChatContents: defaultItemHeight 调整为 26
避免 ensureSession 造空池误判执行中;修复 render/content 写链 finally 无法自清;delete/replace 补齐结构落库;孤儿 session 与批量清库路径完善。
应用启动时 indexedDB.deleteDatabase 删除旧库释放磁盘, 失败/blocked 不影响新库预热;旧库引用(useAIMessageData)已是 dead code。
ipcRenderer.send 无法触发 ipcMain.handle,改为 invoke; 日志转发不需要等返回值,用 void 忽略 Promise。
luoluoTH
force-pushed
the
refactor/ai-agent-data-structure
branch
from
July 31, 2026 07:44
f4b53dc to
8a9e669
Compare
覆盖 Controller/utils/chatStore/handlers/persist/emitter 的 A-F 全量场景, 补齐执行态查询与删除/结构落库相关断言;日志转发改为 invoke,fixture 补齐 isHistory。
解构 renderNum 并 alias 转换函数,消除 render-result-naming-convention 误伤。
fix:修复切换会话报错当前会话在执行中
luoluoTH
force-pushed
the
refactor/ai-agent-data-structure
branch
from
July 31, 2026 08:48
db6c5ee to
5578086
Compare
hjhke
approved these changes
Jul 31, 2026
song-xiao-lin
approved these changes
Jul 31, 2026
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.
第一种方式合并