From 547ce9e84878bae4237c506551ff3c8e405a2383 Mon Sep 17 00:00:00 2001 From: claude-code-best Date: Sat, 9 May 2026 17:02:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20prefetch=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=20=E2=80=94=20turn-zero=20=E6=8E=A8=E8=8D=90?= =?UTF-8?q?=E5=B7=B2=E7=A6=81=E7=94=A8=EF=BC=8C=E6=B5=8B=E8=AF=95=E6=9C=9F?= =?UTF-8?q?=E6=9C=9B=E5=80=BC=E5=90=8C=E6=AD=A5=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit getTurnZeroSearchExtraToolsPrefetch 在 commit 2cf18c4c 中被禁用(始终返回 null), 但测试仍期望匹配时返回非 null attachment。更新三个用例全部期望 null。 --- .../searchExtraTools/__tests__/prefetch.runner.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/services/searchExtraTools/__tests__/prefetch.runner.ts b/src/services/searchExtraTools/__tests__/prefetch.runner.ts index c34f5be65..67ad34ac6 100644 --- a/src/services/searchExtraTools/__tests__/prefetch.runner.ts +++ b/src/services/searchExtraTools/__tests__/prefetch.runner.ts @@ -149,14 +149,12 @@ describe('startSearchExtraToolsPrefetch', () => { }) describe('getTurnZeroSearchExtraToolsPrefetch', () => { - beforeEach(() => { + // Turn-zero user-input tool recommendations are disabled to avoid frequent + // popups. All cases return null regardless of input/match state. + test('returns null (feature disabled)', async () => { mockGetToolIndex.mockResolvedValue([ { name: 'index-entry', tokens: ['test'], tfVector: new Map() }, ] as never) - mockSearchTools.mockReturnValue([]) - }) - - test('returns non-null attachment for matching tools', async () => { mockSearchTools.mockReturnValue([ { name: 'CronCreateTool', @@ -173,9 +171,7 @@ describe('getTurnZeroSearchExtraToolsPrefetch', () => { 'schedule cron job', [], ) - expect(result).not.toBeNull() - expect(result!.type).toBe('tool_discovery') - expect((result as Record).trigger).toBe('user_input') + expect(result).toBeNull() }) test('returns null for empty input', async () => {