Send installation token to api.github.com and raw.githubusercontent.com#2562
Merged
hiroshinishio merged 1 commit intomainfrom Apr 20, 2026
Merged
Send installation token to api.github.com and raw.githubusercontent.com#2562hiroshinishio merged 1 commit intomainfrom
hiroshinishio merged 1 commit intomainfrom
Conversation
Sentry AGENT-364/363/23G (web_fetch) and AGENT-35Y/35X (curl) fired on 404s fetching private repo content at a specific SHA. The clone is shallow (--depth 1) so the agent can't reach arbitrary historical commits locally; it legitimately had to go out to GitHub. Both http helpers were sending plain requests with no auth, so the private repo returned 404. New github_auth_headers helper inspects the URL host and returns a Bearer header for api.github.com and raw.githubusercontent.com when a token is present in base_args. Wired into both curl and web_fetch. Tests cover host allowlist, missing token, invalid URL, and a non-github host to guarantee the token is not leaked outward. Also rewrote pre-existing partial in/not-in assertions in the touched test files to exact == equality per CLAUDE.md.
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.
No description provided.