From 250794052466e57bfbe2ed6c24da9be44ea7249a Mon Sep 17 00:00:00 2001 From: Bryan Morgan Date: Sun, 22 Feb 2026 10:21:50 -0500 Subject: [PATCH] fix(core): update tests missed by preflight for benchmark changes - Add isInteractive mock to loggers.test.ts cfg2 for GeminiClient - Update config.test.ts shell timeout test for non-interactive default (600s) and add interactive case (300s) - Update prompts.test.ts snapshots for new error recovery section --- packages/core/src/config/config.test.ts | 7 ++++++- .../core/__snapshots__/prompts.test.ts.snap | 18 ++++++++++++++++-- packages/core/src/telemetry/loggers.test.ts | 1 + 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/packages/core/src/config/config.test.ts b/packages/core/src/config/config.test.ts index c78cfecf20..1f2d9c17b7 100644 --- a/packages/core/src/config/config.test.ts +++ b/packages/core/src/config/config.test.ts @@ -958,8 +958,13 @@ describe('Server Config (config.ts)', () => { }); describe('Shell Tool Inactivity Timeout', () => { - it('should default to 300000ms (300 seconds) when not provided', () => { + it('should default to 600000ms (600 seconds) for non-interactive when not provided', () => { const config = new Config(baseParams); + expect(config.getShellToolInactivityTimeout()).toBe(600000); + }); + + it('should default to 300000ms (300 seconds) for interactive when not provided', () => { + const config = new Config({ ...baseParams, interactive: true }); expect(config.getShellToolInactivityTimeout()).toBe(300000); }); diff --git a/packages/core/src/core/__snapshots__/prompts.test.ts.snap b/packages/core/src/core/__snapshots__/prompts.test.ts.snap index 0028a052de..5e58768c62 100644 --- a/packages/core/src/core/__snapshots__/prompts.test.ts.snap +++ b/packages/core/src/core/__snapshots__/prompts.test.ts.snap @@ -789,7 +789,14 @@ Operate using a **Research -> Strategy -> Execution** lifecycle. For the Executi ## Interaction Details - **Help Command:** The user can use '/help' to display help information. -- **Feedback:** To report a bug or provide feedback, please use the /bug command." +- **Feedback:** To report a bug or provide feedback, please use the /bug command. + +## Error Recovery (Non-Interactive) +- **Don't blindly retry:** When a tool call fails, analyze the error before retrying. Do not immediately retry with the same arguments. +- **Web fetch failures:** If web_fetch fails, try simplifying the prompt or use google_web_search as an alternative to find the information. +- **Shell failures:** Check error codes and run diagnostic commands before retrying. For compilation errors, fix one issue at a time rather than attempting multiple fixes simultaneously. +- **Maximum retries:** Attempt the same approach at most 2 times. If it fails twice, try an alternative strategy or tool. +- **Avoid loops:** If you find yourself repeating the same sequence of actions, stop and reassess your approach." `; exports[`Core System Prompt (prompts.ts) > should handle CodebaseInvestigator with tools=grep_search,glob 1`] = ` @@ -911,7 +918,14 @@ Operate using a **Research -> Strategy -> Execution** lifecycle. For the Executi ## Interaction Details - **Help Command:** The user can use '/help' to display help information. -- **Feedback:** To report a bug or provide feedback, please use the /bug command." +- **Feedback:** To report a bug or provide feedback, please use the /bug command. + +## Error Recovery (Non-Interactive) +- **Don't blindly retry:** When a tool call fails, analyze the error before retrying. Do not immediately retry with the same arguments. +- **Web fetch failures:** If web_fetch fails, try simplifying the prompt or use google_web_search as an alternative to find the information. +- **Shell failures:** Check error codes and run diagnostic commands before retrying. For compilation errors, fix one issue at a time rather than attempting multiple fixes simultaneously. +- **Maximum retries:** Attempt the same approach at most 2 times. If it fails twice, try an alternative strategy or tool. +- **Avoid loops:** If you find yourself repeating the same sequence of actions, stop and reassess your approach." `; exports[`Core System Prompt (prompts.ts) > should handle git instructions when isGitRepository=false 1`] = ` diff --git a/packages/core/src/telemetry/loggers.test.ts b/packages/core/src/telemetry/loggers.test.ts index db0e44be25..6a0f6f3240 100644 --- a/packages/core/src/telemetry/loggers.test.ts +++ b/packages/core/src/telemetry/loggers.test.ts @@ -1106,6 +1106,7 @@ describe('loggers', () => { new ToolRegistry(cfg1, {} as unknown as MessageBus), getUserMemory: () => 'user-memory', + isInteractive: () => false, } as unknown as Config; const mockGeminiClient = new GeminiClient(cfg2);