1ccacad63281094de8a3372d5a507d38f9969e5c
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
4725c772bb |
netproxy: a hung system proxy read holds no request; a failed one keeps the last proxy (#3421)
System() ran readSystem under sysCache's lock, and on macOS that is scutil --proxy, started with proc.Command and no timeout. When neither magpie's settings nor the environment name a proxy, every request's proxy comes from there (For, through Func: http.DefaultTransport, the gateway's upstream transport, MCP, updates), so a scutil that never answered held each of them on that lock for as long as it hung, past its own deadline too: net/http looks at a request's context before it calls Proxy, not while. With no system proxy set, scutil runs again every 2 s it is asked. And a read that failed was taken as no proxy: where vendors are reached only through the system's proxy, a scutil that failed once sent the next 2 s of requests direct. The code standards' "nothing that can block runs under a lock its reader needs" and "a failed read means unknown". Found while chasing #3362, an app whose partner fetch never came back. Nothing there shows scutil was what hung; it is the one wait on that path with no end. Now: - One read runs at a time, outside the lock. A request waits for it until readWait (2 s) after it began, then takes what was read before. Before the first read that is nothing, so direct, as a failed first read was. A read already past readWait holds nobody. - A read that fails keeps what was read before, and the read after it holds nobody either: requests go on with the proxy read before until a read answers. - scutil gets toolWait (10 s) and is then ended (readTool, through proc.CommandContext), and that read fails. - Windows' registry: a key or value that isn't there is no proxy, as before; any other error is a failed read. Elsewhere there is no system proxy to read, and nothing changes. ggbdpq's patch on #2562 has testenv stand in for scutil with exit 1. Under this change that read fails with nothing read before it, which is still no proxy, so it does what it did. What was run (tree 6f5e4b92, on |
||
|
|
e8b3be572c | windows: the desktop app no longer opens a console window for every command it runs (#54) — it is linked as a GUI program and has no console, so each console CLI it started (devin auth status and models list, devin acp for every Devin turn, claude, codex, cursor-agent and grok probes and runs, grok login) was given a new console by Windows, and a Windows Terminal window with it, some every few seconds while the app sat idle. Every command magpie runs is now made through internal/proc, which starts it with CREATE_NO_WINDOW when magpie has no console of its own: the child gets a console without a window, and its output, which magpie always pipes back, arrives as before. A magpie run in a terminal (magpie serve, the TUI, the desktop app started from one with a command) has one, and its children share it as they did, so Ctrl+C there still reaches them. The relaunch after an update keeps its DETACHED_PROCESS, added to rather than replacing the flags it was made with, and a test fails on any command made with os/exec directly, so a new one can't bring the windows back | ||
|
|
1f72ac82f0 | net: requests go through a proxy — Settings → Proxy, or the environment's, or the system's (#8) |