Skip to content

fix(http): limit versions host fallback retries#10142

Merged
jdx merged 3 commits into
mainfrom
fix/versions-host-single-retry
May 31, 2026
Merged

fix(http): limit versions host fallback retries#10142
jdx merged 3 commits into
mainfrom
fix/versions-host-single-retry

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented May 29, 2026

Summary

  • add a small HTTP text request builder for per-request options
  • cap mise-versions version-list fetches at one retry before falling back to backend listing
  • keep text requests respecting offline mode and cover that with a regression test

Test

  • cargo fmt --check
  • cargo 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 TextRequest builder 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_text now goes through that builder with default settings; retry_async delegates to retry_async_with_retries, which HTTPS fallback uses as well.

versions_host version-list fetches use the builder with VERSION_LIST_RETRIES (1) so a flaky mise-versions call 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.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 29, 2026

Greptile Summary

This PR introduces a TextRequest builder on the HTTP client that enables per-request header and retry-count configuration, then uses it in versions_host to cap version-list fetches at one retry so a flaky mise-versions host fails faster.

  • TextRequest builder wraps send_with_https_fallback_with_retries directly, with the offline-mode guard correctly restored inside TextRequest::send(); retry_async now delegates to the new retry_async_with_retries helper.
  • list_versions in versions_host.rs adopts the builder with VERSION_LIST_RETRIES = 1, reducing the worst-case wait on a flaky versions host from the full global retry schedule down to one retry.
  • Two new unit tests cover the retry-override path and confirm no network connection is opened in offline mode.

Confidence Score: 5/5

Safe 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

Filename Overview
src/http.rs Introduces TextRequest builder with per-request retry override; refactors retry_async to delegate to retry_async_with_retries; offline guard correctly restored inside TextRequest::send(); two new unit tests cover retry override and offline mode.
src/versions_host.rs Migrates list_versions to the new TextRequest builder with VERSION_LIST_RETRIES = 1, capping the retry budget to 1 so a flaky versions host fails faster instead of exhausting the global retry schedule.

Reviews (5): Last reviewed commit: "Merge branch 'main' into fix/versions-ho..." | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

Hyperfine Performance

mise x -- echo

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%

@jdx jdx force-pushed the fix/versions-host-single-retry branch from ecfe1fe to 4ee3eb6 Compare May 29, 2026 21:51
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread src/http.rs
Comment thread src/http.rs
@jdx jdx force-pushed the fix/versions-host-single-retry branch from 4ee3eb6 to 27e95ef Compare May 29, 2026 22:01
@jdx jdx enabled auto-merge (squash) May 29, 2026 22:18
@jdx jdx merged commit 0e0a660 into main May 31, 2026
33 checks passed
@jdx jdx deleted the fix/versions-host-single-retry branch May 31, 2026 02:51
This was referenced May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant