Repository navigation
fix(cdp): remote attach takes its proxy from the caller at session open - #137
Merged
Merged
Conversation
…ession open `session new --attach=<url>` (and markdown/search --attach) now resolve the proxy for the attach URL from the CLI's own environment (env vars only, NO_PROXY with CIDR/suffix support, loopback always direct) and pin it on the session. CDP discovery, the session's CDP websocket and the facade bridge all use exactly that value; the daemon's own proxy env is never read. A SOCKS all_proxy in the daemon's env used to crash discovery even with the host in NO_PROXY. - httpx[socks] + python-socks become default dependencies - *.localhost and 0.0.0.0 count as loopback - proxy credentials are redacted in session list / logs - connect failures through a proxy name it and the NO_PROXY bypass - ADR-0016 records the decision (supersedes #20's "never proxy") Closes #136 Co-Authored-By: Claude <noreply@anthropic.com>
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.
概述
--attach(session new,markdown/search --attach) now takes its proxy from the CLI caller's environment, resolved once when the session opens and pinned on it (workspace["proxy"]). Only env vars are read, never the macOS system proxy.NO_PROXYsupports CIDR and domain suffixes. Loopback targets, including*.localhostand0.0.0.0, are always direct.trust_env=False), the session's CDP websocket, and the Playwright facade bridge. The daemon's own proxy env is never read. Before this, a SOCKSall_proxyin the daemon's env crashed discovery (socksiomissing) even with the host inNO_PROXY, so the same command behaved differently depending on which daemon was running.httpx[socks]andpython-socksare now default dependencies. Proxy credentials are redacted insession list --jsonand in logs. A connect failure through a proxy names the proxy and theNO_PROXY=<host>bypass. ADR-0016 records the decision and supersedes env backend: support agent sessions (session new --backend=env) + fix facade proxy for an external CDP ws (attach to CloakBrowser profiles) #20's "never proxy the control channel".Closes #136
测试证明
New E2E:
tests/daemon/e2e/test_issue136_attach_proxy.py. It uses a real Chrome reached through a non-loopback forwarder, recording HTTP and SOCKS5 proxies, and a daemon whose own env points at a dead proxy. It covers five scenarios: HTTP proxy (discovery GET + 2 CONNECTs, credentials redacted), SOCKS5all_proxy,NO_PROXYCIDR → direct, no caller proxy → direct, and dead caller proxy → actionable error. It fails on main with the #136 error and passes on this branch. The artifact istests/daemon/e2e/_artifacts/issue136-proxy-routes.json.The cdp-relevant real-Chrome E2E subset also passed:
test_issue136_attach_proxy,test_l1_playwright_facade,test_search_command_cdp,test_l2_heredoc_playwright_page,test_l2_multisession,test_l1_roundtrip,test_l3_parity→24 passed in 233.30s.mise run lintpasses. The full ~23 min E2E suite was not run.mise run test
界面证据
N/A:无界面改动
检查项
🤖 Generated with Claude Code