mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
fix STALE token with malformed value falling to ValueError instead of refresh
When token_state is STALE but the token is None/non-string, downgrade token_state to INVALID so the blocking refresh path executes instead of skipping it and hitting the final ValueError. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5c1e3ff245
commit
b9a5ca6efb
1 changed files with 3 additions and 3 deletions
|
|
@ -894,9 +894,9 @@ class VertexBase:
|
|||
raise ValueError("Could not resolve project_id")
|
||||
current_token = _credentials.token
|
||||
if current_token is None or not isinstance(current_token, str):
|
||||
# Token is malformed despite STALE state — fall through
|
||||
# to INVALID path which will block on a full refresh.
|
||||
pass
|
||||
# Token is malformed despite STALE state — downgrade to
|
||||
# INVALID so the next block performs a blocking refresh.
|
||||
token_state = TokenState.INVALID
|
||||
else:
|
||||
# Schedule a single background refresh — skip if one is
|
||||
# already in flight for this credential key.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue