Skip to content

Handle case when session started with Docker Desktop proxy available, and the Desktop is stopped#2606

Merged
dgageot merged 2 commits intodocker:mainfrom
gtardif:handle_dd_proxy_died
Apr 30, 2026
Merged

Handle case when session started with Docker Desktop proxy available, and the Desktop is stopped#2606
dgageot merged 2 commits intodocker:mainfrom
gtardif:handle_dd_proxy_died

Conversation

@gtardif
Copy link
Copy Markdown
Contributor

@gtardif gtardif commented Apr 30, 2026

  • detect if proxy is not avaiable anymore in the middle of a session and fallback to no proxy.
  • improve error message if using the gateway but no auth token is available

Signed-off-by: Guillaume Tardif guillaume.tardif@gmail.com

gtardif added 2 commits April 30, 2026 16:21
…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>
@gtardif gtardif requested a review from a team as a code owner April 30, 2026 14:50
Copy link
Copy Markdown

@docker-agent docker-agent Bot left a comment

Choose a reason for hiding this comment

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

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.Bool for proxyDisabled is 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.
  • DisableCompression plumbing: The type-switch in httpclient/client.go correctly handles both *http.Transport and the new fallbackTransport via the interface{ DisableCompression() } duck-typing approach.
  • Independent transport clones: proxyTransport and transport (direct) are independent clones of http.DefaultTransport, so DisableCompression() mutations are safe.
  • Error message improvement: Centralising NoDesktopTokenErrorMessage in base.go is 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.

@dgageot dgageot merged commit c58f445 into docker:main Apr 30, 2026
6 checks passed
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