Skip to content

Conversation

etraut-openai
Copy link
Collaborator

@etraut-openai etraut-openai commented Aug 26, 2025

This PR fixes a bug in the token refresh logic. Token refresh is performed in a retry loop so if we receive a 401 error, we refresh the token, then we go around the loop again and reissue the fetch with a fresh token. The bug is that we're not using the updated token on the second and subsequent times through the loop. The result is that we'll try to refresh the token a few more times until we hit the retry limit (default of 4). The 401 error is then passed back up to the caller. Subsequent calls will use the refreshed token, so the problem clears itself up.

The fix is straightforward — make sure we use the updated auth information each time through the retry loop.

@etraut-openai etraut-openai merged commit d63e44a into main Aug 26, 2025
15 checks passed
@etraut-openai etraut-openai deleted the stale_auth branch August 26, 2025 02:18
@github-actions github-actions bot locked and limited conversation to collaborators Aug 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants