Repository navigation
Refresh Codex OAuth token after unauthorized responses - #2287
Closed
mikemikimike wants to merge 2 commits into
Closed
mikemikimike wants to merge 2 commits into
mikemikimike wants to merge 2 commits into
Conversation
Collaborator
|
Thanks for the contribution. We reworked the fix in #2432: a 401 from the Codex backend is returned as an error response, not thrown as an exception, so the retry cannot live in a try/catch around |
Aaronontheweb
added a commit
that referenced
this pull request
Oct 11, 2026
…2432) A 401 from the Codex backend is returned as an error response, not thrown as an exception (the OpenAI SDK throws ClientResultException only after the pipeline unwinds). Detect the 401 by inspecting the response status after the downstream run, then force-refresh the token and retry once. Add ForceRefreshAccessTokenAsync, which reuses a token already refreshed by a concurrent request instead of rotating the refresh token a second time. Supersedes #2287.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2264
Fixes #2264
Issue: #2264
Validation
dotnet test src/Netclaw.Configuration.Tests/Netclaw.Configuration.Tests.csproj -c Release --no-build --filter FullyQualifiedName~ProviderOAuthTokenRefreshServiceTests(5 passed)dotnet test src/Netclaw.Daemon.Tests/Netclaw.Daemon.Tests.csproj -c Release --no-build --filter FullyQualifiedName~OpenAiCodexTests(26 passed)dotnet build Netclaw.slnx -c Release --no-restore(0 errors)dotnet slopwatch analyze(0 issues)