perf: open long sessions without re-reading every tool result

A chat page carried every finished tool result, and the app fetched it
twice when opening a chat, with a 20 second deadline. On a slow link a
long session (this one was ~530 KB per page) timed out.

- ask for shelled pages (x-openchamber-part-shells: v1), which drops
  finished tool results: ~180 KB for the same page
- fetch one message by id when its tool row is opened
- keep tool and step updates local from events instead of re-reading
  the page on every step, and only resync after a real disconnect
- 60 second deadline with a retry button

Bump version to 0.1.11 (build 12).
This commit is contained in:
blumia committed 2026-11-16 20:04:42 +08:00
1 parent 0e34d82a06
commit e67490e768
8 files changed
+256 -20

No files matched your search

+1
View File
@@ -45,6 +45,7 @@ M0 完成,并继续做到了 M3。所有验证都连的是本机正在运行
| 首屏无导航栏 | 未连接时直接显示服务器列表(自带标题),不再套用带「新建/刷新」的应用栏;连接后才建立导航栈与动作栏 |
| 轮次页脚 | 每个回合结束后显示「模型 · Agent · 耗时」,右侧「…」打开操作面板(时间戳、复制回答、从这里分叉);模型名由 `/api/model` 解析,耗时按 prompt→完成计算;模型图标改用内置 SVG(不依赖平台符号表) |
| 用户消息操作 | 每条用户消息下有「时间 · 复制 · …」一排;「…」面板含时间戳、复制消息、从此消息前分叉 |
| 长会话加载 | 首屏只取最新 30 条(倒序);请求 `x-openchamber-part-shells: v1` 让服务端省略已完成工具结果(本会话 530KB→180KB);展开工具时再按消息 id 取全文;流式期间用事件本地更新工具/步骤,不再反复拉整页;60s 超时 + 重试;连接建立不重复同步 |
| Agent 选择 | 只列 `mode=primary` 的 Agent,子智能体(General/Explore)不再出现 |
| 模型/Agent | 聊天页顶栏打开选择 Sheet(可搜索),切换后同步会话列表 |
| 新建会话 | 会话页「新建」:标题 + 工作目录(服务端默认目录与已加载会话的目录),创建后直接进入聊天 |