mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 22:35:51 +00:00
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>
This commit is contained in:
@@ -270,7 +270,10 @@ export function getAllBaseTools(): Tools {
|
||||
ReadMcpResourceTool,
|
||||
// Include ToolSearchTool when tool search might be enabled (optimistic check)
|
||||
// The actual decision to defer tools happens at request time in claude.ts
|
||||
...(isToolSearchEnabledOptimistic() ? [ToolSearchTool, ExecuteTool] : []),
|
||||
...(isToolSearchEnabledOptimistic() ? [ToolSearchTool] : []),
|
||||
// ExecuteExtraTool (ExecuteTool) is a first-class tool — always available, not deferred.
|
||||
// Models use it to invoke deferred tools discovered via ToolSearch.
|
||||
ExecuteTool,
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user