Jun 19 14:42 chore: use pre-compiler code Jun 18 10:50 fix: /goal clear but /resume will get old goal /goal clear 只清了内存中的 AppState.goal,但在 reAppendSessionMetadata 退出时把旧缓存 currentSessionGoal 又写回了
transcript。而且 loadTranscriptFile 是 last-wins 逻辑,一条旧的 goal entry 永远不会被清除。
需要两个修复:
1. /goal clear 时写入一条 goal 且带 cleared 标记,或写入 null 来覆盖
2. reAppendSessionMetadata 不要在 goal 已清除时重新写入
最简洁的方案:写入一条 goal: null 的 entry,加载时遇到 null 就视为无 goal 10:34 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 … Jun 15 14:00 feat: goal dot status color cycle 问题找到了。goalStatusColor 返回 'red', 'yellow' 等原始颜色字符串,但 ThemedText.resolveColor() 期望的是:
- 要么是 theme key(如 claude, success 等)
- 要么是带 ansi: 前缀的原始颜色(如 'ansi:red')
由于 'red' 既不是 theme key 也没有前缀,resolveColor 找不到对应颜色就返回 undefined,导致无色(灰色)。
修复方案:goalStatusColor 返回带 'ansi:' 前缀的颜色字符串。
● Update(src/components/PromptInput/GoalIndicator.tsx)
⎿ Added 6 lines, removed 6 lines
8 export function goalStatusColor(status: GoalStatus): string {
9 switch (status) {
10 case 'pursuing':
11 - return 'yellow'
11 + return 'ansi:yellow'
12 case 'paused':
13 - return 'gray'
13 + return 'ansi:gray'
14 case 'achieved':
15 - return 'green'
15 + return 'ansi:green'
16 case 'blocked':
17 - return 'red'
17 + return 'ansi:red'
18 case 'usage-limited':
19 - return 'gray'
19 + return 'ansi:gray'
20 case 'budget-limited':
… 12:20 chore: goal promptinput-footsider lastline 11:48 feat: WebSearch markdown add image link can show image 11:07 feat: /goal 新增文件 (12个)
- src/commands/goal/index.ts — 命令入口
- src/commands/goal/goal.tsx — 命令核心逻辑
- src/utils/goal.ts — prompt 构建和工具函数
- src/tools/GoalUpdateTool/ — update_goal 工具 (3个文件)
- src/tools/GoalCreateTool/ — create_goal 工具 (3个文件)
- src/tools/GoalGetTool/ — get_goal 工具 (3个文件)
- src/hooks/useGoalAutoContinue.ts — 自动继续 hook
- src/components/PromptInput/GoalIndicator.tsx — Footer 状态显示
修改文件 (6个)
- src/state/AppStateStore.ts — 添加 GoalStatus / Goal 类型和 goal 字段
- src/commands.ts — 注册 goal 命令
- src/tools.ts — 注册三个 goal 工具
- src/screens/REPL.tsx — 调用 useGoalAutoContinue(queryGuard)
- src/components/PromptInput/PromptInputFooterLeftSide.tsx — 引入并显示 GoalIndicator
- src/bootstrap/state.ts — 添加 getTotalTokensUsed() 函数
功能
- /goal <objective> — 设置长期自治目标
- /goal pause|resume|clear|edit — 管理目标
- agent 在每个 turn 结束后自动 enqueue 继续 prompt(直到目标完成或被阻塞)
- update_goal 工具供 agent 标记目标完成或 3+ 轮阻塞后标记 blocked
- Footer 显示 goal 状态指示器 09:23 feat: cancel auto-start feishu bot 09:15 feat: markdown-style feishu 08:48 fix: just rm symbol not include text 08:05 fix: voxcpm python no need source 07:29 feat: feishu voice voxcpm and edge-tts 04:09 feat: feishu voice tts 01:55 feat: feishu Jun 14 13:45 feat: feishu connect 09:23 fix: nvidia provider chat 02:48 fix: desktop provider kepp TUI Jun 13 14:08 feat: voice TW girl voice 14:00 feat: voice support zh-CN ---
STT(语音识别中文)
src/hooks/useVoice.ts 两处改成:
const rawLanguage = getInitialSettings().voiceLanguage || getInitialSettings().language
优先用 voiceLanguage 字段,没有则 fallback language。zh (中文) 已在 Deepgram 支持列表中。
TTS(中文语音输出)
src/hooks/useAutoTTS.ts 新增 resolveEdgeTTSVoice() 函数,根据语言自动选择 voice:
- zh / zh-CN → zh-CN-XiaoxiaoNeural
- zh-TW → zh-TW-HsiaoYuNeural
- zh-HK → zh-HK-HiuMaanNeural
- ja → ja-JP-NanamiNeural
- 其他 → en-US-JennyNeural(默认)
配置方法(在 ~/.claude/settings.json 里加):
{
voiceLanguage: zh-CN,
voiceTTSVoice: zh-CN-XiaoxiaoNeural
}
或者更简单,改 language 为 zh-CN 也能自动生效(两处都会读)。 13:38 fix: desktop session model config tip nvidia 12:17 feat: provider model list in desktop and fix bun run tauri dev can't keep 09:46 feat: desktop setting provider 04:36 feat: add nvidia provider 02:19 feat: voice ok 02:06 chore: rm bak of fix config render 02:01 fix: config render 02:01 feat: voice stt+tts just first have voice 00:31 feat: voice stt ok english Jun 12 17:13 feat: voice add fully-local STT (faster-whisper) + TTS (edge-tts) 06:29 feat: voice mode asr Jun 10 16:20 chore: debug SDK WS classification and fix CLI binary resolution chenbhao +1: Claude Big Pickle - Add console.log for SDK WebSocket H5 classification debugging
- Bypass broken standalone dist/cli binary, delegate to sidecar/source
Co-Authored-By: Claude Big Pickle <noreply@anthropic.com> 10:02 fix: desktop server CLI spawn and model listing for CLI auth chenbhao +1: Claude Big Pickle - Fix CLI process startup failure: resolveCliArgs now prefers the standalone
dist/cli binary (which has the real runHeadless implementation) over the
OSS sidecar binary (which has a stub print.ts without runHeadless).
Uses CLAUDE_APP_ROOT for real filesystem path resolution inside compiled
sidecar where import.meta.dir is a virtual bunfs path.
Fallback changed from broken bin/claude-haha path to PATH lookup.
- Fix desktop /api/models to recognize CLI auth state: added
fetchCliProviderModels() that reads ~/.claude.json directly and fetches
OpenCode models from models.dev/api.json or OpenRouter models from
openrouter.ai/api/v1/models, with 5-minute caching. This makes OpenCode
and OpenRouter models visible in the desktop UI after CLI /login.
Co-Authored-By: Claude Big Pickle <noreply@anthropic.com> 07:19 chore: h5 fix Jun 2 15:44 feat: Agent Team Jun 1 07:16 feat: SubAgent Swarm Topology May 24 03:42 feat: subagent inherit parent class ❯ 你尝试 调用 SubAgent 看能不能用
● 好的,我來測試一下 SubAgent(即 Agent tool)的功能。
● Agent(Test SubAgent functionality)
● SubAgent 正常運作 ✅
它成功執行了一個 general-purpose 類型的 agent,獨立完成了:
1. 列出專案目錄結構
2. 查看最近 5 筆 git commit
3. 回報結果給我
我再測試一下背景模式(background):
● Agent(Test background SubAgent)
⎿ Backgrounded agent (↓ to manage · ctrl+o to expand)
● SubAgent 兩種模式都正常運作:
┌───────────────────┬─────────────────────────────────┐
│ 模式 │ 狀態 │
├───────────────────┼─────────────────────────────────┤
│ Foreground (前景) │ ✅ 成功執行並回傳結果 │
├───────────────────┼─────────────────────────────────┤
│ Background (背景) │ ✅ 成功啟動,完成後會自動通知我 │
└───────────────────┴─────────────────────────────────┘
功能總結:
- 可以啟動多種 agent 類型(general-purpose、Explore、Plan 等)
- 支援前景(等結果)與背景(非同步)模式
- 可以同時啟動多個平行執行
有什麼具體任務想讓 SubAgent 幫忙處理的嗎?
✻ Cooked for 30s · 1 local agent still running
● Agent "Test background SubAgent" completed
● 背景 SubAgent 也成功完成了 ✅
Background age… May 23 16:49 feat: desktop cd desktop && bun run tauri dev 11:32 feat: add opencode zen provider /login and enter opencode zen free then /model input free chose you want May 21 17:08 chore: fix prompt identity 16:32 fix: opencode login May 7 16:44 fix: after /login opencode freemodel exit then /model can't fetch model list 16:27 fix: subagent can't created in opencode free model /login no apikey May 6 15:57 feat: better collapsing fetch result when set verbose is false in /config 13:19 feat: keep ctx line online 12:49 fix: move ctx line to rightdown 12:11 feat: ctx line 11:30 fix: /model display name not use fallback 10:12 fix: Not logged in . Run /login in opencode 10:05 chore: add free gpt5 nano and big pickle in /model 09:41 fix: refresh model list