Commit Graph

157 Commits

Author SHA1 Message Date
IronRookieCoder
b36e8e4ff2 fix(costrict): handle image input for model compatibility
## Bug 详情
CoStrict 在读取图片后会把图片放在 tool_result.content 中,OpenAI 兼容层只保留文本,导致模型没有收到真实图片内容。

非多模态模型收到图片请求时,后端会返回底层 400 错误,例如 not a multimodal model。

## 根因
OpenAI 消息转换逻辑没有处理 tool_result 中嵌套的 image block。

CoStrict 查询路径没有在发送请求前检查模型的图片输入能力,也没有归一化非多模态模型错误。

## 修复方案
将 tool_result 中的图片转换为后续 user 多模态消息,确保兼容层能传递 image_url。

在 CoStrict 模型元数据明确声明 supportsImages=false 时,提前返回英文错误提示;同时对后端非多模态错误做英文提示归一化。

## 变更要点
- Preserve image blocks nested in tool_result for OpenAI-compatible providers
- Add CoStrict image-capability gate based on supportsImages metadata
- Normalize non-multimodal backend errors to a clear English message
- Add regression tests for nested tool_result images and non-multimodal model handling

## 自测
- bun test src/costrict/provider/index.test.ts
- bun test packages/@ant/model-provider/src/shared/__tests__/openaiConvertMessages.test.ts
2026-05-19 11:38:16 +08:00
linkai0924
70b5e285aa
Merge pull request #124 from IronRookieCoder/fix/git-bash-raw-mode
Fix/git bash raw mode
2026-05-18 19:15:14 +08:00
IronRookieCoder
61610d08cd fix(openai): reject invalid streamed tool arguments
## Bug 详情
OpenAI 兼容流返回工具调用时,模型可能输出无法解析为 JSON object 的 arguments,例如 TaskUpdate 参数片段最终拼成非法 JSON。此前这类返回会被任务工具宽松修复或降级为 {},用户看不到模型返回不合法,工具也可能进入错误执行路径。

## 根因
normalizeContentFromAPI 在解析 tool_use.input 失败后会尝试 repairTaskToolInput,并在无法修复时回退为空对象;OpenAI 组装层没有把非法工具调用转换成用户可见提示。

## 修复方案
将工具调用参数作为模型边界输入严格校验:最终工具名必须存在,工具参数必须解析为 JSON object。非法响应抛出 InvalidToolCallResponseError,并在 OpenAI 组装层转换为普通英文 assistant 提示,工具不再执行。

## 变更要点
- 移除任务工具参数的宽松修复和 {} 降级逻辑
- 新增非法工具调用参数和缺失工具名的显式错误
- OpenAI 组装层捕获非法工具调用并显示普通英文提示
- 增加流式分片省略 name 时保留初始工具名的测试

## 自测
- bun test src/utils/__tests__/messages.test.ts
- bun test packages/@ant/model-provider/src/shared/__tests__/openaiStreamAdapter.test.ts
- git diff --check
- bun run typecheck 仍失败,失败项为仓库既有类型问题,未涉及本次改动文件
2026-05-18 17:59:13 +08:00
IronRookieCoder
7b3260e757 fix(ink): restore Git Bash raw input handling
## Bug 详情
Windows Git Bash 终端下,csc 4.1.x 的 REPL 输入异常:回车需要按两次,方向键无法选择历史对话,输入 / 无法正常显示或触发命令。

## 根因
Windows raw mode 风险判断将 Git for Windows 的 MINGW64/MINGW32 与 MSYS2/Cygwin/mintty 环境一并禁用 raw mode,导致 Git Bash 走 cooked input fallback,Ink 无法按预期解析 Enter、方向键和 slash 输入。

## 修复方案
将 Git for Windows 的 MINGW64/MINGW32 从 raw mode 不安全名单中排除,恢复 Git Bash 的 raw mode 输入处理,同时保留 MSYS/UCRT/CLANG/Cygwin 和显式禁用开关的保护路径。

