Add low/full CLI error verbosity mode for cleaner UI (#20399)

This commit is contained in:
Dmitry Lyalin
2026-02-27 14:15:10 -05:00
committed by GitHub
parent 1c8951334a
commit 7f8ce8657c
25 changed files with 689 additions and 32 deletions

View File

@@ -42,6 +42,7 @@ interface UseQuotaAndFallbackArgs {
settings: LoadedSettings;
setModelSwitchedFromQuotaError: (value: boolean) => void;
onShowAuthSelection: () => void;
errorVerbosity?: 'low' | 'full';
}
export function useQuotaAndFallback({
@@ -52,6 +53,7 @@ export function useQuotaAndFallback({
settings,
setModelSwitchedFromQuotaError,
onShowAuthSelection,
errorVerbosity = 'full',
}: UseQuotaAndFallbackArgs) {
const [proQuotaRequest, setProQuotaRequest] =
useState<ProQuotaDialogRequest | null>(null);
@@ -165,6 +167,16 @@ export function useQuotaAndFallback({
message = messageLines.join('\n');
}
// In low verbosity mode, auto-retry transient capacity failures
// without interrupting with a dialog.
if (
errorVerbosity === 'low' &&
!isTerminalQuotaError &&
!isModelNotFoundError
) {
return 'retry_once';
}
setModelSwitchedFromQuotaError(true);
config.setQuotaErrorOccurred(true);
@@ -200,6 +212,7 @@ export function useQuotaAndFallback({
initialOverageStrategy,
setModelSwitchedFromQuotaError,
onShowAuthSelection,
errorVerbosity,
]);
// Set up validation handler for 403 VALIDATION_REQUIRED errors