e387c91b4c
POSIX popen routes via /bin/sh -c, so "2>&1" is a shell redirect. On Windows we use CreateProcessW directly (no shell): curl receives "2>&1" as a positional arg, treats it as a second URL, and fails with exit 3 "URL rejected: Bad hostname". Stderr is already merged into the same pipe via STARTUPINFOW.hStdError on Windows, so the redirect is also unnecessary there. Guard with #ifndef _WIN32. Also adds FN_HTTP_DEBUG env var to dump the cmdline + req.url for future bug triage (zero-cost when unset). Detected via agents_dashboard.exe --connect-test against https://agents.organic-machine.com — same .exe with the fix now returns "OK 11" in <2s. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>