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
porch: per-check timeout_ms in protocol.json (checks die at the fixed 5-minute cap) #1814
porch kills any check still running after a fixed five minutes (DEFAULT_TIMEOUT_MS in porch's checks module). Nothing in a protocol.json can change it. In a repo whose Python test suite has ~17,000 tests, the suite at eight xdist workers takes 239 s on an idle machine and is killed at the cap as soon as the machine carries any other load (measured today: killed at 280 s at 1-minute load 7 to 15; killed four times in one afternoon on four lanes). Every lane that touches that package is now blocked at porch.
Root cause
The check runner already accepts a per-call timeout, but porch never passes one; the constant is the only value.
Proposed fix
Each check in protocol.json may carry an optional timeout_ms; porch passes it to the runner; absent, the default stays five minutes so existing protocols are byte-identical. Small guards keep the default so a hung check still dies fast; long suites set what they need.
When a check times out, porch SIGTERMs only its direct child; a grandchild test worker keeps running and porch done waits forever. Repos work around it with a timeout-wrapped check command that ends before porch's cap. A process-group kill on timeout would remove the workaround.
Filed by the Shannon main architect on the owner's ruling 2026-10-16.
Verified in packages/codev/src/commands/porch/checks.ts: runCheck and runPhaseChecks already accept timeoutMs (default DEFAULT_TIMEOUT_MS = 5 min) and no caller passes one; on timeout the runner sends SIGTERM then SIGKILL to the direct child only. Both halves of the issue are in scope.
Schema. A check object in protocol.json may carry an optional timeout_ms (positive integer). The per-check override map in .codev/config.jsonporch.checks (see types.ts) accepts the same key and wins over protocol.json, so an adopter can lengthen a check without forking the protocol. Absent both, the default stays 5 min; existing protocols must behave byte-identically.
Plumbing.runPhaseChecks resolves the effective timeout per check and passes it to runCheck. The timeout message keeps reporting the effective value.
Process-group kill. Spawn checks with detached: true and on timeout signal the group (process.kill(-pid, 'SIGTERM'), then SIGKILL after the existing grace). Keep stdio behaviour unchanged. Guard the negative-pid call so a group that is already gone does not throw.
Validation. A non-positive or non-integer timeout_ms fails protocol loading loudly with the check name; no silent fallback.
Docs. Document timeout_ms in the porch check docs in both trees (codev/ and codev-skeleton/), and in the porch skill if it lists check fields.
Tests. Default unchanged when the key is absent; protocol.json value honoured; config override wins; invalid value rejected; a check whose child spawns a grandchild that ignores SIGTERM is fully dead after timeout and runCheck returns.
Activity
waleedkadous commentedon Oct 17, 2026
Baked decisions (architect)
Verified in
packages/codev/src/commands/porch/checks.ts:runCheckandrunPhaseChecksalready accepttimeoutMs(defaultDEFAULT_TIMEOUT_MS= 5 min) and no caller passes one; on timeout the runner sends SIGTERM then SIGKILL to the direct child only. Both halves of the issue are in scope.timeout_ms(positive integer). The per-check override map in.codev/config.jsonporch.checks(seetypes.ts) accepts the same key and wins over protocol.json, so an adopter can lengthen a check without forking the protocol. Absent both, the default stays 5 min; existing protocols must behave byte-identically.runPhaseChecksresolves the effective timeout per check and passes it torunCheck. The timeout message keeps reporting the effective value.detached: trueand on timeout signal the group (process.kill(-pid, 'SIGTERM'), thenSIGKILLafter the existing grace). Keep stdio behaviour unchanged. Guard the negative-pid call so a group that is already gone does not throw.timeout_msfails protocol loading loudly with the check name; no silent fallback.timeout_msin the porch check docs in both trees (codev/andcodev-skeleton/), and in theporchskill if it lists check fields.runCheckreturns.Protocol: BUGFIX.
waleedkadous commentedon Oct 17, 2026
On it! Working on a fix now.
Fix #1814: Honor per-check timeout_ms and kill the whole check tree o…
[Bugfix #1814] Thread: fix-phase notes
[Bugfix #1814] Resolve a timed-out check only once its process group …
[Bugfix #1814] Address claude CMAP nits: undefined-check for timeout_…
[Bugfix #1814] Keep the signal relay through the post-timeout wait; w…
[Bugfix #1814] Document porch.checks overrides and timeout_ms in the …
[Bugfix #1814] Announce a porch.checks override that sets only timeou…
[Bugfix #1814] Document runCheck's setsid and CLI-only signal listeners
[Bugfix #1814] Thread: integration review round 1
Merge pull request #1815 from cluesmith/builder/bugfix-1814