## 变更要点
- 调整 Ink raw mode 风险检测,Git Bash 保持 raw mode
- 同步启动早期输入捕获的 Git Bash raw mode 判断
- 增加 Git Bash raw mode 回归测试,并保留 MSYS2/Cygwin 场景覆盖

## 自测
- bun test packages/@ant/ink/src/core/__tests__/raw-mode-support.test.ts src/utils/__tests__/earlyInput.test.ts
- git diff --check
- bun run typecheck(失败,失败点为仓库既有 Zod 类型、缺失声明、MACRO.COMMIT、AppState 等错误,不涉及本次修改文件)
2026-05-18 17:13:17 +08:00
geroge
7178eac204
Merge pull request #116 from IronRookieCoder/fix/tasks-tool-arguments-repair
Fix/tasks tool arguments repair
2026-05-16 10:59:25 +08:00
geroge
d042115b6a
Merge pull request #115 from IronRookieCoder/fix-exit-terminal-state
Fix exit terminal state
2026-05-16 10:59:03 +08:00
IronRookieCoder
1b8e022522 fix(openai): recover missing streamed tool calls
## Bug 详情
OpenAI 兼容流在部分工具调用场景下会出现累计参数片段、复用 tool_calls index 或结束原因为 tool_calls 但缺少 tool_use 块,导致后续 TaskUpdate 等工具调用丢失或参数解析失败。

## 根因
OpenAI stream adapter 直接透传参数片段,无法区分累计快照和增量片段;同一 tool_calls index 被后端复用时也没有重开 tool_use 块。Task 工具参数 JSON 解析失败后统一退回空对象,query 主循环也没有对 stop_reason=tool_use 但无 tool_use 块的响应做恢复。

## 修复方案
在 OpenAI stream adapter 中去重累计参数并处理工具身份变化;仅对 Task 工具做窄范围参数修复,避免将无效 TaskUpdate 修复成 no-op;query 主循环发现缺失 tool_use 块时追加一次元消息让模型补发工具调用。

## 变更要点
- 修复 OpenAI 工具流参数快照去重和 tool_calls index 复用处理
- 增加 TaskCreate/TaskGet/TaskList/TaskUpdate 的解析失败窄范围容错
- 阻止无效 TaskUpdate status 或仅 taskId 输入被修复成空更新
- 增加缺失 tool_use 块的一次性 query recovery transition
- 补充 stream adapter、Task 参数修复和 query recovery 回归测试

## 自测
- bun test packages/@ant/model-provider/src/shared/__tests__/openaiStreamAdapter.test.ts src/utils/__tests__/messages.test.ts src/__tests__/queryMissingToolUseRecovery.test.ts
- bun run typecheck 当前仍失败,错误位于既有未改动文件。
2026-05-15 21:19:04 +08:00
IronRookieCoder
4aa15ac52a fix(terminal): clear Ink UI on REPL shutdown
## Bug 详情
使用 /exit 退出交互式 REPL 后,终端可能保留提示输入、命令补全或其他 Ink 临时 UI,导致 shell prompt 与旧 UI 重叠,出现光标和显示异常。

## 根因
shutdown 路径会恢复 raw mode、bracketed paste、focus reporting 等终端模式,但普通主屏幕 REPL 不会清理 Ink 当前占用的可见区域。进程退出前 React 也不一定能完成 /exit 输入清空后的重新渲染。

## 修复方案
在 Ink 实例中增加主屏幕 shutdown 清理方法,根据最后一帧和声明光标位置清除 Ink 占用区域;gracefulShutdown 在非 alternate-screen 场景调用该方法,alternate-screen 继续保留原有退出逻辑。

## 变更要点
- 新增 ERASE_TO_END_SCREEN CSI 常量用于从当前光标位置清到屏幕底部
- 增加 Ink.clearMainScreenForShutdown() 统一计算并清理主屏幕 REPL 区域
- 在 gracefulShutdown 的终端清理阶段区分 alternate-screen 和主屏幕 Ink 实例

