-
Notifications
You must be signed in to change notification settings - Fork 244
Adaptive codex timeout based on PR size and media proofs — large PRs with videos consistently time out #272
Copy link
Copy link
Open
Labels
P1Urgent regression or broken agent/channel workflow affecting real users now.Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopThis issue is about crashes, hangs, restart loops, or process-level availability.This issue is about crashes, hangs, restart loops, or process-level availability.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P1Urgent regression or broken agent/channel workflow affecting real users now.Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopThis issue is about crashes, hangs, restart loops, or process-level availability.This issue is about crashes, hangs, restart loops, or process-level availability.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
The default codex_timeout_ms of 600,000ms (10 minutes) is too short for large PRs, especially those with video proofs. External contributors have no way to override this timeout — the repository_dispatch payload
in dispatchItemReview() never includes codex_timeout_ms, so it always falls through to the hard default.
Concrete example
PR #91093 (openclaw/openclaw#91093) in openclaw/openclaw:
┌───────────────┬────────────────────────────────────────┐
│ Metric │ Value │
├───────────────┼────────────────────────────────────────┤
│ Files changed │ 71 │
├───────────────┼────────────────────────────────────────┤
│ Lines added │ +4,176 │
├───────────────┼────────────────────────────────────────┤
│ Commits │ 18 │
├───────────────┼────────────────────────────────────────┤
│ Video proofs │ 2 (.mov files in PR body) │
├───────────────┼────────────────────────────────────────┤
│ Codex result │ spawnSync codex ETIMEDOUT (repeatedly) │
└───────────────┴────────────────────────────────────────┘
This PR is also tagged size: XL.
Why this happens
Two videos could consume up to 180s just in download, plus ffmpeg processing time — all before codex even starts. This time counts against the same outer shell timeout in sweep.yml.
3. No adaptive scaling: pr-surface-stats.ts already classifies files by type and counts additions/deletions, but this data is never used to adjust the timeout. Every PR gets the same 10 minutes regardless of 5
files or 80 files.
Suggested fixes
Option A (quick): Add codex_timeout_ms to the dispatchItemReview() client_payload, derived from PR surface stats (e.g., file count × baseline, capped at some max). This lets the workflow pick the right timeout
without any manual config.
Option B (more thorough): Factor video preprocessing time into the timeout separately — if N video proofs are detected, add N * 120s to the codex timeout budget.
Option C (architectural): Run video proof preprocessing in a separate, earlier step (e.g., in the plan job or a dedicated media job), so the review shard starts with preprocessed artifacts and the codex timeout
only covers the review itself.
Related code