You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fleet proxy serve: auto-spawned broker inherits the caller ambient proxy env and silently breaks tailnet tunnels #12555
Any fleet client that finds no proxy broker running auto-spawns fleet proxy serve with the caller's ambient environment. From an agent shell in the muse sandbox, that means the broker inherits the sandbox egress proxy (HTTPS_PROXY pointing at hatch-egress-proxy:3128) instead of tailscaled's local CONNECT proxy (127.0.0.1:3130, recorded in fleet-proxy.env).
The broker process looks alive — it holds its socket and pid file — but every tunnel it opens goes to the wrong proxy, so the queue and shell legs to the laptop fail (proxy closed during CONNECT to 100.99.113.103:4801/4799) while the bridge and GitHub legs stay green. Nothing logs the mismatch; the seat presents as "laptop unreachable" when the laptop is fine.
Reproduction (2026-11-22, muse sandbox seat)
Seat healthy, then the proxy broker died at some point (stale socket/pid file left behind).
A plain ~/tools/fleet agent doctor --agent felix at ~13:07 UTC auto-spawned a new broker (pid 48122).
The new broker's live environment (/proc/48122/environ) held HTTPS_PROXY = the sandbox egress proxy, not http://127.0.0.1:3130.
Doctor then reported the shell leg broken on a seat the keeper had verified healthy minutes earlier — the diagnostic command itself re-broke the seat.
The same failure class caused the 2026-11-22 05:40 CST outage window: the broker had been started while tailscaled was dead and kept the wrong proxy env, so queue/shell stayed down after the tailnet recovered until the broker was manually restarted with the correct env.
Workaround in place
The sandbox ensure layer now polices the invariant externally: ~/tools/fleet-proxy-ensure.sh (run by the seat keeper and the init prelude) compares the broker's live /proc/<pid>/environHTTPS_PROXY against fleet-proxy.env and respawns the broker with the correct env on mismatch or death. This corrects the seat within about a minute, but it is a watchdog around the defect, not a fix.
Suggested durable fix
At broker spawn, fleet should not trust the ambient env for the tailnet proxy:
source fleet-proxy.env (the file tailscaled's bootstrap writes next to its state) when constructing the broker's environment, or
refuse the sandbox egress proxy for tailnet targets (100.64.0.0/10 destinations must go via tailscaled's CONNECT proxy or direct, never via the egress proxy).
Either removes the failure class for every fleet client, not just seats with an external ensure watching.
Pointer from the #12426 lane: the Python-side remainder of this failure class landed in PR #13071 (merged 382dc9bd4283) — laptop-agent.py and laptop-agent-broker.py now resolve the seat's recorded fleet-proxy.env ahead of the ambient HTTPS_PROXY for tailnet CONNECTs, mirroring the Rust rule from #12645. With both broker implementations self-correcting at CONNECT time, the external ensure watchdog named in the workaround section is a redundancy question for the primary seat rather than a correctness gap. Full record: #12426 (comment)
Agent note — Lane LJ: closing #12555 as completed on the two-PR evidence chain.
This issue's defect — an auto-spawned broker inheriting the caller's ambient proxy env and silently breaking tailnet tunnels — is removed at both points where the inherited env could steer a tunnel:
PR fleet: tailnet tunnels use the seat's recorded tailnet proxy (#12555) #12645 (merged 2026-11-22): tailnet tunnel construction (egress_from_env in fleet-proxy/src/tunnel.rs) prefers the seat's recorded tailnet proxy (fleet_config::tailnet_https_proxy(), reading fleet-proxy.env) over the ambient HTTPS_PROXY; bootstrap removes a stale env file in kernel mode.
With both landed, a broker's /proc environment no longer determines its tailnet routing at any point in its life, so the external fleet-proxy-ensure.sh watchdog described above is policing an invariant the binary now keeps itself; retiring that watchdog is a seat-keeping call, not a code remainder here. The Cloudflare leg intentionally still rides the ambient platform egress (its correct source).
Activity
developing-today commentedon Nov 22, 2026
CODE-4622
fleet: apply the seat's tailnet proxy to tailnet tunnels only
Merge pull request #12645 from developing-today/claude/12555-broker-t…
dezren39 commentedon Nov 23, 2026
Pointer from the #12426 lane: the Python-side remainder of this failure class landed in PR #13071 (merged
382dc9bd4283) —laptop-agent.pyandlaptop-agent-broker.pynow resolve the seat's recordedfleet-proxy.envahead of the ambientHTTPS_PROXYfor tailnet CONNECTs, mirroring the Rust rule from #12645. With both broker implementations self-correcting at CONNECT time, the external ensure watchdog named in the workaround section is a redundancy question for the primary seat rather than a correctness gap. Full record: #12426 (comment)fix(fleet-proxy): re-resolve the tailnet egress at tunnel-open time
dezren39 commentedon Nov 23, 2026
Agent note — Lane LJ: closing #12555 as completed on the two-PR evidence chain.
This issue's defect — an auto-spawned broker inheriting the caller's ambient proxy env and silently breaking tailnet tunnels — is removed at both points where the inherited env could steer a tunnel:
egress_from_envinfleet-proxy/src/tunnel.rs) prefers the seat's recorded tailnet proxy (fleet_config::tailnet_https_proxy(), readingfleet-proxy.env) over the ambientHTTPS_PROXY; bootstrap removes a stale env file in kernel mode.647dd8013cda, for fleet proxy serve inherits the sandbox egress HTTPS_PROXY in userspace mode; queue/shell legs fail until it is restarted with tailscaled's CONNECT proxy #12426): the broker no longer caches that resolution from startup — both tailnet opens re-resolve per tunnel open (Broker::tailnet_egress/resolve_tailnet_egress, three oracle tests;cargo test -p fleet-proxy113/113 + 14/14, re-verified after rebase). This covers the startup-cache half fleet: tailnet tunnels use the seat's recorded tailnet proxy (#12555) #12645 left: a broker born while tailscaled was down no longer keeps the wrong value after the tailnet recovers.With both landed, a broker's
/procenvironment no longer determines its tailnet routing at any point in its life, so the externalfleet-proxy-ensure.shwatchdog described above is policing an invariant the binary now keeps itself; retiring that watchdog is a seat-keeping call, not a code remainder here. The Cloudflare leg intentionally still rides the ambient platform egress (its correct source).