Skip to content

Increase the post-result harness watchdog default from 20 seconds to 2 minutes #51289

Description

@dsyme

Problem

The post-result harness watchdog currently defaults to 20 seconds of stdio inactivity after a terminal safe output has been emitted. This is too short for legitimate shell commands in large repositories.

A shell command can spend more than 20 seconds doing useful work without writing to stdout or stderr. Common examples include:

  • recursive find / grep / rg analysis in monorepos
  • computing diffs across several branches
  • builds and compilations
  • test discovery or test execution with buffered output
  • package-manager and repository operations that are quiet between phases

This is especially surprising because shell work does not consume model tokens while it runs. The incremental cost is runner CPU time, which is much cheaper than terminating a productive agent session and repeating its model work in a later run.

Observed impact

In github/github, a representative recursive test-file scan took 20.23 seconds without producing stdout. The checkout has approximately 126,000 tracked files and 23,500 Ruby test files. That ordinary scan alone exceeds the current default.

A multi-phase gh-aw workflow repeatedly exhibited this sequence:

  1. The agent emitted an intermediate safe output such as add_comment or add_labels.
  2. The post-result watchdog armed because that output is classified as terminal.
  3. The agent continued to a later phase and started a legitimate repository scan or build step.
  4. After approximately 20 seconds without stdio, the harness sent SIGTERM.
  5. The harness treated the session as successful because a terminal safe output already existed, even though planned work was unfinished.

Several runs were terminated while selecting candidates. One run had already edited and committed valid changes and logged Now create the PR, but was terminated before it could call create_pull_request.

Proposal

Raise DEFAULT_POST_RESULT_WATCHDOG_IDLE_TIMEOUT_MS from 20 seconds to 2 minutes (120,000 ms) for all harnesses using the shared resolver.

Keep GH_AW_HARNESS_WATCHDOG_TIMEOUT_MS as an override and retain the existing 10-minute maximum.

Two minutes still bounds genuine CLI hang-on-exit behavior while allowing normal quiet shell work in monorepos and routine builds to complete.

Acceptance criteria

  • The shared default is 120,000 ms.
  • Copilot and Codex harness behavior remains consistent.
  • Tests cover the new default and existing override/clamping behavior.
  • Release notes mention the longer post-result grace period.
  • User-facing documentation explains the watchdog semantics and override (tracked separately).

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions