diff --git a/packages/cli/src/ui/commands/compressCommand.test.ts b/packages/cli/src/ui/commands/compressCommand.test.ts index 9c89adf016..2a78f11c98 100644 --- a/packages/cli/src/ui/commands/compressCommand.test.ts +++ b/packages/cli/src/ui/commands/compressCommand.test.ts @@ -5,13 +5,13 @@ */ import * as Core from '@google/gemini-cli-core'; -import { vi, describe, it, expect, beforeEach } from 'vitest'; +import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest'; import { compressCommand } from './compressCommand.js'; import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; import { MessageType } from '../types.js'; vi.mock('@google/gemini-cli-core', async (importOriginal) => { - const actual = (await importOriginal()) as Record; + const actual = (await importOriginal()) as any; return { ...actual, tokenLimit: vi.fn(), @@ -22,6 +22,10 @@ describe('compressCommand', () => { let context: ReturnType; let mockTryCompressChat: ReturnType; + afterEach(() => { + vi.restoreAllMocks(); + }); + beforeEach(() => { mockTryCompressChat = vi.fn(); vi.mocked(Core.tokenLimit).mockReturnValue(1000); diff --git a/packages/cli/src/ui/commands/compressCommand.ts b/packages/cli/src/ui/commands/compressCommand.ts index d3b780f6c1..cf7ee80a7d 100644 --- a/packages/cli/src/ui/commands/compressCommand.ts +++ b/packages/cli/src/ui/commands/compressCommand.ts @@ -77,8 +77,7 @@ export const compressCommand: SlashCommand = { beforePercentage, afterPercentage, // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion - compressionStatus: - Number(compressed.compressionStatus) as unknown as CompressionStatus, + compressionStatus: Number(compressed.compressionStatus) as unknown as CompressionStatus, isManual: true, thresholdPercentage: Math.round(threshold * 100), }, diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts index c05b3c0800..e01100aa0a 100644 --- a/packages/cli/src/ui/hooks/useGeminiStream.ts +++ b/packages/cli/src/ui/hooks/useGeminiStream.ts @@ -44,6 +44,7 @@ import { type CompressionStatus, >>>>>>> 12bc9cace (fix(cli): resolve merge conflicts and align with async test helpers) Kind, +<<<<<<< HEAD ACTIVATE_SKILL_TOOL_NAME, ======= CompressionStatus, @@ -62,6 +63,20 @@ import type { ToolCallResponseInfo, GeminiErrorEventValue, RetryAttemptPayload, +======= + type Config, + type EditorType, + type GeminiClient, + type ServerGeminiChatCompressedEvent, + type ServerGeminiContentEvent as ContentEvent, + type ServerGeminiFinishedEvent, + type ServerGeminiStreamEvent as GeminiEvent, + type ThoughtSummary, + type ToolCallRequestInfo, + type ToolCallResponseInfo, + type GeminiErrorEventValue, + type RetryAttemptPayload, +>>>>>>> 17740dc2d (fix(cli): resolve merge conflicts and align with async test helpers) } from '@google/gemini-cli-core'; import { type Part, type PartListUnion, FinishReason } from '@google/genai'; import type {