Repository navigation
Description
Found during the #3448 review (GStack Minder decision, 2026-10-26). Pre-existing on main; #3448 widens the set of inputs that reach it.
The daemon crashes when an env proxy carries credentials and BROWSE_PROXY_USER/PASS are also set
With BROWSE_PROXY_USER/BROWSE_PROXY_PASS set and a standard proxy variable, the CLI's resolveProxy embeds the env credentials into the BROWSE_PROXY_URL it hands the daemon, and startServer spawns the daemon with { ...process.env }, so BROWSE_PROXY_USER/PASS also reach the daemon. The daemon's parseProxyConfig then sees credentials in both the URL and the env and throws proxy creds set in both env (BROWSE_PROXY_USER) and URL — pick one source, and the CLI reports only "Server failed to start within 15s".
Reproduced through the real CLI: HTTPS_PROXY=http://127.0.0.1:1 BROWSE_PROXY_USER=a BROWSE_PROXY_PASS=b browse ... → the start line prints http://***:***@127.0.0.1:1/, the daemon log has the "pick one source" line, and the CLI ends with the misleading timeout.
Identical code on main for http://proxy:3128 values and for --proxy. #3448 makes it reachable from one more spelling: a scheme-less HTTPS_PROXY=host:3128 plus BROWSE_PROXY_USER/PASS used to warn and go direct, and now hits this path too.
Evidence: browse/src/server.ts ~1895 — envUser: process.env.BROWSE_PROXY_USER, envPass: process.env.BROWSE_PROXY_PASS, source: proxySource,; the embedding is in resolveProxy (url.username = ...).
Proposed fix: strip BROWSE_PROXY_USER/BROWSE_PROXY_PASS from the daemon env in startServer (or in proxyServerEnv) when the resolved BROWSE_PROXY_URL already carries userinfo, so the daemon sees one credential source. Add a proxy-env-daemon case that starts a daemon with env credentials.
Open question (from #3448)
The path/query/fragment refusal added in #3448 also sends credential-free env values with a path direct: HTTPS_PROXY=http://proxy.corp:3128/pac parsed on main (path dropped, session proxied) and now warns and goes direct. The refusal exists to keep a password out of the URL path, which cannot happen without a userinfo. Should the refusal be narrowed to values that carry an @ (userinfo present), so a credential-free .../pac stays proxied as before? #3448 documents the current behavior in the CHANGELOG as a stated narrowing.
Activity
capy-ai commentedon Oct 31, 2026
Fix for the daemon crash is in #3739. It's broader than this issue's title: with
BROWSE_PROXY_USER/BROWSE_PROXY_PASSset, the daemon refused to start for every proxy spelling (--proxy,BROWSE_PROXY_URLand the standard proxy variables), not only for credentialed env URLs.The open question above, whether to stop refusing a path in a credential-free proxy URL (so
HTTPS_PROXY=http://proxy.corp:3128/pacis proxied again instead of warning and going direct), is not in #3739. It changes behavior, so it stays here as a follow-up for a separate decision.fix(browse): daemon reads proxy creds once when BROWSE_PROXY_USER/PAS…
capy-ai commentedon Nov 3, 2026
Fixed in #3739, merged to main as 8319372 (v1.93.30.0). When browse passes a resolved BROWSE_PROXY_URL to the daemon, it now blanks BROWSE_PROXY_USER/PASS, so the daemon stops refusing its own merged credentials and starts normally. The question about narrowing the path refusal for credential-free URLs is still open as a follow-up (see the earlier comment).