fix(http): limit versions host fallback retries#10142
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to override the default HTTP retry count for specific requests by adding new helper methods (such as get_text_with_headers_with_retries and retry_async_with_retries) that accept a custom retry parameter. The existing methods are updated to wrap these new functions using the default retry settings. This is utilized in list_versions to limit retries to 1, and a test has been added to verify the override behavior. There are no review comments, and I have no additional feedback to provide.
Greptile SummaryThis PR introduces a
Confidence Score: 5/5Safe to merge — the change is well-scoped, the offline guard is in place, and the behavioral change (fewer retries on version-list fetches) is intentional and tested. The refactor is localized to two files, the builder pattern is straightforward, and the only observable behavior change — capping version-list retries at 1 — is deliberate and covered by new unit tests. The previously identified offline-guard regression has been fixed and verified. No files require special attention. Important Files Changed
Reviews (5): Last reviewed commit: "Merge branch 'main' into fix/versions-ho..." | Re-trigger Greptile |
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.5.16 x -- echo |
25.8 ± 1.3 | 24.5 | 46.8 | 1.00 ± 0.06 |
mise x -- echo |
25.8 ± 0.8 | 24.8 | 35.6 | 1.00 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.5.16 env |
25.3 ± 1.0 | 24.1 | 33.3 | 1.01 ± 0.04 |
mise env |
25.0 ± 0.5 | 24.0 | 26.8 | 1.00 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.5.16 hook-env |
26.1 ± 1.0 | 25.0 | 40.1 | 1.01 ± 0.04 |
mise hook-env |
25.8 ± 0.5 | 24.8 | 28.0 | 1.00 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.5.16 ls |
22.2 ± 0.6 | 20.9 | 24.7 | 1.00 |
mise ls |
22.3 ± 0.8 | 21.1 | 28.5 | 1.01 ± 0.04 |
xtasks/test/perf
| Command | mise-2026.5.16 | mise | Variance |
|---|---|---|---|
| install (cached) | 182ms | 176ms | +3% |
| ls (cached) | 89ms | 85ms | +4% |
| bin-paths (cached) | 94ms | 91ms | +3% |
| task-ls (cached) | 165ms | 161ms | +2% |
ecfe1fe to
4ee3eb6
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4ee3eb6. Configure here.
4ee3eb6 to
27e95ef
Compare

Summary
Test
cargo fmt --checkcargo test http::tests::test_text_request_cargo test http::tests::test_Note
Low Risk
Localized HTTP client refactor with a tighter retry cap for one endpoint; behavior for other callers stays on global defaults unless they adopt TextRequest.
Overview
Introduces a
TextRequestbuilder on the HTTP client so text GETs can set extra headers and a per-request retry limit while keeping the existing HTML-vs-text and http→https behavior.get_textnow goes through that builder with default settings;retry_asyncdelegates toretry_async_with_retries, which HTTPS fallback uses as well.versions_hostversion-list fetches use the builder withVERSION_LIST_RETRIES(1) so a flakymise-versionscall fails faster and falls back to backend listing instead of waiting on the global HTTP retry budget.Tests cover
.retries()override and offline mode (no connections).Reviewed by Cursor Bugbot for commit cebaf8f. Bugbot is set up for automated code reviews on this repo. Configure here.