Skip to content

ci: the agent audit could never pass, and hung six hours failing - #40

Merged
github-actions[bot] merged 1 commit into
mainfrom
ci/agent-audit-cannot-pass
Aug 18, 2026
Merged

ci: the agent audit could never pass, and hung six hours failing#40
github-actions[bot] merged 1 commit into
mainfrom
ci/agent-audit-cannot-pass

Conversation

@melbinjp

Copy link
Copy Markdown
Owner

See the commit message. Short version:

  • --tunnel none is local-only and has no setup URL by design; the audit waited for one.
  • The wait was unbounded: readline() blocks and the clock is only re-checked between reads.
  • Even on arrival the line reads Agent setup URL: stored in the owner-readable connection file, which was then passed to urlopen().

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_url and 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: 10 on 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 None on 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.

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.
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

Jules Review

COVERAGE: a753338 2 files

Summary

This PR effectively resolves a persistent CI hang in the agent_audit.py script. The prior implementation blocked indefinitely on stdout.readline() waiting for a setup URL that a local-only server intentionally does not emit. The new approach correctly handles this by robustly polling the local connection file for valid JSON with a hard deadline. It properly delegates draining the server output to a daemon thread to prevent deadlocking the pipe buffer, and verifies the connection end-to-end using the mcp.health_url. Finally, introducing a timeout-minutes: 10 job-level bound in .github/workflows/agent-audit.yml is an excellent fail-safe that ensures no future script-level regression can exhaust the 6-hour runner maximum.

VERDICT: approve


This review never edits code or force-blocks a merge. No blocking issues were found, so this PR was auto-approved.

@github-actions
github-actions Bot enabled auto-merge (squash) August 18, 2026 10:38

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval: Jules found no blocking issues (verdict: approve). See the review comment above.

@github-actions
github-actions Bot merged commit 1fa2421 into main Aug 18, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant