Skip to content

Conversation

xenoscopic
Copy link
Contributor

This PR adds an auto-resuming net/http.RoundTripper implementation that wraps an underlying net/http.RoundTripper and provides automatic / transparent request resumption in the case that the network is interrupted (which we run a higher risk of when downloading large GGUF blobs). The implementation is fairly conservative, only operating on GET requests that meet certain criteria (but this includes those we use for pulls). We also support the case where the initial request is a Range-based request, meaning that we can layer this under a future parallel pulls implementation.

Note that we still need "application-layer" resumable requests, where we stage / cache partially downloaded blobs for later resumption. This PR only handles network "hiccups", not full network disconnection.

This code was almost entirely generated by GPT-5, although significant review and iteration went into it. I've also tested this with Docker Desktop pulls, though in that case I've only be able to test the happy path. However, there is an extensive test harness that validates the non-happy-path cases.

This PR doesn't "wire up" the resumable transport, that will need to happen in main.go in docker/model-runner and in the Docker Desktop backend service.

This was generated using GPT-5 with a few rounds of manual refinement.

Signed-off-by: Jacob Howard <[email protected]>
@xenoscopic xenoscopic requested a review from a team September 4, 2025 15:44
@doringeman doringeman merged commit 3f098b3 into main Sep 5, 2025
4 checks passed
@doringeman doringeman deleted the transport-resume branch September 5, 2025 08:32
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.

2 participants