## 自测
- 已运行局部 Biome 检查:bunx biome check packages/@ant/ink/src/core/ink.tsx packages/@ant/ink/src/core/termio/csi.ts src/utils/gracefulShutdown.ts
- 已通过 Bun 直接导入验证新增 Ink 方法和 gracefulShutdown 模块可解析
- 全量 typecheck/build 当前被既有无关问题阻断:ctx_viz/LogoV2/doubaoSTT 类型错误,以及 generate-review-builtin 访问 git@github.com:zgsm-ai/costrict-review.git 失败
2026-05-15 19:03:35 +08:00
linkai0924
81b8abc9e3
Merge pull request #84 from IronRookieCoder/fix/issue-34-agent-team-idle
fix(agent-team): handle idle teammate coordination failures
2026-05-15 17:01:46 +08:00
geroge
37fe62a5de
Merge pull request #91 from IronRookieCoder/fix/issue-49-show-memory-pid
feat(config): add showMemoryPid setting to toggle footer memory/PID display
2026-05-15 14:34:04 +08:00
geroge
ba9c2e1538
Merge pull request #89 from IronRookieCoder/fix/issue-46-47
fix(windows): prevent terminal startup failures
2026-05-15 14:33:28 +08:00
geroge
8e52334f0a
Merge pull request #83 from IronRookieCoder/fix/issue-37-bash-autobg
fix(bash): wake foreground task after auto-backgrounding
2026-05-15 14:32:20 +08:00
DoSun
ecb0df50d3 fix: add type guards and null checks for UUID handling in snip functionality
- Add UUID type import and type guard in force-snip command
- Add null/undefined checks in snipCompact, snipProjection, and sessionStorage
- Improve optional chaining in SnipTool for safer property access
- Prevent potential runtime errors from invalid UUID values

Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
2026-05-15 14:26:33 +08:00
林凯90331
6b5b801dae fix(ink): treat newline as return and suppress favorite fetch error in TUI
Some terminals on CentOS emit \n or \r\n instead of \r for the Enter key.

Map both sequences to 'return' in parseKeypress so key.return is set correctly.

Replace console.warn with logForDebugging in favorite.ts to prevent

network errors from polluting the TUI output.

Signed-off-by: 林凯90331 <90331@sangfor.com>

Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-15 11:06:18 +08:00
林凯90331
beb268eca0 fix(ink): handle enter key on centos
Some terminals on CentOS emit 'enter' instead of 'return' for the Enter key.

Treat both names as the Return key to ensure consistent input behavior across platforms.

Signed-off-by: 林凯90331 <90331@sangfor.com>

Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-15 10:17:22 +08:00
IronRookieCoder
b528d378db feat(config): add showMemoryPid setting to toggle footer memory/PID display
## 实现要点
新增全局配置项 showMemoryPid,允许用户通过 /config 面板关闭底部状态栏的内存值和 PID 显示(默认开启,行为不变)。

## 变更要点
- src/utils/config.ts:新增 showMemoryPid?: boolean 类型声明 + GLOBAL_CONFIG_KEYS 注册
- src/components/PromptInput/PromptInputFooterLeftSide.tsx:新增 isMemoryPidEnabled() 函数,RSS/PID 渲染受配置控制
- src/components/Settings/Config.tsx:/config UI 面板注册配置项,含 logEvent 埋点
- packages/builtin-tools/src/tools/ConfigTool/supportedSettings.ts:SUPPORTED_SETTINGS 注册
2026-05-14 17:41:13 +08:00
IronRookieCoder
223b694965 fix(windows): prevent terminal startup failures
## Bug 详情
- issues.md #46:Windows MSYS2/UCRT64 下执行 csc,欢迎信息输出后在 stdin raw mode/终端输入初始化阶段崩溃,出现 native std::bad_weak_ptr 和后续 Bun mutex corrupt。
- issues.md #47:cmd.exe 可启动,但 PowerShell 运行 csc 会走 npm 生成的 csc.ps1;截图显示 node.exe 报错 "Input must be provided either through stdin or as a prompt argument when using --print",说明裸 csc 被误判成 print/non-interactive 模式。

