From 33b9af5248263875979d71d4dcfb62ecaf634ef4 Mon Sep 17 00:00:00 2001 From: mateo Date: Fri, 21 Aug 2026 04:04:40 +0000 Subject: [PATCH] style(cli): simplify keyring delete matching Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/litellm_core_utils/cli_keyring.py | 7 ++++--- litellm/proxy/client/cli/commands/auth.py | 5 +---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/litellm/litellm_core_utils/cli_keyring.py b/litellm/litellm_core_utils/cli_keyring.py index 0cb683d4a88..441880abd91 100644 --- a/litellm/litellm_core_utils/cli_keyring.py +++ b/litellm/litellm_core_utils/cli_keyring.py @@ -292,9 +292,10 @@ class KeyringVault: match result: case _KeyringCallAnswered(): return SecretErased() - case _KeyringCallFailed() | _KeyringCallTimedOut(): - if isinstance(result, _KeyringCallTimedOut): - self.stopped_answering.set() + case _KeyringCallFailed(): + return SecretStranded() + case _KeyringCallTimedOut(): + self.stopped_answering.set() return SecretStranded() diff --git a/litellm/proxy/client/cli/commands/auth.py b/litellm/proxy/client/cli/commands/auth.py index 4347ade2dde..d5b391c5e3b 100644 --- a/litellm/proxy/client/cli/commands/auth.py +++ b/litellm/proxy/client/cli/commands/auth.py @@ -153,10 +153,7 @@ def storage_notice(outcome: SecretSave) -> str: f"(owner-only) instead. For OS keychain storage, run: {KEYRING_ENABLE_HINT}" ) case SecretTooLarge(): - return ( - f"Your credential is too large for the OS keychain, so it was stored in {path} " - "(owner-only) instead." - ) + return f"Your credential is too large for the OS keychain, so it was stored in {path} (owner-only) instead." case CredentialNotSaved(detail=detail): return ( f"Signed in, but the credential could not be saved to {path}: {detail}. "