Repository navigation
Disable undici header/body timeouts on the review watch long-poll - #149
Open
cathrynlavery wants to merge 1 commit into
Open
cathrynlavery wants to merge 1 commit into
cathrynlavery wants to merge 1 commit into
Conversation
The Done Reviewing long-poll holds response headers open until the user finishes, so undici's default ~300s headersTimeout killed any roughdraft open wait past five minutes with UND_ERR_HEADERS_TIMEOUT. Route only the watch fetches in the CLI and MCP server through a shared undici Agent with headersTimeout and bodyTimeout disabled; explicit --timeout still aborts via the existing AbortSignal. Adds a regression test and pins undici; also fixes pnpm-workspace.yaml placeholder allowBuilds values that broke pnpm install. Mirrors commit 24fc791 from roadmap/watch-headers-timeout, which was never merged.
|
@cathrynlavery is attempting to deploy a commit to the Lex Team on Vercel. A member of the Team first needs to authorize it. |
jmatthewpryor
added a commit
to jmatthewpryor/roughdraft
that referenced
this pull request
Sep 11, 2026
… bump to 0.1.11-patched.2 Adapts Lex-Inc#149 to a per-watch undici Agent instead of a process-wide singleton: the singleton kept a pooled keep-alive socket to a server that had since restarted, so the next watch in the same process failed with UND_ERR_SOCKET "other side closed". The Agent is now created per watch in both the CLI and the MCP watch tool and closed in a finally. Fixes a pre-existing race in two CLI tests that posted the review event as soon as the watch request had been sent, before the server had registered the waiter; they now poll /api/review-events/status for a watcher first. Documents the new patches, the Lex-Inc#149 adaptation, the merge-conflict notes, and the new "handoff after watcher lost" state in the screenshot guide. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
roughdraft openwaits onPOST /api/review-events/watch, a long-poll that holds response headers open until the reviewer clicks Done Reviewing. undici's defaultheadersTimeout(~300s) kills any review session longer than five minutes withUND_ERR_HEADERS_TIMEOUT, so long reviews always crash the waiting CLI. We've hit this repeatedly across several machines over the past month.Fix
getReviewWatchDispatcher()inpackages/server/src/network.ts: a lazily-created sharedundici.Agent({ headersTimeout: 0, bodyTimeout: 0 }).dispatcheronly on the watch fetches incli.ts(runWatch) andmcp.ts— no global timeout changes; an explicit--timeoutstill aborts via the existingAbortSignal.undiciadded as an explicit dependency; regression test included (watch with an injected 500ms headers timeout).allowBuildsvalues inpnpm-workspace.yamlthat brokepnpm installon pnpm 11.8.Verification