Skip to content

fix(pr): pr monitor waits for the checks of a code pull request #5417

Done

Description

@dan-petty

Problem Description

AGENTS.md rule 6 tells an agent to watch each pull request with devops pr monitor <pr_number>. The default --timeout of the command is 300 seconds (src/devops_cli/commands/pr.py, option --timeout). The required checks of a code pull request take longer than that: on #5416 the four Tests & Coverage shards ran 4 min 49 s and the aggregate Tests & Coverage job ran 57 s after them, so the checks settle about 5 min 50 s after the push. A monitor that starts at once after devops pr create ends before the checks settle, and the agent must run it again.

Reproduction Steps

  1. Push a branch that changes a file under src/ and open a draft with uv run devops pr create.
  2. Run uv run devops pr monitor <pr_number> at once, with no --timeout.

Expected vs Actual Behavior

Expected: with the default options, the monitor waits until the required checks of a normal code pull request settle.

Actual: the monitor stops after 300 seconds while the aggregate check is still pending.

Environment Diagnostics

devops-cli 0.128.0, devcontainer, uv run devops.

Logs, Traces, or Terminal Output

✗ PR #5416 monitoring timed out after 300s: 1 check(s) pending: Tests & Coverage.
Elapsed: 5m 11s

A second run with --timeout 560 reported Checks: 24/24 passed (24/24 done).

Source: #5416

Alternatives check of 2026-11-23: none.
Tool: none found.
Reason: Searches for an open, maintained PR-check monitor with a settable default timeout returned no relevant tool; the need is one changed default in this repository's own devops pr monitor, which no external tool can supply.

Lacks:

  • No external tool sets this repository's own command default
  • No tool waits on this repository's required check set
  • Requires a named constant and one test in this repository

Proposed design

Problem statement

The devops pr monitor command stops after 300 seconds by default. The required checks of a code pull request settle later: about 5 min 50 s on #5416 and about 6 min 28 s on #5478. An agent must then run the monitor again. Raise the default timeout to 600 seconds.

Acceptance criteria

Requirement: Named default timeout

The project SHALL define DEFAULT_PR_MONITOR_TIMEOUT_SECONDS as 600 in src/devops_cli/config/defaults.py.

Scenario: Constant holds 600 seconds

  • WHEN a unit test imports DEFAULT_PR_MONITOR_TIMEOUT_SECONDS.
  • THEN the value is 600.

Requirement: Monitor uses the default timeout

The devops pr monitor command MUST use DEFAULT_PR_MONITOR_TIMEOUT_SECONDS as the default of its --timeout option.

Scenario: Command default matches the constant

  • WHEN a unit test inspects the default of the timeout parameter of monitor_pr_command.
  • THEN the default equals DEFAULT_PR_MONITOR_TIMEOUT_SECONDS, which is 600 seconds.

Requirement: Explicit timeout override

The devops pr monitor command MUST keep an explicit --timeout value instead of the default.

Scenario: Explicit timeout is kept

  • WHEN a unit test builds the dry-run plan of devops pr monitor --timeout 42.
  • THEN the planned monitor request uses a timeout of 42 seconds.

Existing Tool Considered

The alternatives check of 2026-11-17 in the issue body returned none with Tool: none found. No open, maintained tool covers the default --timeout of this repository's own devops pr monitor command. The change edits one default and adds one test; estimated cost is under 1k tokens and 15 minutes.

Key questions

  • Which default timeout should devops pr monitor use?: 600 seconds. The issue and its reply record waits up to about 6 min 28 s. A 600-second default leaves about 3.5 minutes of margin and keeps a finite failure time. (best practice) [sources: src/devops_cli/commands/pr.py]
    • Rejected: Keep 300 seconds. The monitor stops before the required checks settle; this is the reported defect.
    • Chosen: Raise to 600 seconds. It covers the observed 6 min 28 s wait with about 3.5 minutes of margin.
    • Rejected: Raise to 900 seconds. It adds up to 5 minutes of extra wait after a failure for no observed need.
    • Rejected: Wait with no timeout. A stuck check would hang the agent and break bounded automation.
  • Should the new default be a named constant?: Yes. Add DEFAULT_PR_MONITOR_TIMEOUT_SECONDS = 600 to src/devops_cli/config/defaults.py and use it in monitor_pr_command. (best practice) [sources: src/devops_cli/config/defaults.py, src/devops_cli/commands/pr.py]
    • Rejected: Inline literal 600. It repeats a magic number and is harder to test.
    • Chosen: Named constant. The PR defaults already use named constants in config/defaults.py.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/pr
    status/new
    value/medium
    effort/low
    on Nov 13, 2026
  2. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 13, 2026
  4. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    The same timeout occurred on #5478 (a src/ change), 2026-11-13. The first uv run devops pr monitor 5478 with the default options gave:

    ℹ [280s] Checks: 23/24 passed (23/24 done)
    ✗ PR #5478 monitoring timed out after 300s: 1 check(s) pending: Tests & Coverage.
    Elapsed: 5m 10s
    

    A second run with the default options reported Checks: 24/24 passed (24/24 done) after 1 min 18 s.

  5. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: The searches returned no relevant tool or library: results were unrelated generic pages, and nothing found supplies a longer default wait for the repository's own devops pr monitor command. The issue asks for a change inside this repository — raising the --timeout default (300 s) above the ~5 min 50 s that the required checks take — which no external tool or library covers.

    Tool: none found

    Lacks:

    • No found tool changes the default --timeout of devops pr monitor in src/devops_cli/commands/pr.py
    • No found tool waits on this repository's aggregate Tests & Coverage check with a default long enough for a src/ change

    Searches run:

    • tool wait for GitHub pull request status checks with configurable timeout, results: 5
    • gh pr checks --watch wait for pull request checks to complete, results: 5
    • "gh pr checks" --watch manual GitHub CLI, results: 5
    • python library poll GitHub pull request check runs until complete, results: 5
    • gh pr checks, results: 5
    • devops-cli pr monitor timeout, results: 5
    • GitHub Actions check suite aggregate job wait script timeout default, results: 5
    • cli.github.com manual gh pr checks watch interval, results: 5
    • GitHub CLI pull request checks monitor command, results: 5

    Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.

  6. added
    status/ready
    and removed
    status/new
    on Nov 17, 2026
  7. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 2620fae (see proposed design in issue body).

  8. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 25, 2026
  9. removed
    status/in-review
    on Nov 25, 2026
  10. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-25 07:43 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/prsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions