claude-code-best/src/costrict
IronRookieCoder a8c8c533d0 fix(builtin-tools): handle undefined message_ids in SnipTool.call()
## Bug 详情
调用 Snip 工具时,若模型通过 ExecuteExtraTool 传入空 params,
SnipTool.call() 中访问 input.message_ids.length 会抛出
`Cannot read properties of undefined (reading 'length')`。

## 根因
Snip 是延迟工具(非 CORE_TOOLS),需通过 ExecuteExtraTool 间接调用。
ExecuteExtraTool 将 params 直接透传给目标工具,不做 Zod schema 验证。
当 params 为空对象 {} 时,input.message_ids 为 undefined。

## 修复方案
在 SnipTool.call() 中使用 optional chaining 安全访问 message_ids。

## 变更要点
- packages/builtin-tools/src/tools/SnipTool/SnipTool.ts: 防御性处理空 message_ids
- src/costrict/provider/auth.ts: 删除 unreachable continue(lint 自动修复)
- src/services/rawDump/worker.ts: Math.pow → **(lint 自动修复)

## 自测
- 已人工验证

Co-Authored-By: Auto <noreply@anthropic.com>
2026-05-14 15:47:35 +08:00
..
agents refactor(agents): remove English description from StrictSpec whenToUse 2026-04-20 15:57:51 +08:00
backup refactor: 重构 provider、agents、status 及相关工具模块 2026-04-14 14:21:21 +00:00
command/locales fix: restore verified commit 89c9e87c files after main merge 2026-05-12 15:41:21 +08:00
favorite feat: migrate favorite command from opencode to csc 2026-05-08 08:20:57 +08:00
provider fix(builtin-tools): handle undefined message_ids in SnipTool.call() 2026-05-14 15:47:35 +08:00
review fix: restore verified commit 89c9e87c files after main merge 2026-05-12 15:41:21 +08:00
skills chore: remove /strict:review and /strict:security-review commands 2026-05-12 18:00:10 +08:00