Implement optimistic probe fallback and concurrent bootstrap#404
Merged
SuperCoolPencil merged 8 commits intomainfrom Apr 22, 2026
Merged
Implement optimistic probe fallback and concurrent bootstrap#404SuperCoolPencil merged 8 commits intomainfrom
SuperCoolPencil merged 8 commits intomainfrom
Conversation
…re and concurrent download errors
…l size discovery during runtime
Binary Size Analysis
|
…cation, and import cleanup
Member
Author
|
@junaid2005p This fixes some website downloads not starting due to 403/405/500 status code Please review |
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.
Overview
This PR improves the robustness of the download lifecycle by handling cases where the initial HEAD/GET probe fails. Instead of failing the download immediately, it now falls back to an optimistic configuration and attempts a metadata bootstrap during the download phase.
Changes
Greptile Summary
This PR adds an optimistic probe-fallback path: when the initial HEAD/GET probe fails, the download is queued with
SupportsRange=trueandTotalSize=0, the concurrent downloader attempts aRange: bytes=0-0bootstrap to discover the file size, and on failure the single-threaded downloader takes over. The lifecycle manager now also treats probe errors as non-fatal (except for invalid-scheme and request-creation failures), andcontext.DeadlineExceededis correctly excluded from the fallback trigger alongsidecontext.Canceled. The remaining findings are all P2 — the scheme detection still uses fragilestrings.Containson a runtime error message, the bootstrap happy-path test omits file-content verification, and theeffectiveTotalSizestate-fallback path has a minor silent-stale-value risk when both downloaders return no size information.Confidence Score: 5/5
Safe to merge; all remaining findings are P2 style or observability improvements that do not block the primary download path
All previously flagged P0/P1 issues (stale tail bytes, missing DeadlineExceeded guard, bootstrapMetadata using wrong context) have been addressed. The three new comments are P2: fragile string matching for scheme detection, incomplete test coverage in the bootstrap happy-path, and a minor stale-size observability gap. None block correctness of the new fallback path.
internal/processing/manager.go — scheme detection via strings.Contains; internal/engine/concurrent/concurrent_test.go — bootstrap happy-path test coverage
Important Files Changed
Prompt To Fix All With AI
Reviews (6): Last reviewed commit: "fix(download): add context.DeadlineExcee..." | Re-trigger Greptile