mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-12 15:10:59 -07:00
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
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
@@ -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`] = `
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user