Repository navigation
fix: use shared HTTP client for sync and model fetch requests #4467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
seefs001
wants to merge
3
commits into
QuantumNous:main
Choose a base branch
from
seefs001:fix/use-shared-http-client
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
cat -n controller/ratio_sync.go | head -100Repository: QuantumNous/new-api
Length of output: 3139
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 134
🏁 Script executed:
rg "getRatioSyncHTTPClient|GetHttpClient" -B 3 -A 5Repository: QuantumNous/new-api
Length of output: 20192
🏁 Script executed:
rg "github\.io" --type goRepository: QuantumNous/new-api
Length of output: 496
🏁 Script executed:
rg "IPv4|IPv6|Dial" controller/ --type go -B 2 -A 2Repository: QuantumNous/new-api
Length of output: 45
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 50375
🏁 Script executed:
git show 9c4d5126 -- controller/ratio_sync.go | head -150Repository: QuantumNous/new-api
Length of output: 4188
🏁 Script executed:
cat -n service/http_client.go | head -80Repository: QuantumNous/new-api
Length of output: 2874
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 3493
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 3318
🏁 Script executed:
rg "IPv4|IPv6|Dial|github\.io" --type go -B 5 -A 5Repository: QuantumNous/new-api
Length of output: 10583
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 1189
🏁 Script executed:
git log --all --oneline -50 | grep -i ratioRepository: QuantumNous/new-api
Length of output: 388
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 2306
🏁 Script executed:
rg "retryIPv4|fallback|ipv4.*ipv6|github\.io.*retry" --type goRepository: QuantumNous/new-api
Length of output: 2906
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 3107
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 1189
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 2806
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 45
Shared client adoption LGTM; note: removed
github.ioIPv4→IPv6 dial fallback.The helper and swap to
client.Do(httpReq)are correct and enable HTTP_PROXY/HTTPS_PROXY env vars (fixing#4466).The prior implementation at commit 55c8271 included a custom dialer that tried IPv4 first for
*.github.io, falling back to IPv6 on failure. This fallback is now gone. For users without a proxy configured but relying on IPv4 reachability forbasellm.github.io, this surfaces a connectivity regression. Consider either:*.github.iopreset hosts, orHTTP_PROXY/HTTPS_PROXY.The retry loop at lines 200-208 safely reuses the same httpReq since the body is nil.
🤖 Prompt for AI Agents