-
fix: goal can resuem by /resume
问题根源:Goal 状态只存储在 AppState.goal(内存)中,会话重启时内存丢失。
解决方案:把 Goal 状态持久化到 JSONL transcript 中,resume 时恢复。
改动的文件
src/types/logs.ts
- 新增 GoalEntry 类型(包含 type: 'goal'、所有 Goal 字段)
- GoalEntry 加入 Entry 联合类型
- LogOption 新增 goal?: GoalEntry 字段
src/utils/sessionStorage.ts
- METADATA_TYPE_MARKERS 数组加入 'type:goal'(支持预-compact 边界扫描时恢复)
- Project 类新增 currentSessionGoal: GoalEntry | undefined 缓存
- reAppendSessionMetadata() 中 re-append currentSessionGoal(session 退出时重写最新状态)
- restoreSessionMetadata() 新增 goal?: GoalEntry 参数,会写到 currentSessionGoal 缓存
- appendEntry() 中的 type === 'goal' 分支(不需要,已由 saveGoal 直接写)
- 新增 saveGoal(goal: GoalEntry) 函数:立即写入 transcript + 缓存
- 新增 clearGoal() 函数:清空缓存(用于 /goal clear)
- loadTranscriptFile() 解析 goal 条目,返回值加入 goal
- loadFullLog、getLastSessionLog、loadAllLogsFromSessionFile、loadTranscriptFromFile 均透传 goal
src/utils/conversationRecovery.ts
- loadConversationForResume 返回值新增 goal?: GoalEntry
src/utils/sessionRestore.ts
- ResumeLoadResult …
-
feat: desktop
cd desktop && bun run tauri dev
-
feat: better collapsing fetch result
when set verbose is false in /config
-
fix: web search and fetch
-
init: verspercode v0.1.0