fix(cli): clear stale retry/loading state after cancellation (#21096) (#21960)

Co-authored-by: Aashir Javed <Aaxhirrr@users.noreply.github.com>
Co-authored-by: Dev Randalpura <devrandalpura@google.com>
This commit is contained in:
Aashir Javed
2026-04-02 12:44:39 -07:00
committed by GitHub
parent 40b486fbca
commit e6b5257092
8 changed files with 194 additions and 35 deletions
@@ -79,13 +79,14 @@ export const useLoadingIndicator = ({
prevStreamingStateRef.current = streamingState;
}, [streamingState, elapsedTimeFromTimer]);
const retryPhrase = retryStatus
? errorVerbosity === 'low'
? retryStatus.attempt >= LOW_VERBOSITY_RETRY_HINT_ATTEMPT_THRESHOLD
? "This is taking a bit longer, we're still on it."
: null
: `Trying to reach ${getDisplayString(retryStatus.model)} (Attempt ${retryStatus.attempt + 1}/${retryStatus.maxAttempts})`
: null;
const retryPhrase =
streamingState === StreamingState.Responding && retryStatus
? errorVerbosity === 'low'
? retryStatus.attempt >= LOW_VERBOSITY_RETRY_HINT_ATTEMPT_THRESHOLD
? "This is taking a bit longer, we're still on it."
: null
: `Trying to reach ${getDisplayString(retryStatus.model)} (Attempt ${retryStatus.attempt + 1}/${retryStatus.maxAttempts})`
: null;
return {
elapsedTime: