fix(web): 优化会话回放、compact 状态与文件回退刷新#612
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
| function isInternalHistoryMessage(msg: BackendMessage): boolean { | ||
| const role = msg.role.trim().toLowerCase() | ||
| if (role === 'system') return true | ||
|
|
||
| const content = msg.content.trim() | ||
| if (!content) return false | ||
| return content.startsWith('<acceptance_continue>') || | ||
| content.includes('<completion_blocked_reason>') || | ||
| content.includes('<todo_convergence>') |
There was a problem hiding this comment.
isInternalHistoryMessage is broader than the PR description: it drops every system message and any message whose text merely contains these markers. Because mapHistoryMessages() applies this filter before collecting tool_call_id results, a normal tool output or pasted file that contains <completion_blocked_reason> / <todo_convergence> will vanish from the replay, and the related tool card loses its result. Please narrow this to the specific control-message shape/role instead of substring-matching arbitrary history content.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
背景
本次改动聚焦 Web 聊天体验与 checkpoint 文件级回退链路,修正历史会话回放、compact 状态展示、预算提示、工作区展开状态以及单文件回退后的前端刷新行为。
当前修改
setMessages写入,覆盖切换会话、checkpoint 回退和首次自动绑定场景,减少逐条追加带来的中间态。CheckpointRestored事件契约,补充mode和paths字段;baseline 文件回退会规范化路径并随事件回传。验证
go test ./internal/runtime ./internal/tui/services:通过。cd web && npm test:47 个测试文件、276 个测试通过。cd web && npm run build:TypeScript 与 Vite 构建通过。风险与影响