ci: the agent audit could never pass, and hung six hours failing - #40
Conversation
It launched the server with --tunnel none and then waited for a stdout line reading 'Agent setup URL:'. A local-only server has no setup URL by design - mcp_url_launcher says exactly that when you ask it for one. The line never came. The wait was not bounded either. 'while time.time() - start < timeout' only re-checks the clock BETWEEN reads, and readline() blocks; the server stayed alive and quiet after its banner so the pipe never closed. timeout = 15 was decorative. Run 32043881040 ran 15:57:11 to 21:57:27 - six hours, killed at GitHub's ceiling - and its last output was a health check 0.03s in. A third defect underneath: the line, when it does print, reads 'Agent setup URL: stored in the owner-readable connection file', so split(...)[1] yields that sentence and the script called urlopen() on it. Now it reads the connection file, which is where a local-only server puts exactly what an agent needs and whose shape the audit's own later code already assumed. Nothing is scraped from stdout, so nothing can block on it; output is drained on a daemon thread for CI visibility and so the pipe cannot fill and deadlock the server. Verified: the wait returns None on deadline (~2s, not forever), refuses a half-written file, and reads a complete one that appears late. timeout-minutes: 10 on the job as well, because a script-level bound can have a hole in it and a job-level one cannot.
Jules ReviewCOVERAGE: a753338 2 files SummaryThis PR effectively resolves a persistent CI hang in the VERDICT: approve This review never edits code or force-blocks a merge. No blocking issues were found, so this PR was auto-approved. |
See the commit message. Short version:
--tunnel noneis local-only and has no setup URL by design; the audit waited for one.readline()blocks and the clock is only re-checked between reads.Agent setup URL: stored in the owner-readable connection file, which was then passed tourlopen().Run 32043881040 ran 15:57:11 to 21:57:27 and was killed at GitHub's 6 hour ceiling. Its last output is a health check 0.03s in.
Now reads the connection file, which already holds
mcp.url,mcp.health_urland the Bearer token, and which the audit's own later code already expected the shape of. Server output is drained on a daemon thread so the pipe cannot fill and deadlock the server, and nothing waits on it.timeout-minutes: 10on the job too, because a script-level bound can have a hole in it and a job-level one cannot.Checked locally: the wait returns
Noneon deadline in ~2s rather than forever, refuses a half-written file, and reads a complete one that appears late. The script is Unix-only (os.setsid), so the end to end proof is this PR's own run.