diff --git a/packages/cli/src/ui/hooks/useAgentStream.test.tsx b/packages/cli/src/ui/hooks/useAgentStream.test.tsx index 22e6b7f26e..387f11bb27 100644 --- a/packages/cli/src/ui/hooks/useAgentStream.test.tsx +++ b/packages/cli/src/ui/hooks/useAgentStream.test.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { describe, it, expect, vi, beforeEach } from 'vitest'; +import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import { act } from 'react'; import type { AgentProtocol } from '@google/gemini-cli-core'; import { renderHookWithProviders } from '../../test-utils/render.js'; @@ -40,6 +40,10 @@ describe('useAgentStream', () => { vi.clearAllMocks(); }); + afterEach(() => { + vi.restoreAllMocks(); + }); + it('should initialize on mount', async () => { await renderHookWithProviders(() => useAgentStream({ diff --git a/packages/cli/src/ui/hooks/useAgentStream.ts b/packages/cli/src/ui/hooks/useAgentStream.ts index e074894395..c627f86076 100644 --- a/packages/cli/src/ui/hooks/useAgentStream.ts +++ b/packages/cli/src/ui/hooks/useAgentStream.ts @@ -396,6 +396,7 @@ export const useAgentStream = ({ } else { // 'handled' or other types that don't need LLM submission shouldAddToHistory = false; + return; } } }