Handle case when session started with Docker Desktop proxy available, and the Desktop is stopped#2606
Merged
dgageot merged 2 commits intodocker:mainfrom Apr 30, 2026
Merged
Conversation
…middle of a session Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
…ker agent the gateway Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
dgageot
approved these changes
Apr 30, 2026
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
PR: Handle case when session started with Docker Desktop proxy available, and Desktop is stopped
The implementation looks correct. The fallbackTransport correctly handles the proxy-unavailable scenario:
- Atomic state management:
atomic.BoolforproxyDisabledis the right tool — no locks needed for this flag. - Request retry logic: Correctly distinguishes retryable requests (
Body == nil || GetBody != nil) from non-retryable consumed-body requests. DisableCompressionplumbing: The type-switch inhttpclient/client.gocorrectly handles both*http.Transportand the newfallbackTransportvia theinterface{ DisableCompression() }duck-typing approach.- Independent transport clones:
proxyTransportandtransport(direct) are independent clones ofhttp.DefaultTransport, soDisableCompression()mutations are safe. - Error message improvement: Centralising
NoDesktopTokenErrorMessageinbase.gois a clean refactor.
The isProxySocketError pattern matching was examined — while "dial unix" is broad, in practice this transport is only used for outbound LLM API HTTP calls through the Desktop proxy socket, so false positives from unrelated Unix sockets (e.g., /var/run/docker.sock) are not a realistic concern in this context.
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.
Signed-off-by: Guillaume Tardif guillaume.tardif@gmail.com