diff --git a/integration-tests/hooks-system.test.ts b/integration-tests/hooks-system.test.ts index 68854877d0..68a4929b3b 100644 --- a/integration-tests/hooks-system.test.ts +++ b/integration-tests/hooks-system.test.ts @@ -517,10 +517,7 @@ console.log(JSON.stringify({ }); describe('BeforeToolSelection Hooks - Tool Configuration', () => { - it.only('should modify tool selection with BeforeToolSelection hooks', async () => { - // 1. Initial setup to establish test directory - rig.setup('BeforeToolSelection Hooks'); - + it('should modify tool selection with BeforeToolSelection hooks', async () => { const toolConfigJson = JSON.stringify({ hookSpecificOutput: { hookEventName: 'BeforeToolSelection', @@ -1763,10 +1760,7 @@ console.log(JSON.stringify({ }); describe('Hook Disabling', () => { - it.only('should not execute hooks disabled in settings file', async () => { - // 1. Initial setup to establish test directory - rig.setup('Hook Disabling'); - + it('should not execute hooks disabled in settings file', async () => { const enabledMsg = 'EXECUTION_ALLOWED_BY_HOOK_A'; const disabledMsg = 'EXECUTION_BLOCKED_BY_HOOK_B'; @@ -1834,10 +1828,7 @@ console.log(JSON.stringify({ expect(disabledHookLog).toBeUndefined(); }); - it.only('should respect disabled hooks across multiple operations', async () => { - // 1. Initial setup to establish test directory - rig.setup('Hook Disabling'); - + it('should respect disabled hooks across multiple operations', async () => { const activeMsg = 'MULTIPLE_OPS_ENABLED_HOOK'; const disabledMsg = 'MULTIPLE_OPS_DISABLED_HOOK'; diff --git a/packages/core/src/core/coreToolScheduler.ts b/packages/core/src/core/coreToolScheduler.ts index 3ea97c8adf..ec566da0fe 100644 --- a/packages/core/src/core/coreToolScheduler.ts +++ b/packages/core/src/core/coreToolScheduler.ts @@ -966,10 +966,6 @@ export class CoreToolScheduler { // The active tool is finished. Move it to the completed batch. const completedCall = activeCall as CompletedToolCall; - if (process.env['CI'] === 'true' || process.env['VERBOSE'] === 'true') { - console.log(`[CoreToolScheduler] Completed tool call: ${completedCall.request.name}, status: ${completedCall.status}`); - } - this.completedToolCallsForBatch.push(completedCall); logToolCall(this.config, new ToolCallEvent(completedCall)); diff --git a/packages/core/src/hooks/hookRegistry.ts b/packages/core/src/hooks/hookRegistry.ts index e90c60f4b5..1e5515a6a0 100644 --- a/packages/core/src/hooks/hookRegistry.ts +++ b/packages/core/src/hooks/hookRegistry.ts @@ -233,16 +233,6 @@ please review the project settings (.gemini/settings.json) and remove them.`; } as HookRegistryEntry); const isDisabled = disabledHooks.includes(hookName); - if (process.env['CI'] === 'true' || process.env['VERBOSE'] === 'true') { - console.log(`[HookRegistry] Processing hook: "${hookName}"`); - if (isDisabled) { - console.log(`[HookRegistry] Hook is DISABLED (found in disabledHooks list)`); - } - if (disabledHooks.length > 0) { - console.log(`[HookRegistry] Current disabledHooks: ${JSON.stringify(disabledHooks)}`); - } - } - // Add source to hook config hookConfig.source = source; diff --git a/packages/core/src/hooks/hookRunner.ts b/packages/core/src/hooks/hookRunner.ts index 4a1926f79d..b5a3325f4d 100644 --- a/packages/core/src/hooks/hookRunner.ts +++ b/packages/core/src/hooks/hookRunner.ts @@ -268,12 +268,6 @@ export class HookRunner { shellConfig.shell, ); - if (process.env['CI'] === 'true' || process.env['VERBOSE'] === 'true') { - console.log(`[HookRunner] shellConfig: ${JSON.stringify(shellConfig)}`); - console.log(`[HookRunner] command: ${command}`); - console.log(`[HookRunner] cwd: ${input.cwd}`); - } - // Set up environment variables const env = { ...sanitizeEnvironment(process.env, this.config.sanitizationConfig), @@ -339,9 +333,6 @@ export class HookRunner { }); child.on('exit', (code, signal) => { - if (process.env['CI'] === 'true' || process.env['VERBOSE'] === 'true') { - console.log(`[HookRunner] Hook exit. code: ${code}, signal: ${signal}`); - } }); // Handle process exit @@ -349,12 +340,6 @@ export class HookRunner { clearTimeout(timeoutHandle); const duration = Date.now() - startTime; - if (process.env['CI'] === 'true' || process.env['VERBOSE'] === 'true') { - console.log(`[HookRunner] Hook closed. exitCode: ${exitCode}, duration: ${duration}ms`); - console.log(`[HookRunner] stdout: ${stdout}`); - console.log(`[HookRunner] stderr: ${stderr}`); - } - if (timedOut) { resolve({ hookConfig, @@ -443,9 +428,6 @@ export class HookRunner { text: string, exitCode: number, ): HookOutput { - if (process.env['CI'] === 'true' || process.env['VERBOSE'] === 'true') { - console.log(`[HookRunner] convertPlainTextToHookOutput: exitCode=${exitCode}, text="${text}"`); - } if (exitCode === EXIT_CODE_SUCCESS) { // Success - treat as system message or additional context return { diff --git a/packages/test-utils/src/test-rig.ts b/packages/test-utils/src/test-rig.ts index 5caeccdcda..87983ba0e3 100644 --- a/packages/test-utils/src/test-rig.ts +++ b/packages/test-utils/src/test-rig.ts @@ -361,19 +361,10 @@ export class TestRig { this.testDir = join(testFileDir, sanitizedName); this.homeDir = join(testFileDir, sanitizedName + '-home'); - if (env['VERBOSE'] === 'true' || env['CI'] === 'true') { - console.log(`[TestRig] Setting up test: ${this.testName}`); - console.log(`[TestRig] testDir: ${this.testDir}`); - console.log(`[TestRig] homeDir: ${this.homeDir}`); - } - if (!this._initialized) { // Clean up existing directories from previous runs (e.g. retries) const cleanDir = (dir: string) => { if (fs.existsSync(dir)) { - if (env['VERBOSE'] === 'true' || env['CI'] === 'true') { - console.log(`[TestRig] Cleaning up existing directory: ${dir}`); - } for (let i = 0; i < 5; i++) { try { fs.rmSync(dir, { recursive: true, force: true }); @@ -771,11 +762,6 @@ export class TestRig { }); this._spawnedProcesses.push(child); - if (env['VERBOSE'] === 'true' || env['CI'] === 'true') { - console.log(`[TestRig] Running: ${command} ${commandArgs.join(' ')}`); - console.log(`[TestRig] CWD: ${this.testDir}`); - } - let stdout = ''; let stderr = ''; @@ -1259,11 +1245,6 @@ export class TestRig { }[] = []; for (const logData of parsedLogs) { - if (env['VERBOSE'] === 'true' || env['CI'] === 'true') { - if (logData.attributes?.['event.name']?.includes('tool')) { - console.log(`[TestRig] Found tool-related log: ${JSON.stringify(logData.attributes)}`); - } - } // Look for tool call logs if ( logData.attributes && @@ -1416,11 +1397,6 @@ export class TestRig { }[] = []; for (const logData of parsedLogs) { - if (env['VERBOSE'] === 'true' || env['CI'] === 'true') { - if (logData.attributes?.['event.name']?.includes('hook')) { - console.log(`[TestRig] Found hook-related log: ${JSON.stringify(logData.attributes)}`); - } - } // Look for tool call logs if ( logData.attributes &&