Jun 20 14:29 feat: friend refactor to src 10:31 tools: add prompt() to Friend tools to avoid undefined prompt runtime error chenbhao +1: Copilot Ensure tools expose prompt() to satisfy callers that invoke tool.prompt() at runtime.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> 08:46 feat: /friend Jun 18 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 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 状态指示器 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 May 21 17:08 chore: fix prompt identity Apr 30 15:07 feat: add Tavily as optional search backend in WebSearchTool Tavily PR Agent
Apr 18 14:58 feat: toolsearch use websearch Apr 12 13:02 chore: rm log function of webfetch 13:01 feat: complete shouldDefer tool WebFetch Apr 8 13:24 chore: clean WebSearchTool log test 06:48 fix: WebSearch return data. 06:33 test: WebSearchTool log 06:05 test: WebSearchTool log 05:31 feat: WebSearchTool 05:09 chore: clean 02:38 feat: jina websearch and webfetch Apr 7 16:39 feat: config, jina fetch and search 06:14 fix: web saerch use python 02:46 feat: tls make web_search ok 主要改进
1. WebSearch 工具
- 集成 @yukiakai/tls-fetch 包,使用真实浏览器 TLS 指纹绕过
DuckDuckGo 的 CAPTCHA
- 修正 HTML 解析模式(class="...web-result...")
- 改进 URL 解码和链接提取逻辑
- 添加详细的调试日志
2. WebFetch 工具
- 实现指数退避重试机制
- 改进 Jina Reader 错误处理(检测 429 错误)
- 优化双层回退策略(Jina Reader → 直接抓取)
- 增强错误处理和日志
3. 依赖管理
- 添加 @yukiakai/tls-fetch 依赖(v2.0.2)
- 重新安装原生绑定解决兼容性问题
测试结果
✅ WebSearch 功能正常:
- 成功绕过 CAPTCHA 检测
- 正确解析搜索结果
- 支持中文和英文查询
- 返回完整的标题、URL 和摘要
✅ CLI 构建成功:
- 所有模块正确打包
- 原生模块加载正常
- 无运行时错误
修改的文件
- src/tools/WebSearchTool/WebSearchTool.ts
- src/tools/WebSearchTool/prompt.ts
- src/tools/WebFetchTool/WebFetchTool.ts
- src/tools/WebFetchTool/utils.ts
- package.json
- bun.lock Apr 6 18:57 fix: web search and fetch 16:05 feat: zero-search 14:59 fix: WebSearch API error 14:08 chore: WebFetchTool note 13:00 chore: webfetch ui note Apr 2 17:45 init: verspercode v0.1.0