feat(backthink): 后台思考页接 WS 实时——ws.ts 处理 backthink 事件头插 store
后端每次思考落库发 ws.backthink(bus→hub→WS),此前 ws.ts 无 case、addBackthink 是死方法。 新增 case `backthink`→parseBackthinkItem→s.addBackthink 头插;parseBackthinkItem 兼容 Go默认字段(ID/Trigger/At/Conclusion/ShouldPush/PushResult)与admin camelCase。 配合页面(行key=id)实现增量插入、不整页重渲。build 99模块绿。
This commit is contained in:
1 parent
3386679d45
commit
7a81071ec8
2 files changed
+34
-1
No files matched your search
@@ -5,6 +5,7 @@ import {
|
||||
parseAdminChannelMessage,
|
||||
parseAgent,
|
||||
parseAwakenTool,
|
||||
parseBackthinkItem,
|
||||
parseGraph,
|
||||
parsePersistedMessage,
|
||||
parseTool,
|
||||
@@ -95,6 +96,14 @@ function dispatch(ev: { type: string; data: unknown }): void {
|
||||
if (msg) s.pushChannelEvent(msg);
|
||||
break;
|
||||
}
|
||||
case "backthink": {
|
||||
// design/12 §4 — a background-think pass result was persisted. Head-insert into
|
||||
// the store so the admin backthink panel appends it in realtime (rows keyed by
|
||||
// id → React reconciles incrementally, no whole-page re-render).
|
||||
const item = parseBackthinkItem(r);
|
||||
if (item) s.addBackthink(item);
|
||||
break;
|
||||
}
|
||||
case "thinking.start": {
|
||||
pendingThinking = "";
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user