diff --git a/extensions/cli/src/util/exponentialBackoff.ts b/extensions/cli/src/util/exponentialBackoff.ts index 1c5657e5d..8f3004ae9 100644 --- a/extensions/cli/src/util/exponentialBackoff.ts +++ b/extensions/cli/src/util/exponentialBackoff.ts @@ -80,7 +80,10 @@ function isConnectionError(errorMessage: string): boolean { /** * Checks if the error indicates a context length issue (non-retryable) */ -export function isContextLengthError(error: any): boolean { +export function isContextLengthError(error: unknown): boolean { + if (!(error instanceof Error)) { + return false; + } const errorMessage = error.message?.toLowerCase() || ""; if (errorMessage.includes("invalid_request_error")) {