-
Notifications
You must be signed in to change notification settings - Fork 634
Closed
Description
Bug Description
在使用 resume 命令恢复会话时,存在以下三个相关问题:
1. 会话恢复时崩溃
使用 kode resume 恢复会话
- FileEditToolUpdatedMessage 组件报错:"to" property undefined
- OutputLine 组件报错:content 为 undefined
根本原因:
src/utils/protocol/kodeAgentSessionLoad.ts 中的 normalizeLoadedUser() 函数在从 JSONL 会话文件加载用户消息时,没有恢复 toolUseResult 字段。该字段在保存时被写入文件,但加载时被忽略,导致 UI 组件访问 message.toolUseResult.data 时崩溃。
2. 恢复会话后 2xESC 撤销菜单为空
- resume 一个之前的会话
- 按两次 ESC 键打开"Jump to a previous message"菜单
- 菜单中没有任何历史用户消息
根本原因:
src/app/query.ts 中的 query() 函数只持久化从 queryCore() yield 出来的消息(助手响应和工具结果)。用户输入的文本消息(触发查询的消息)从未被保存到 JSONL 会话文件中。
检查实际会话文件可以发现:
file-history-snapshot
assistant (tool_use)
user (tool_result)
user (tool_result)
...
完全没有用户文本消息记录。
App and Environment Info
Kode Version: macos, WarpTerminal, v2.0.2
Metadata
Metadata
Assignees
Labels
No labels