## 根因
- MSYS2/Cygwin/mintty 等 Windows 终端对 Node/Bun stdin raw mode 和终端扩展控制序列兼容性不稳定,启动早期强行 setRawMode/查询终端能力会触发崩溃风险。
- npm 的 PowerShell shim 解析优先级高于 csc.cmd,且可能让 stdout TTY 状态不可用;原 main.tsx 只要 stdout 非 TTY 就自动进入 non-interactive/--print 路径,最终在没有 prompt/stdin 时触发 #47 的报错。

## 修复方案
- 为 Ink stdin raw mode 增加 Windows 风险终端检测,在 MSYS2/Cygwin/mintty 或显式禁用开关下跳过 raw mode,使用 cooked input fallback。
- early input 捕获在启动早期复用同类风险判断,避免 REPL 渲染前就触发 raw mode 崩溃。
- postinstall 在 Windows 上清理属于本包的 csc.ps1,让 PowerShell 回落到与 cmd.exe 一致的 csc.cmd 启动路径。
- 新增 non-interactive 判定工具,保留显式 -p/--print、--init-only、--sdk-url 的 headless 行为,但要求 stdin/stdout 都不是交互 TTY 才自动进入 non-interactive,避免 PowerShell shim 下裸 csc 被误判。

## 变更要点
- 新增 packages/@ant/ink/src/core/raw-mode-support.ts 及单元测试,覆盖普通 Windows shell、MSYS2/Cygwin/mintty 和禁用开关
- 调整 Ink App raw mode 生命周期,只在真正启用 raw mode 后写入/清理 bracketed paste、focus reporting、extended key 等终端控制序列
- 调整 component unmount/exit 清理逻辑,按 rawModeEnabledCount/rawModeActive 关闭实际启用的输入监听和 raw mode
- 调整 src/utils/earlyInput.ts,避免不安全 Windows 终端在启动阶段启用 stdin raw mode
- 调整 scripts/postinstall.cjs,立即和延迟清理 npm 生成的 csc.ps1 shim
- 调整 src/main.tsx 使用 shouldUseNonInteractiveSession,并新增对应测试覆盖 PowerShell shim 场景

## 自测
- bun test packages/@ant/ink/src/core/__tests__/raw-mode-support.test.ts src/utils/__tests__/earlyInput.test.ts src/utils/__tests__/nonInteractiveSession.test.ts
- node --check scripts/postinstall.cjs
- bun run src/entrypoints/cli.tsx --version
- bun run lint
- git diff --check

## 已知限制
- bun run typecheck 仍失败,错误来自仓库既有缺失声明/缺失模块和无关类型问题,不来自本次改动。
2026-05-14 17:07:51 +08:00
DoSun
cbc948b044 Merge branch 'feat/server-refactor'
# Conflicts:
#	build.ts
#	src/main.tsx
#	src/services/rawDump/worker.ts
2026-05-14 15:21:25 +08:00
IronRookieCoder
28f2e3a6ac fix(agent-team): handle idle teammate coordination failures
## Bug 详情
Agent Team 在 CoStrict 环境下可能出现子代理无法执行、完成后主代理持续 Idle、shutdown 后 TeamDelete 被阻塞,以及 TeamCreate 参数错误时抛出 name.replace 深层异常。

## 根因
- Team teammate 默认模型路径未复用普通 subagent 的 CoStrict 继承逻辑,未配置 teammateDefaultModel 时会回退到 CoStrict 不可用的 claude-opus-4-6。
- in-process teammate 的 AsyncLocalStorage 上下文可能影响 team lead 的 inbox polling 身份判断。
- SendMessage 收到字符串形式的 shutdown_response JSON 时按普通消息转发,未进入 shutdown approval 分支。
- ExecuteExtraTool 调用 deferred tool 前未执行目标工具 validateInput,错误参数会绕过入口校验进入目标工具内部。

