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
fix(github): pr monitor polls again after one failed read #4838
devops pr monitor <n> --timeout 1800 stops at the first GitHub read that fails. One read of the pull request that times out after 30 s ends the whole watch with exit 1, although 1,700 s of the watch remain. The agent must start the monitor again by hand.
In src/devops_cli/github/pr_monitor.py, monitor_pr calls get_pr_monitoring_status in its loop with no handling of a failed read. fetch_pr_details raises GitHubOperationError ("Failed to query PR #: ...") when gh exits non-zero, and the error leaves the loop.
Reproduction Steps
Open a pull request whose checks take more than one poll interval.
Run devops pr monitor <n> --timeout 1800 while the GitHub API is slow (many sessions use one token).
One read of the pull request times out.
Expected vs Actual Behavior
Expected: the monitor counts a failed read as a poll with no new data, says so, and polls again on the next interval until its own timeout. It stops early only when the reads fail for a bounded number of polls in a row, and then names the last error.
Actual: the monitor exits 1 at the first failed read.
Environment Diagnostics
devops-cli at main (2026-11-11), devcontainer, gh through the rate limiter of devops.
Logs, Traces, or Terminal Output
ℹ Monitoring PR #4794 for CI checks and review completion...
✗ Failed to query PR #4794: GitHub API command timed out after 30.0 seconds
One more case on 2026-11-11, PR #4820: devops pr monitor 4820 --timeout 1800 printed ✗ Failed to query PR #4820: GitHub API command timed out after 30.0 seconds after one poll at 0s and exited after 5 minutes. The checks of the pull request were still queued, so a second poll would have read the same state.
One more occurrence (2026-11-11, about 21:10 UTC):uv run devops pr monitor 4801 --timeout 1800 stopped after one read with this line, while the checks of the re-run were still in progress:
PR #4801 check verification failed closed: GitHub check-runs API error: GitHub gave no readable answer to GET /repos/dan-petty/devops-cli/commits/539ea451.../check-runs?per_page=100 (page 1): ConnectTimeout
The rule A GET that loses its connection is sent again of openspec/specs/github-session-retry/spec.md names RemoteProtocolError, ReadError and WriteError, but not ConnectTimeout. A GET that never connected sent nothing, so a resend is safe. The same output also gives the hint gh run view --log-failed <run_id>, which is a bare gh command (AGENTS.md rule 7).
One more occurrence on 2026-11-11: devops pr monitor 4826 --timeout 1800 stopped with exit 1 after 18 min 16 s with "Failed to query PR #4826: GitHub API command timed out after 30.0 seconds", when 31 of 32 checks were done. In the same minutes, devops gh rate-limit and one devops gh api -X POST also timed out after 30 s, but the POST had effect on GitHub.
One more case on 2026-11-12: devops pr monitor <pr> --timeout 1800 stopped after 2 minutes. It printed "Checks: 13/23 passed", then "Failed to query PR: GitHub API command timed out after 30.0 seconds", and exited. The checks were still running.
Another case on 2026-11-12: devops pr monitor 4916 --timeout 1800 stopped after 6 minutes at one failed read, ✗ Failed to query PR #4916: error connecting to api.github.com. I started the monitor again by hand.
Seen again on 2026-11-12: devops pr monitor 4931 --timeout 1800 stopped after 82 s with "Failed to query PR #4931: GitHub API command timed out after 30.0 seconds" (exit 1). The checks were still running. The host load average was about 40 at that time.
New evidence, 2026-11-12: devops pr monitor 5070 --timeout 1800 stopped after 4 min 33 s at one failed read of the pull request: ✗ Failed to query PR #5070: gh: HTTP 503. At that time 11 of 27 checks were done, and 1,527 s of the watch remained. A 503 is a server error that GitHub can answer again, so the monitor must poll again on the next interval, as this issue asks.
It occurred again on 2026-11-12. devops pr monitor 5106 --timeout 1800 stopped after 5 m 39 s with one failed read and exit code 0, while 6 of 30 checks were still not done:
One more case, on 2026-11-12 at about 15:20Z: devops pr monitor 5113 --timeout 1800 stopped after 418 s with ✗ Failed to query PR #5113: gh: HTTP 503, while 4 of 21 checks still ran. A new start of the same command stopped after 2.5 s with the same line. The REST read of the check runs of the same commit (devops gh api repos/{owner}/{repo}/commits/<sha>/check-runs) worked at the same time. So an HTTP 503 of GitHub is a second error that the monitor must count as a poll with no new data.
Seen again on 2026-11-12 with PR #5110: devops pr monitor 5110 --timeout 1800 stopped at 146 s with Failed to query PR #5110: gh: HTTP 503, exit 1. devops pr ready 5110 failed the same way one time and passed on a second run 20 s later. So a single 503 also stops pr ready, not only the monitor loop.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(github)scope of the title gives the scope.The monitor stops after one failed read, forcing a manual restart, but a workaround exists.It removes a workflow interruption for every user who runs pr monitor under slow API conditions.The change adds a try-except with a bounded failure counter inside one existing loop.Both handle a failed GitHub read in pr_monitor.py, but #806 fixes what a failed Copilot read means while this candidate stops the loop from exiting on any failed read.dan-petty commentedon Nov 11, 2026
One more case on 2026-11-11, PR #4820:
devops pr monitor 4820 --timeout 1800printed✗ Failed to query PR #4820: GitHub API command timed out after 30.0 secondsafter one poll at 0s and exited after 5 minutes. The checks of the pull request were still queued, so a second poll would have read the same state.dan-petty commentedon Nov 11, 2026
One more occurrence (2026-11-11, about 21:10 UTC):
uv run devops pr monitor 4801 --timeout 1800stopped after one read with this line, while the checks of the re-run were still in progress:PR #4801 check verification failed closed: GitHub check-runs API error: GitHub gave no readable answer to GET /repos/dan-petty/devops-cli/commits/539ea451.../check-runs?per_page=100 (page 1): ConnectTimeoutThe rule
A GET that loses its connection is sent againofopenspec/specs/github-session-retry/spec.mdnamesRemoteProtocolError,ReadErrorandWriteError, but notConnectTimeout. A GET that never connected sent nothing, so a resend is safe. The same output also gives the hintgh run view --log-failed <run_id>, which is a bareghcommand (AGENTS.md rule 7).dan-petty commentedon Nov 11, 2026
One more occurrence on 2026-11-11:
devops pr monitor 4826 --timeout 1800stopped with exit 1 after 18 min 16 s with "Failed to query PR #4826: GitHub API command timed out after 30.0 seconds", when 31 of 32 checks were done. In the same minutes,devops gh rate-limitand onedevops gh api -X POSTalso timed out after 30 s, but the POST had effect on GitHub.dan-petty commentedon Nov 12, 2026
One more case on 2026-11-12:
devops pr monitor <pr> --timeout 1800stopped after 2 minutes. It printed "Checks: 13/23 passed", then "Failed to query PR: GitHub API command timed out after 30.0 seconds", and exited. The checks were still running.dan-petty commentedon Nov 12, 2026
Another case on 2026-11-12:
devops pr monitor 4916 --timeout 1800stopped after 6 minutes at one failed read,✗ Failed to query PR #4916: error connecting to api.github.com. I started the monitor again by hand.dan-petty commentedon Nov 12, 2026
Seen again on 2026-11-12:
devops pr monitor 4931 --timeout 1800stopped after 82 s with "Failed to query PR #4931: GitHub API command timed out after 30.0 seconds" (exit 1). The checks were still running. The host load average was about 40 at that time.dan-petty commentedon Nov 12, 2026
New evidence, 2026-11-12:
devops pr monitor 5070 --timeout 1800stopped after 4 min 33 s at one failed read of the pull request:✗ Failed to query PR #5070: gh: HTTP 503. At that time 11 of 27 checks were done, and 1,527 s of the watch remained. A 503 is a server error that GitHub can answer again, so the monitor must poll again on the next interval, as this issue asks.1 remaining item
dan-petty commentedon Nov 12, 2026
It occurred again on 2026-11-12.
devops pr monitor 5106 --timeout 1800stopped after 5 m 39 s with one failed read and exit code 0, while 6 of 30 checks were still not done:I started the monitor again by hand.
dan-petty commentedon Nov 12, 2026
One more case, on 2026-11-12 at about 15:20Z:
devops pr monitor 5113 --timeout 1800stopped after 418 s with✗ Failed to query PR #5113: gh: HTTP 503, while 4 of 21 checks still ran. A new start of the same command stopped after 2.5 s with the same line. The REST read of the check runs of the same commit (devops gh api repos/{owner}/{repo}/commits/<sha>/check-runs) worked at the same time. So an HTTP 503 of GitHub is a second error that the monitor must count as a poll with no new data.dan-petty commentedon Nov 12, 2026
Seen again on 2026-11-12 with PR #5110:
devops pr monitor 5110 --timeout 1800stopped at 146 s withFailed to query PR #5110: gh: HTTP 503, exit 1.devops pr ready 5110failed the same way one time and passed on a second run 20 s later. So a single 503 also stopspr ready, not only the monitor loop.docs(openspec): write the pr-monitor purpose (#4838)
chore(main): release 0.138.0 (#5690)
devops-cli-service commentedon Nov 14, 2026
Released in v0.138.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.138.0
devops-cli-service commentedon Nov 14, 2026
Live since 2026-11-14 15:02 UTC
refactor(github): one pull request verdict for all monitors (#5021)
refactor(github): one pull request verdict for all monitors (#5889)