Repository navigation
fix: stop stalled GitHub requests from hanging Code Mode turns - #200927
Conversation
Bound direct GitHub tool requests before Gateway preparation so a stalled request returns to Code Mode instead of waiting for the reply watchdog. Reuse the existing non-cancelling response deadline and preserve handoff receipts and later session resumption. Timed-out accepted work may still finish; inspect existing publication state before retrying.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR gives direct GitHub tool requests a ten-minute response deadline while preserving explicit timeouts and yielding handoffs. Example: Code Mode awaits github_publish({}) and its Gateway request never settles.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it narrowly fixes a source-confirmed unbounded GitHub request wait still present on current main, with no concrete introduced correctness defect found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe GitHub agent tool translates session-scoped actions into Gateway requests and returns publication receipts or action results to direct callers and Code Mode. flowchart TD
A[Code Mode guest] --> B[GitHub agent tool]
B --> C[Bounded response wait]
C --> D[Gateway request]
D --> E[Receipt or action result]
C --> F[Catchable timeout]
Technical reviewBest possible solution: Keep the deadline at the existing GitHub tool owner, reusing non-cancelling dispatch waits while preserving receipts, idempotency, and yielding handoffs. Do we have a high-confidence way to reproduce the issue? The current-main call chain demonstrably permits an unbounded in-process publication wait, and the PR reports red-on-base bridge regressions; this review did not execute target code. Is this the best way to solve the issue? The patch is the smallest complete repair shown: bound direct requests once at their existing owner, reuse the established deadline helper, and retain the separately owned handoff lifecycle. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0ca4e7d3db4b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +7, Tests +83. Total +90 across 2 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 17, 2026, 9:42 PM ET / November 18, 2026, 02:42 UTC. |
|
Merged via squash auto-merge.
|
Bound direct GitHub tool requests before Gateway preparation so a stalled request returns to Code Mode instead of waiting for the reply watchdog. Reuse the existing non-cancelling response deadline and preserve handoff receipts and later session resumption. Timed-out accepted work may still finish; inspect existing publication state before retrying.
Bound direct GitHub tool requests before Gateway preparation so a stalled request returns to Code Mode instead of waiting for the reply watchdog. Reuse the existing non-cancelling response deadline and preserve handoff receipts and later session resumption. Timed-out accepted work may still finish; inspect existing publication state before retrying. (cherry picked from commit 7ff0d90) Co-authored-by: RomneyDa <[email protected]>
Bound direct GitHub tool requests before Gateway preparation so a stalled request returns to Code Mode instead of waiting for the reply watchdog. Reuse the existing non-cancelling response deadline and preserve handoff receipts and later session resumption. Timed-out accepted work may still finish; inspect existing publication state before retrying. Release adaptation: Adapt gateway binding to existing readiness branch, preserving validation. Source regression omits unavailable watchdog fixture. (cherry picked from commit 7ff0d90) Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
A Code Mode
execawaitinggithub_publishcan remain in itscallValuebridge until the reply watchdog stops the turn when a Gateway request never settles.User Impact
Stalled direct GitHub requests now return a catchable timeout after ten minutes. Publication receipts and yielding handoffs keep their existing contracts. A response timeout does not undo accepted work: inspect the existing publication before retrying.
Why This Change Was Made
On base
08df47114b98,src/agents/tools/github-publish-tool.ts:611awaits a direct publication without a timeout.src/agents/tools/in-process-gateway.ts:491converts an omitted timeout tonull, leaving the in-process wait unbounded. The same gap affects the other direct actions without an explicit limit.Bound the whole direct request promise at the GitHub tool owner with the existing non-cancelling
waitForGatewayDispatchhelper, including preparation before handler dispatch. Reuse the existing 600,000 ms preparation budget and preserve explicit action timeouts. Yielding preparation and local-checkout publication are already direct-only; their receipts and later session resumption remain unchanged. The incident's exact action remains unknown; this fixes the reproduced missing-deadline path.Evidence
The regression uses real Node and QuickJS workers, the Code Mode bridge, and the subscribed tool runtime, with a Gateway request held pending. On base, both cases fail after 600,001 simulated milliseconds because
execstill has no result. With the fix, both return the catchable Gateway timeout without another request.08df47114b984cc47afd874e18964c21e2ff7350: 2 failed,expected undefined to match object { status: 'completed' }.git diff --checkpass.pnpm buildpasses, including Code Mode workers.08df47114b98: scoped-clean, no actionable findings. The reviewed source is committed unchanged.New regression timing: 2.013 s test time, 25.66 s wall in the final focused run; all three focused suites took 199.79 s including worker compilation. CI timing is pending. The change adds 7 net production lines and 83 test lines, reusing the existing deadline owner without new state or a bridge-specific policy.