mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-04 15:16:49 -07:00
style(ui): iterate on loading and error strings for precise conciseness
This commit is contained in:
@@ -76,7 +76,7 @@ export const DetailedMessagesDisplay: React.FC<
|
||||
>
|
||||
<Box marginBottom={1}>
|
||||
<Text bold color={theme.text.primary}>
|
||||
Debug Console <Text color={theme.text.secondary}>(F12 to close)</Text>
|
||||
Debug console <Text color={theme.text.secondary}>(F12 to close)</Text>
|
||||
</Text>
|
||||
</Box>
|
||||
<Box height={maxHeight} width={width - borderAndPadding}>
|
||||
|
||||
@@ -65,10 +65,10 @@ export const LoadingIndicator: React.FC<LoadingIndicatorProps> = ({
|
||||
currentLoadingPhrase === INTERACTIVE_SHELL_WAITING_PHRASE
|
||||
? currentLoadingPhrase
|
||||
: thought?.subject
|
||||
? (thoughtLabel ?? thought.subject)
|
||||
? `Gemini is thinking about ${thoughtLabel ?? thought.subject.trim()}`
|
||||
: currentLoadingPhrase ||
|
||||
(streamingState === StreamingState.Responding
|
||||
? 'Thinking...'
|
||||
? 'Gemini is thinking...'
|
||||
: undefined);
|
||||
|
||||
const cancelAndTimerContent =
|
||||
@@ -81,7 +81,7 @@ export const LoadingIndicator: React.FC<LoadingIndicatorProps> = ({
|
||||
!forceRealStatusOnly &&
|
||||
showWit &&
|
||||
wittyPhrase &&
|
||||
primaryText === 'Thinking...' ? (
|
||||
(primaryText === 'Thinking...' || primaryText === 'Gemini is thinking...') ? (
|
||||
<Box marginLeft={1}>
|
||||
<Text color={theme.text.secondary} dimColor italic>
|
||||
{wittyPhrase}
|
||||
|
||||
@@ -1048,7 +1048,7 @@ describe('useGeminiStream', () => {
|
||||
).toBe(false);
|
||||
expect(
|
||||
infoTexts.some((text) =>
|
||||
text.includes('This request failed. Press F12 for diagnostics'),
|
||||
text.includes('Request failed. Press F12 for diagnostics'),
|
||||
),
|
||||
).toBe(false);
|
||||
});
|
||||
@@ -1108,15 +1108,13 @@ describe('useGeminiStream', () => {
|
||||
([item]) => (item as { text?: string }).text ?? '',
|
||||
);
|
||||
const noteIndex = infoTexts.findIndex((text) =>
|
||||
text.includes(
|
||||
'Some internal tool attempts failed before this final error',
|
||||
),
|
||||
text.includes('Previous tool attempts failed'),
|
||||
);
|
||||
const stopIndex = infoTexts.findIndex((text) =>
|
||||
text.includes('Agent execution stopped: Stop reason from hook'),
|
||||
);
|
||||
const failureHintIndex = infoTexts.findIndex((text) =>
|
||||
text.includes('This request failed. Press F12 for diagnostics'),
|
||||
text.includes('Request failed. Press F12 for diagnostics'),
|
||||
);
|
||||
expect(noteIndex).toBeGreaterThanOrEqual(0);
|
||||
expect(stopIndex).toBeGreaterThanOrEqual(0);
|
||||
|
||||
@@ -110,9 +110,9 @@ enum StreamProcessingStatus {
|
||||
}
|
||||
|
||||
const SUPPRESSED_TOOL_ERRORS_NOTE =
|
||||
'Some internal tool attempts failed before this final error. Press F12 for diagnostics, or run /settings and change "Error Verbosity" to full for details.';
|
||||
'Previous tool attempts failed. Press F12 for diagnostics or set ui.errorVerbosity=full for details';
|
||||
const LOW_VERBOSITY_FAILURE_NOTE =
|
||||
'This request failed. Press F12 for diagnostics, or run /settings and change "Error Verbosity" to full for full details.';
|
||||
'Request failed. Press F12 for diagnostics or set ui.errorVerbosity=full for details';
|
||||
|
||||
function getBackgroundedToolInfo(
|
||||
toolCall: TrackedCompletedToolCall | TrackedCancelledToolCall,
|
||||
|
||||
@@ -237,7 +237,7 @@ describe('useLoadingIndicator', () => {
|
||||
retryStatus,
|
||||
);
|
||||
|
||||
expect(result.current.currentLoadingPhrase).toContain('Trying to reach');
|
||||
expect(result.current.currentLoadingPhrase).toContain('Retrying');
|
||||
expect(result.current.currentLoadingPhrase).toContain('Attempt 3/3');
|
||||
});
|
||||
|
||||
@@ -258,7 +258,7 @@ describe('useLoadingIndicator', () => {
|
||||
);
|
||||
|
||||
expect(result.current.currentLoadingPhrase).not.toBe(
|
||||
"This is taking a bit longer, we're still on it.",
|
||||
'System busy. Retrying...',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -279,7 +279,7 @@ describe('useLoadingIndicator', () => {
|
||||
);
|
||||
|
||||
expect(result.current.currentLoadingPhrase).toBe(
|
||||
"This is taking a bit longer, we're still on it.",
|
||||
'System busy. Retrying...',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -82,9 +82,9 @@ export const useLoadingIndicator = ({
|
||||
const retryPhrase = retryStatus
|
||||
? errorVerbosity === 'low'
|
||||
? retryStatus.attempt >= LOW_VERBOSITY_RETRY_HINT_ATTEMPT_THRESHOLD
|
||||
? "This is taking a bit longer, we're still on it."
|
||||
? 'System busy. Retrying...'
|
||||
: null
|
||||
: `Trying to reach ${getDisplayString(retryStatus.model)} (Attempt ${retryStatus.attempt + 1}/${retryStatus.maxAttempts})`
|
||||
: `Retrying ${getDisplayString(retryStatus.model)} (Attempt ${retryStatus.attempt + 1}/${retryStatus.maxAttempts})`
|
||||
: null;
|
||||
|
||||
return {
|
||||
|
||||
@@ -11,8 +11,8 @@ import { AuthType } from '../core/contentGenerator.js';
|
||||
import type { StructuredError } from '../core/turn.js';
|
||||
|
||||
describe('parseAndFormatApiError', () => {
|
||||
const vertexMessage = 'request a quota increase through Vertex';
|
||||
const geminiMessage = 'request a quota increase through AI Studio';
|
||||
const vertexMessage = 'request a quota increase in Vertex';
|
||||
const geminiMessage = 'request a quota increase in AI Studio';
|
||||
|
||||
it('should format a valid API error JSON', () => {
|
||||
const errorMessage =
|
||||
@@ -34,7 +34,7 @@ describe('parseAndFormatApiError', () => {
|
||||
);
|
||||
expect(result).toContain('[API Error: Rate limit exceeded');
|
||||
expect(result).toContain(
|
||||
'Possible quota limitations in place or slow response times detected. Switching to the gemini-2.5-flash model',
|
||||
'System busy or quota limit reached. Switching to gemini-2.5-flash for the rest of this session.',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@ import type { UserTierId } from '../code_assist/types.js';
|
||||
import { AuthType } from '../core/contentGenerator.js';
|
||||
|
||||
const RATE_LIMIT_ERROR_MESSAGE_USE_GEMINI =
|
||||
'\nPlease wait and try again later. To increase your limits, request a quota increase through AI Studio, or switch to another /auth method';
|
||||
'\nRate limit reached. Try again later, request a quota increase in AI Studio, or switch /auth method';
|
||||
const RATE_LIMIT_ERROR_MESSAGE_VERTEX =
|
||||
'\nPlease wait and try again later. To increase your limits, request a quota increase through Vertex, or switch to another /auth method';
|
||||
'\nRate limit reached. Try again later, request a quota increase in Vertex, or switch /auth method';
|
||||
const getRateLimitErrorMessageDefault = (
|
||||
fallbackModel: string = DEFAULT_GEMINI_FLASH_MODEL,
|
||||
) =>
|
||||
`\nPossible quota limitations in place or slow response times detected. Switching to the ${fallbackModel} model for the rest of this session.`;
|
||||
`\nSystem busy or quota limit reached. Switching to ${fallbackModel} for the rest of this session.`;
|
||||
|
||||
function getRateLimitMessage(
|
||||
authType?: AuthType,
|
||||
|
||||
Submodule
+1
Submodule pr_keith_thinking added at 83c24a5189
Reference in New Issue
Block a user