Repository navigation
Fix: Apply client timeout to Auth requests - #332
Merged
Merged
Conversation
Co-authored-by: yanyongyu <42488585+yanyongyu@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix app installation token request to respect client timeout
Apply client timeout to App installation token request
Oct 25, 2026
Co-authored-by: yanyongyu <42488585+yanyongyu@users.noreply.github.com>
Co-authored-by: yanyongyu <42488585+yanyongyu@users.noreply.github.com>
Owner
|
pre-commit.ci autofix |
yanyongyu
approved these changes
Oct 25, 2026
yanyongyu
marked this pull request as ready for review
October 25, 2026 11:15
Co-authored-by: yanyongyu <42488585+yanyongyu@users.noreply.github.com>
Co-authored-by: yanyongyu <42488585+yanyongyu@users.noreply.github.com>
yanyongyu
approved these changes
Oct 25, 2026
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.
AppInstallationAuthStrategyyields a freshhttpx.Requestfor the token exchange. httpx only sets thetimeoutextension on the request passed tosend(), not on requests anAuthflow yields. The token request therefore went out with no timeout, and the first call on a client (and every token refresh) could hang indefinitely.githubkit/auth/app.py_build_installation_auth_requestnow takes the incoming request and copies itsextensionsonto the token request.sync_auth_flowandasync_auth_flowpass the incoming request through.Review notes:
client.build_request. I copied the incoming request's extensions instead, because the auth flow has no client reference. That also carries over any other per-request extensions, not justtimeout.auth/oauth.pybuild barehttpx.Requests too. Those helpers are also used outside an httpx auth flow, where there is no incoming request to copy from, so I left them alone.