mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 06:15:51 +00:00
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>
This commit is contained in:
19
src/query.ts
19
src/query.ts
@@ -68,8 +68,8 @@ import {
|
||||
const skillPrefetch = feature('EXPERIMENTAL_SKILL_SEARCH')
|
||||
? (require('./services/skillSearch/prefetch.js') as typeof import('./services/skillSearch/prefetch.js'))
|
||||
: null
|
||||
const toolSearchPrefetch = feature('EXPERIMENTAL_TOOL_SEARCH')
|
||||
? (require('./services/toolSearch/prefetch.js') as typeof import('./services/toolSearch/prefetch.js'))
|
||||
const searchExtraToolsPrefetch = feature('EXPERIMENTAL_SEARCH_EXTRA_TOOLS')
|
||||
? (require('./services/searchExtraTools/prefetch.js') as typeof import('./services/searchExtraTools/prefetch.js'))
|
||||
: null
|
||||
const _jobClassifier = feature('TEMPLATES')
|
||||
? (require('./jobs/classifier.js') as typeof import('./jobs/classifier.js'))
|
||||
@@ -485,10 +485,11 @@ async function* queryLoop(
|
||||
messages,
|
||||
toolUseContext,
|
||||
)
|
||||
const pendingToolPrefetch = toolSearchPrefetch?.startToolSearchPrefetch(
|
||||
toolUseContext.options.tools ?? [],
|
||||
messages,
|
||||
)
|
||||
const pendingToolPrefetch =
|
||||
searchExtraToolsPrefetch?.startSearchExtraToolsPrefetch(
|
||||
toolUseContext.options.tools ?? [],
|
||||
messages,
|
||||
)
|
||||
|
||||
yield { type: 'stream_request_start' }
|
||||
|
||||
@@ -1925,9 +1926,11 @@ async function* queryLoop(
|
||||
}
|
||||
|
||||
// Inject prefetched tool discovery.
|
||||
if (toolSearchPrefetch && pendingToolPrefetch) {
|
||||
if (searchExtraToolsPrefetch && pendingToolPrefetch) {
|
||||
const toolAttachments =
|
||||
await toolSearchPrefetch.collectToolSearchPrefetch(pendingToolPrefetch)
|
||||
await searchExtraToolsPrefetch.collectSearchExtraToolsPrefetch(
|
||||
pendingToolPrefetch,
|
||||
)
|
||||
for (const att of toolAttachments) {
|
||||
const msg = createAttachmentMessage(att)
|
||||
yield msg
|
||||
|
||||
Reference in New Issue
Block a user