fix(open-pr): time out hung git push and gh pr create - #189
Conversation
A stalled origin or GitHub CLI used to block clawpatch open-pr indefinitely because those two runCommandArgs calls had no timeoutMs. Providers and validation already time out. Pass 120s for git push and 60s for gh pr create, with env overrides for operators. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 15, 2026, 7:51 PM ET / 23:51 UTC. ClawSweeper reviewWhat this changesThe PR adds configurable timeouts to Merge readiness⛔ Blocked until stronger real behavior proof is added - 8 items remain Keep open: the timeout wiring is focused, but the new 120-second push and 60-second PR-create defaults can fail existing slow workflows. Resolve that upgrade contract, remove the release-owned changelog edit, and provide an actual Priority: P1 Review scores
Verification
How this fits together
flowchart LR
A[Recorded patch] --> B[Open PR workflow]
B --> C[Git push]
C --> D{Before timeout?}
D -->|yes| E[GitHub CLI PR creation]
D -->|no| F[Git failure]
E --> G{Before timeout?}
G -->|yes| H[Persist PR state]
G -->|no| I[GitHub failure]
Decision needed
Why: Current behavior has no deadline, while the branch turns slow operations past fixed limits into failures; the default and recovery contract need maintainer intent. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Adopt a documented, upgrade-safe timeout policy for remote publish steps, retain focused hang coverage, remove the changelog edit, and attach a redacted actual Do we have a high-confidence way to reproduce the issue? Yes for the source path: current Is this the best way to solve the issue? Unclear: the existing runner is the right narrow mechanism, but the proposed short defaults create an undocumented upgrade contract that needs approval. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c19979fa0225. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(open-pr): time out hung git push and gh pr create This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
What Problem This Solves
Fixes an issue where users running
clawpatch open-prwould hang indefinitely whengit pushorgh pr createstalled on the remote. Providers and validation already passtimeoutMsintorunCommandArgs. These two network calls did not, so a wedged origin or GitHub CLI pinned the process until an outer job killed it.Why This Change Was Made
git pushnow uses a 120s deadline andgh pr createuses a 60s deadline, the samerunCommandArgs({ timeoutMs })path already used by providers and validation. Operators can raise or lower those values withCLAWPATCH_GIT_PUSH_TIMEOUT_MSandCLAWPATCH_GH_PR_CREATE_TIMEOUT_MS. Localgit switch/add/commitcalls are unchanged.User Impact
A stalled push or GitHub CLI no longer leaves
clawpatch open-prrunning forever. The command fails closed withgit-failureorgithub-failureand the timeout text fromrunCommandArgs. Successful opens behave the same.Evidence
Before this change,
src/open-pr.tscalledrunCommandArgsforgit pushandgh pr createwith notimeoutMs. After the change, a livenodeimport of the compiled helpers prints 120000 / 60000. A hung child withtimeoutMs: 80returns exit 124 andcommand timed out after 80ms.Compiled
open-prcall sites:Live compiled helpers:
Real behavior proof
Behavior or issue addressed:
clawpatch open-prhung forever whengit pushorgh pr createstalled, because thoserunCommandArgscalls had notimeoutMs.Real environment tested: macOS 26.6.1, Node v26.7.0, clawpatch built from this branch at
/tmp/oc-impl-clawpatch-timeout.Exact steps or command run after this patch:
node /tmp/proof-open-pr-timeout.mjs rg -n "timeoutMs" dist/open-pr.jsEvidence after fix: terminal output from the patched build:
Observed result after fix: The compiled helpers report 120s for git push and 60s for
gh pr create. A hung child is cut off with exit 124 instead of blocking the process.What was not tested: A live GitHub.com push that actually stalls on the public remote. Local hang wrappers and the compiled
runCommandArgstimeout path were used instead.Summary
Same hang class as openclaw/clawsweeper#1175 (hung git I/O) and openclaw/clawpatch#115 (wedged Codex exec). The missing deadlines date to the
open-prextract in157ed753(2026-06-18).