## 修复方案
- 将 teammate 模型解析集中到 teammateModel,并在 CoStrict 默认场景继承 leader model。
- 抽出 inbox poller 身份判断,基于 AppState 识别 team lead polling。
- 兼容字符串 JSON 协议响应,将 shutdown_response / plan_approval_response 路由到结构化处理逻辑。
- ExecuteExtraTool 在权限检查和实际执行前调用目标工具 validateInput。

## 变更要点
- 新增 teammate 模型解析和 CoStrict 继承测试。
- 新增 inbox poller identity helper 和 in-process 上下文回归测试。
- 新增 SendMessage 字符串 shutdown_response 回归测试。
- 新增 ExecuteExtraTool 目标工具校验回归测试。

## 自测
- bun test packages/builtin-tools/src/tools/ExecuteTool/__tests__/ExecuteTool.test.ts
- bun test packages/builtin-tools/src/tools/SendMessageTool/__tests__/udsRecipientSanitization.test.ts src/utils/swarm/__tests__/teammateModel.test.ts src/hooks/__tests__/useInboxPoller.test.ts
- bunx biome check 相关变更文件
- 变更文件相关 tsc 过滤检查无输出
2026-05-14 14:50:30 +08:00
IronRookieCoder
95a4430fa2 Revert "fix(bash): wake foreground task after auto-backgrounding"
This reverts commit 1a85db7ca8.
2026-05-14 13:33:00 +08:00
IronRookieCoder
1a85db7ca8 fix(bash): wake foreground task after auto-backgrounding
## Bug 详情
用户升级 4.0.16 后,使用过程中 CLI 会话可能一直处于 busy 状态,表现为无法继续输入且没有响应。

## 根因
BashTool 的长命令在已经注册为 foreground task 后被自动后台化时,只设置了 backgroundShellId,但没有唤醒正在等待 progress/result 的 generator。若命令无输出或轮询没有再次触发,主 REPL 会继续等待,输入循环无法释放。

## 修复方案
在 foreground task 自动后台化成功后,立即 resolve 当前 progress 等待器,让 runShellCommand 能观察到 backgroundShellId 并返回后台任务结果。

## 变更要点
- 在 BashTool foreground auto-background 路径补齐 resolveProgress 唤醒逻辑
- 保持已有 spawnBackgroundTask 路径的唤醒行为一致

## 自测
- bun test packages/builtin-tools/src/tools/BashTool/__tests__ 通过
- bun run typecheck 当前仍有仓库既有无关错误,未涉及本次变更
2026-05-14 13:21:58 +08:00
geroge
42107f7d2f
Merge pull request #64 from y574444354/feat/migrate-review-agents
【Review】feat: 将 review skill 迁移到 extract-to-disk 架构
2026-05-13 19:38:26 +08:00
geroge
d3d0dd25d2
Merge pull request #80 from IronRookieCoder/fix/issues-31-32
fix: 修复任务列表数字ID乱序和内存轮询导致滚动跳动
2026-05-13 19:37:25 +08:00
geroge
d8a19f1473
Merge pull request #79 from IronRookieCoder/personal-ironrookiecoder-fix-issue-42-43
fix: merge sub-agent readFileState to prevent cross-agent write confl…
2026-05-13 19:37:09 +08:00
IronRookieCoder
5ee2d6dcc3 fix: 修复任务列表数字ID乱序和内存轮询导致滚动跳动
两个修复:

