fix: keep loaded tool output when the tail page only has its shell

List responses ask the server to elide large tool output
(`x-openchamber-part-shells: v1`): the part comes back as an empty text
plus an `openchamberContentShell` marker, and the full text is fetched
when a step is expanded. Every tail refresh (a turn starting, the app
returning) then replaced the loaded message with that shell again, so an
expanded step fell back to "无输出" — the more the session was used, the
more it looked like shell steps never had output.

reloadTail now keeps an already-loaded tool part when the server's copy of
that part is a shell (matched by position and call id), and the pending
state reads "输出较大,正在载入…" instead of claiming there was no output.
Version 0.3.7 (code 307).
This commit is contained in:
blumia committed 2026-11-20 09:18:04 +08:00
1 parent 6c00e5e026
commit fbadf6f858
5 files changed
+68 -4

No files matched your search

+12
View File
@@ -27,6 +27,18 @@
---
## 0.3.7 工具输出被“壳”覆盖(分支 `flutter`)
| 项 | 结果 |
| --- | --- |
| 现象 | 会话列表接口带 `x-openchamber-part-shells: v1` 时,大一点的工具输出只给一个空壳:`content:[{type:'text',text:''}]` + `metadata.openchamberContentShell`。展开步骤时客户端会单条拉完整消息(`/message/:id`,不带壳),输出就出来了 |
| 根因 | 每次 `reloadTail()`(每轮 `execution.started`、回到前台等)都用**带壳**的列表覆盖本地消息,把刚加载出来的输出又盖回空壳,于是展开着的那一步变回「无输出」——看起来就像“始终无输出” |
| 修复 | `reloadTail` 合并消息时,如果服务端给的是壳、本地这一条已经加载过完整内容,就保留本地那条(按 part 顺序与 call id 对齐),不再降级;真没有输出的命令仍然显示「无输出」 |
| 提示 | 壳还没加载完时不再显示「无输出」,而是「输出较大,正在载入…」 |
| 版本 | **0.3.7(code 307)** |
---
## 0.3.6 斜杠指令与错误显示(分支 `flutter`)
| 项 | 结果 |