summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cli/src/ui/hooks')
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.test.tsx4
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.ts7
2 files changed, 11 insertions, 0 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.test.tsx b/packages/cli/src/ui/hooks/useGeminiStream.test.tsx
index 3a002919..fc6f93c5 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.test.tsx
+++ b/packages/cli/src/ui/hooks/useGeminiStream.test.tsx
@@ -1097,6 +1097,7 @@ describe('useGeminiStream', () => {
getContentGeneratorConfig: vi.fn(() => ({
authType: mockAuthType,
})),
+ getModel: vi.fn(() => 'gemini-2.5-pro'),
} as unknown as Config;
const { result } = renderHook(() =>
@@ -1125,6 +1126,9 @@ describe('useGeminiStream', () => {
expect(mockParseAndFormatApiError).toHaveBeenCalledWith(
'Rate limit exceeded',
mockAuthType,
+ undefined,
+ 'gemini-2.5-pro',
+ 'gemini-2.5-flash',
);
});
});
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts
index b4acdb9a..550cab86 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.ts
+++ b/packages/cli/src/ui/hooks/useGeminiStream.ts
@@ -24,6 +24,7 @@ import {
ThoughtSummary,
UnauthorizedError,
UserPromptEvent,
+ DEFAULT_GEMINI_FLASH_MODEL,
} from '@google/gemini-cli-core';
import { type Part, type PartListUnion } from '@google/genai';
import {
@@ -397,6 +398,9 @@ export const useGeminiStream = (
text: parseAndFormatApiError(
eventValue.error,
config.getContentGeneratorConfig().authType,
+ undefined,
+ config.getModel(),
+ DEFAULT_GEMINI_FLASH_MODEL,
),
},
userMessageTimestamp,
@@ -533,6 +537,9 @@ export const useGeminiStream = (
text: parseAndFormatApiError(
getErrorMessage(error) || 'Unknown error',
config.getContentGeneratorConfig().authType,
+ undefined,
+ config.getModel(),
+ DEFAULT_GEMINI_FLASH_MODEL,
),
},
userMessageTimestamp,