1. 任务列表数字ID乱序(#32):新增 compareTaskIds 比较函数,纯数字ID按
   数值大小排序(1, 2, 3, 10 而非 1, 10, 2, 3),非纯数字回退到
   localeCompare 自然排序。listTasks 和 taskStateMessage 两处排序入口
   均已修复。

2. 终端 RSS 内存轮询引发滚动跳动(#31):useRssDisplay hook 新增 isLoading
   参数,仅在加载中启用定时轮询,闲时仅渲染一次内存占用值,避免 Ink 重渲染
   干扰用户滚动查看结果。

附:TaskCreateTool.isConcurrencySafe 改为 false,防止并发任务创建的文件
IO 竞态。

Co-Authored-By: CoStrict-DeepSeek-V4-Pro <deepseek-ai@claude-code-best.win>
2026-05-13 16:44:13 +08:00
IronRookieCoder
233971c6ce fix: merge sub-agent readFileState to prevent cross-agent write conflicts
子代理完成后将其 readFileState 合并回主代理缓存,防止主代理写文件时因
缓存过期而误报 FILE_UNEXPECTEDLY_MODIFIED_ERROR。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-13 16:36:46 +08:00
DoSun
c2eb6bff90 fix: 清理 main 分支的 stub .js 文件,恢复有 .ts 源文件的命令模块 2026-05-13 10:36:04 +08:00
DoSun
3bfc695cb4 chore: 清理临时 rebase 脚本 2026-05-13 10:29:34 +08:00
IronRookieCoder
b58fd8f782 fix: 修复子代理参数兼容问题 2026-05-12 21:24:12 +08:00
kingboung
4c56bbe268 fix: remove agent-based review code reintroduced from main merge
Revert PR #43 agent-based code that was brought in during the main merge:
- Remove generateBuiltinAgents and all agent-related logic from generate script
- Delete src/costrict/review/agent/ directory
- Delete src/commands/security-review.ts (handled by bundled skill)
- Restore PR #64 extension.ts with getClaudeConfigHomeDir approach
- Remove REVIEW_AGENTS from builtInAgents.ts
- Keep review command (needed for MCP entry), but use CommandLocale instead of agent

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-12 15:32:07 +08:00
y574444354
666d2ba2eb Merge branch 'main' into merge 2026-05-12 12:25:05 +08:00
y574444354
8b6bdd44d8 Revert "Merge pull request #60 from y574444354/feat/migrate-review-agents"
This reverts commit 62398b2dcc, reversing
changes made to ba39b17a7e.
2026-05-12 12:11:37 +08:00
y574444354
d59d1f590a chore: 合并社区 upstream/main 代码至 v2.4.2
合并 claude-code-best/claude-code 社区最新代码,包含:
- 配置文件更新:precheck/lint-staged/overrides 等
- 新 feature flags:EXPERIMENTAL_SEARCH_EXTRA_TOOLS、AUTOFIX_PR
- 工具系统架构更新:Tool Search、ACP 协议支持
- 文档更新:CLAUDE.md 同步架构变更
- 依赖更新:SDK 版本升级、lint-staged 加入

冲突处理策略:以 costrict 版本为主,选择性合并上游功能改进
2026-05-12 11:55:04 +08:00
kingboung
e3ba147dbe refactor: migrate review system to bundled skill files mechanism
Replace custom extension.ts initialization and agent-based routing with
csc's built-in registerBundledSkill({ files }) mechanism. Review and
security-review skills are now registered with embedded files that
get lazily extracted to disk on first invocation. Locale is resolved
at startup via getResolvedLanguage().

- Remove agent generation from generate-review-builtin.ts (skill-only)
- Remove extension.ts, REVIEW_AGENTS registration, strict:* skills
- Add reviewSkills.ts with registerReviewSkills() for unified registration
- Adapt to new costrict-review index.json format (skills-only, new paths)
- Remove src/costrict/command/locales/ (no longer needed)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 20:19:05 +08:00
claude-code-best
8f512c6222 Revert "feat: 添加 GBK 编码自动检测支持,文件读写工具透明处理非 UTF-8 文件"
This reverts commit 0ce8f7a1cb.
2026-05-10 22:57:30 +08:00
claude-code-best
58b58e649d feat: 添加 GBK 编码自动检测支持,文件读写工具透明处理非 UTF-8 文件
新增 encoding.ts 核心模块实现三层编码检测(BOM → UTF-8 fatal → GBK 回退),
改造同步/异步读取路径和写入路径,使 FileReadTool/FileEditTool/FileWriteTool
能正确处理 GBK 编码文件。包含完整单元测试和 spec 文档。

Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-10 20:50:12 +08:00
claude-code-best
af0d34ebbe Merge pull request #446 from claude-code-best/feature/prompt-cut-down
feat: 大量系统提示词优化
2026-05-10 15:30:34 +08:00
claude-code-best
52956804ff feat: 注册所有新命令到命令系统和工具注册表
- commands.ts: 注册所有新命令(memory-stores、vault、schedule 等),
  移除 require() 动态加载,统一为 ESM import
- tools.ts: 注册 LocalMemoryRecallTool、VaultHttpFetchTool
- 补充命令测试(bridge-kick、commit、commit-push-pr、init-verifiers)
- 补充工具测试(AgentTool、RemoteTrigger、SkillTool、WebFetch、WebSearch)
- 集成测试:autonomy-lifecycle-user-flow 更新
- 探测脚本和功能文档

Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 23:04:39 +08:00
claude-code-best
3114a82b89 feat: 添加 LocalMemoryRecallTool 和 VaultHttpFetchTool
- LocalMemoryRecallTool: 跨会话本地笔记召回,权限门控,大小限制
- VaultHttpFetchTool: 使用 vault 密钥的认证 HTTP 请求,ACL 规则
- agentToolFilter: 子 agent 工具继承过滤层
- ALL_AGENT_DISALLOWED_TOOLS 白名单更新

Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 23:04:12 +08:00
claude-code-best
4c6560e451 refactor: 精简系统提示词 — 合并沟通风格段落、精简 memory/工具描述、截断 gitStatus
- 合并 getOutputEfficiencySection + getSimpleToneAndStyleSection 为精简的 Communication style
- 精简 auto memory 指令:删除 4 种类型的详细说明和示例,仅保留核心 description
- 精简 Agent 工具:删除 forkExamples 和 currentExamples 大段示例
- 精简 Bash 工具:合并 sleep 相关指导
- 精简 EnterPlanMode/ExitPlanMode:删除详细 GOOD/BAD 示例
- gitStatus MAX_STATUS_CHARS 从 2000 降到 1000
- 同步更新 prompt engineering audit 测试断言

Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 17:14:41 +08:00
claude-code-best
d27c6ccb47 docs: 添加 ToolSearch 设计指南 + 禁用 turn-zero 工具推荐弹窗
- 新增 docs/design/tool-search-design-guide.md,涵盖架构、搜索算法、执行管道、演进历史
- 禁用 getTurnZeroSearchExtraToolsPrefetch,消除用户输入时的频繁弹窗
- inter-turn 发现机制保持不变

Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 16:45:56 +08:00
claude-code-best
8565b65d92 feat: 将 Agents/Teams 工具纳入 Tool Search 按需发现
将 TeamCreate、TeamDelete、SendMessage 从 CORE_TOOLS 移除,
使其成为 deferred 工具,通过 ToolSearch 按需发现以减少 context token。
swarm 模式下 SendMessage 保持 always loaded,TeamCreate/TeamDelete
在 swarm 未启用时调用返回启用提示。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 15:45:20 +08:00
claude-code-best
a77d8316c9 fix: 修复 Tool Search 缓存失效 — deferred 工具不再动态注入 tools 数组
移除 deferred 工具的 "discover then include" 逻辑,让 tools 数组在整个会话中
保持稳定(只有 core tools + ToolSearch + ExecuteExtraTool),避免每次发现新
工具时 tools JSON 变化导致 prompt cache 失效。

同时强化工具优先级引导:core tools 优先直接调用,ToolSearch/ExecuteExtraTool
仅作为发现和调用 deferred 工具的最后手段。当模型搜索已加载的 core tool 时,
ToolSearch 返回明确的拒绝提示。

Co-Authored-By: glm-5.1[1m] <zai-org@claude-code-best.win>
2026-05-09 14:56:22 +08:00
claude-code-best
f04889504e refactor: 统一自建 Tool Search — 移除 tool_reference/defer_loading 依赖,全 provider 通用
- 重命名 ExecuteTool → ExecuteExtraTool,作为一等工具始终可用
- ToolSearchTool 输出改为纯文本(区分 core/deferred),移除 tool_reference blocks
- 移除 modelSupportsToolReference() 及相关 GrowthBook 配置
- 移除 API 侧 defer_loading 字段和 tool search beta header 注入
- 简化 system prompt(工具使用指南从 ~120 行压缩到 ~10 行)
- extractDiscoveredToolNames 支持文本格式解析(向后兼容旧 session 的 tool_reference)
- 更新 promptEngineeringAudit 测试以匹配简化后的 prompt 结构

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 14:19:31 +08:00
claude-code-best
fe480d35a4 feat: Remote Control 条件工具注入 — PushNotification/SendUserFile/Brief 仅 bridge 启用时可用
- PushNotificationTool、SendUserFileTool 添加 isEnabled() 使用 isBridgeEnabled()
- BriefTool 的 isEnabled() 从 isBriefEnabled() 改为 isBridgeEnabled()
- ExecuteTool 添加 isEnabled() 兜底检查,不可用时返回友好错误
- useReplBridge bridge 首次连接时插入 system 消息通知模型新工具可用
- 移除 toolSearch 中 firstParty base URL 白名单检测,默认启用 tool search

Co-Authored-By: glm-5.1[1m] <zai-org@claude-code-best.win>
2026-05-09 09:45:52 +08:00
claude-code-best
42f0d35b5d feat: 实现 Tool Search 基础设施层(CORE_TOOLS 白名单 + TF-IDF 索引 + ExecuteTool + 搜索增强)
- 新增 CORE_TOOLS 白名单常量(31 个核心工具),重构 isDeferredTool 为白名单制判定
- 新建 TF-IDF 工具索引模块(toolIndex.ts),复用 localSearch.ts 算法函数
- 新建 ExecuteTool 跨 API provider 统一工具执行入口
- 增强 ToolSearchTool:TF-IDF 搜索路径、discover: 模式、并行搜索合并、文本模式回退
- 新增 27 个单元测试,precheck 零错误通过(4108 tests pass)

Co-Authored-By: glm-5.1[1m] <zai-org@claude-code-best.win>
2026-05-08 22:29:15 +08:00
kingboung
4054ae9f4b feat: migrate review agents and skills to unified costrict-review repo
- Add generate-review-builtin.ts script (downloads from zgsm-ai/costrict-review)
- Add review module (index.ts, extension.ts) with locale-aware skill init
- Add CommandLocale module with zh-CN/en templates for /review and /security-review
- Integrate REVIEW_AGENTS into builtInAgents.ts
- Route /review command to CoStrictReviewer agent
- Simplify /security-review to use Skill tool with locale templates
- Remove old generate-skills.ts and inline security-review skill

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 09:40:24 +08:00
claude-code-best
cc4a007cae fix: 恢复消息流中 diff 高亮渲染功能
还原 commit 51b8ad46 删除的 diff highlight 显示:FileEdit/FileWrite 工具
执行成功后重新展示 StructuredDiffList,拒绝时重新展示高亮代码预览或
带上下文的 diff 视图。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 08:28:28 +08:00
claude-code-best
2192120646 feat: 尝试改进 Error 处理以提升内存管理效率 2026-05-05 18:18:13 +08:00
claude-code-best
cfee8c5d56 feat: fork-agent-redesign — 新增 AgentTool fork 参数与 spec 设计文档
为 AgentTool 引入 fork 布尔参数,支持子代理从父对话上下文中 fork 出独立分支,
继承完整历史、系统提示和模型配置。重构 inputSchema 条件逻辑以适配 fork 模式。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 23:39:43 +08:00