Skip to content

fix(ci): the openspec commit hook times out on a busy host #7928

Backlog

Description

@dan-petty

Problem Description

The commit hook openspec-gate stops devops ci --only openspec after 90 s (.pre-commit-config.yaml). On a busy host the gate needs about that time or more, so the hook refuses a commit whose change folder is valid.

Reproduction Steps

  1. On a 16-core devcontainer with other test runs in progress (load average about 35), commit a change under openspec/.
  2. The hook openspec gate (change folders and generated skills) fails with exit code 124.

Expected vs Actual Behavior

Expected: the hook gives the verdict of the gate on a busy host, in a time well below its limit.

Actual, on 2026-11-30:

  • Two commits in a row failed with openspec validation (stopped after 1m 27s) and (stopped after 1m 25s).
  • The same commit passed when the load average was about 10.
  • Outside the hook, beside other gates, the gate passed in 1m 25s and 1m 4s.

Environment Diagnostics

devops-cli 0.264.1, Python 3.14.10, devcontainer.

Proposed design

Problem statement

The openspec-gate commit hook stops after 90 seconds. On a busy host the OpenSpec check takes about 91 seconds, so the hook refuses a valid commit. The devops-ci-pre-push hook has the same problem at 40 seconds. The change raises both limits and keeps the pre-push stage under its 120 second bound.

Acceptance criteria

Requirement: OpenSpec hook gives the gate more time

The openspec-gate hook MUST allow the OpenSpec gate to finish when the host load makes the gate take 91 seconds.

Scenario: Busy host OpenSpec gate

  • WHEN The host load makes the OpenSpec gate take 91 seconds, as the issue reports.
  • THEN pre-commit run openspec-gate --all-files exits 0 and prints no timeout message.

Requirement: Pre-push hook gives the fast checks more time

The devops-ci-pre-push hook MUST allow the fast static checks to finish when the host load makes swallowed-failures take 37 seconds.

Scenario: Busy host pre-push check

  • WHEN The host load makes the swallowed-failures check take 37 seconds, as the reply reports.
  • THEN pre-commit run devops-ci-pre-push --hook-stage pre-push --all-files exits 0 and prints no timeout message.

Existing Tool Considered

No alternatives check has run. The existing pre-commit hook runner covers hook execution but lacks a per-hook timeout. The existing GNU coreutils timeout command covers the limit but has no default that fits a busy host. The change sets the limits in .pre-commit-config.yaml and builds no code, so the cost is zero tokens and zero time.

Key questions

  • Which hooks need a larger limit?: Both openspec-gate and devops-ci-pre-push need a larger limit. The reply reports the same class of failure for devops-ci-pre-push. (best practice) [sources: .pre-commit-config.yaml]
    • Chosen: Raise both hook limits. Both hooks show the same timeout class in the issue and the replies, and one file holds both limits.
    • Rejected: Raise only openspec-gate. It leaves the reported 40 second failure of devops-ci-pre-push unfixed.
    • Rejected: Remove both timeouts. A hung hook would block a commit or a push with no bound.
  • Which limit does openspec-gate get?: The openspec-gate hook gets timeout 180. (best practice) [sources: .pre-commit-config.yaml]
    • Chosen: 180 seconds. The reported worst case is 91 seconds, so 180 seconds gives about a 2x margin.
    • Rejected: 120 seconds. The reported worst case is 91 seconds, and a load spike can add more than 29 seconds.
    • Rejected: 90 seconds. This is the current limit that failed in the issue.
  • Which limit does devops-ci-pre-push get?: The devops-ci-pre-push hook gets timeout 60. (best practice) [sources: .pre-commit-config.yaml]
    • Chosen: 60 seconds. The reported worst case is 37 seconds, and the pre-push stage sum is 114 seconds, below the 120 second bound.
    • Rejected: 75 seconds. The pre-push stage sum becomes 129 seconds, above the 120 second bound.
    • Rejected: 40 seconds. This is the current limit that failed in the reply.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

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

    @dan-petty
    OwnerAuthor
    • Priority: The hook blocks valid commits and forces developers to retry under load, increasing error rate and rework.
    • Related: fix(git): the branch-current hook refuses a push on a slow fetch #4969, which asks for a different change. Both describe a pre-commit hook that times out under high host load and refuses a valid operation, but they target different hooks and different commands.
  3. added
    priority/p1-high
    on Nov 30, 2026
  4. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor

    The pre-push hook devops-ci-pre-push has the same class of failure. On 2026-11-30, with a host load of about 26 on 16 cores, it hit its 40 s limit two times while the push of the branch of #7911 ran: the check swallowed-failures was stopped after 37 s and 34 s. The same check passed alone in 32 s.

  5. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor

    Two more cases on 2026-11-30, in a worktree on the branch of #7923. The hook openspec-gate failed with exit code 124 two times: openspec validation (stopped after 1m 29s) and (stopped after 1m 31s). The host had 16 cores, and other gate runs were in progress. The load average was 47 just after the first case. In the same session, another devops ci run waited for the one CI gate slot, which a run of a different worktree held. Each commit passed on a later try with no change of the OpenSpec result.

  6. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor

    Two more cases on 2026-11-30 on the branch of #7923: openspec validation (stopped after 1m 29s) and (stopped after 1m 25s), load average about 30 on 16 cores. Directly after them, uv run devops openspec check alone passed in 76 s at load average 36, so the check itself comes close to the 90 s limit of the hook. The next commit passed with no change.

  7. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

  8. dan-petty commented on Dec 1, 2026

    @dan-petty
    OwnerAuthor

    Observed the same devops-ci-pre-push timeout (exit code: 124) on fix/5453-implement-shell-usage-errors while pushing on a 16-core host at load average 28.7-42.3 (swallowed-failures stopped after 30-38 s, and at load 41.1 deptry, constructs, lint, uv-check, and swallowed-failures stopped after 18 s). Running uv run --no-sync devops ci --check --only lint,format,constructs,swallowed-failures,deps,uv-check,domain without the 40 s limit passed all 8 checks (swallowed-failures took 1m 34s concurrently, 33s alone).

  9. dan-petty commented on Dec 1, 2026

    @dan-petty
    OwnerAuthor

    More cases on 2026-12-01, on the branch of #8045, in a 16-core devcontainer with test runs of other worktrees: 4 or more commits failed in openspec-gate with exit 124, 2 of them at a 1-minute load of 12 to 13 with no pytest-xdist worker (stopped after 1m 29s and 1m 24s). uv run devops ci --only openspec with no hook limit then passed in 2m 33s, while the load rose from 7 to 30. The gate runs openspec validate --all --strict and openspec validate --archived; the checkout holds 399 specs, 25 active changes and 2,107 archived changes. I did not time each run alone. The archive grows with each delivery, so a higher limit will be reached again; see also #8041.

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/p1-highscope/cisource/agentstatus/newtype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions