Skip to content

[muse] fix(shared): bound cloudflared download with 10-minute timeout - #14

Closed
kvnloo wants to merge 73 commits into
mainfrom
muse/relay-client-download-timeout
Closed

kvnloo wants to merge 73 commits into
mainfrom
muse/relay-client-download-timeout

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Problem: cloudflared's downloadAsset ran httpClient.execute and response.arrayBuffer with no deadline. A wedged-but-alive endpoint (or a stalled drip) parked the relay-client install forever — same unbounded-wait family as the previously fixed codex/app-server request timeouts and the OAuth/relay-unlink CLI timeouts.

Fix: wrap both network hops in Effect.timeout(CLOUDFLARED_DOWNLOAD_TIMEOUT) (10 minutes, generous for a ~40MB binary). Expiry flows through the existing mapError into RelayClientInstallError{reason: "download_failed"}, so the install error contract is unchanged. 2 files, +59 lines.

Validation:

  • New test fails a stalled download after the download timeout (TestClock + forkChild + never-responding HttpClient): FAILS on base (hangs to the 60s vitest timeout — the defect is literally a hang), passes with the fix.
  • Full relayClient.test.ts: 6/6 green with fix. tsc --noEmit clean on packages/shared. vp fmt clean.

Authored with AI assistance (Muse, Meta's Muse Spark) under the contributor's direction. The contributor reviewed the diff and ran the focused tests before opening this PR.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS labels Sep 28, 2026
SunkenInTime and others added 28 commits October 7, 2026 20:16
…second (pingdotgg#17029)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…pingdotgg#17028)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ngdotgg#17079)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
pingdotgg#15385)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…gdotgg#15397)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ingdotgg#15893)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…otgg#16296)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…dotgg#16330)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
StiensWout and others added 19 commits October 8, 2026 08:22
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…id (pingdotgg#17211)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…rs (pingdotgg#17077)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
…otgg#17214)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…otgg#14314)

Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…otgg#17271)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…17291)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…gg#11059)

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com>
…dflared (pingdotgg#17275)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge
juliusmarminge force-pushed the muse/relay-client-download-timeout branch from 003d910 to 822e4f1 Compare October 8, 2026 20:15
ScottN-PV and others added 4 commits October 8, 2026 13:19
…pingdotgg#16998)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…0585)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
cloudflared's downloadAsset ran httpClient.execute and response.arrayBuffer
with no deadline. A wedged-but-alive endpoint (or a stalled drip) parked the
relay-client install forever - same unbounded-wait family as the codex/app-
server request timeouts and the OAuth/relay-unlink CLI timeouts.

Wrap both network hops in Effect.timeout(CLOUDFLARED_DOWNLOAD_TIMEOUT)
(10 minutes, generous for a ~40MB binary). Expiry flows through the
existing mapError into RelayClientInstallError{reason: download_failed},
so the install error contract is unchanged.

Authored with AI assistance (Muse, Meta's Muse Spark) under the
contributor's direction. The contributor reviewed the diff and ran the
focused tests before opening this PR.
@juliusmarminge
juliusmarminge force-pushed the muse/relay-client-download-timeout branch from 822e4f1 to 89f9bff Compare October 8, 2026 20:25
@kvnloo kvnloo added the keep pr-janitor: never auto-close label Oct 17, 2026
@kvnloo

kvnloo commented Oct 18, 2026

Copy link
Copy Markdown
Owner Author

LANDED — closing this stale downstream mirror, not merging it. Canonical pingdotgg/t3code#14139 is merged (2026-10-08T20:31:54Z) as 580948708b66f2a971199670f76cb6b43119e9a4. Fresh fork head, current origin source head and retained branch all equal 89f9bff9627ef4d7c38ac35ba6be737b8c6a7bc7. Origin merged endpoint independently returns HTTP 204; resolved merge commit contains the same complete two-file patch as the accepted origin PR. Current fork conversation/reviews/inline comments contain no live lease or retention request; this ordinary implementation PR is not canonical queue #42.

Original Kevin Rajan / kvnloo contribution implemented with Meta Muse Spark via Muse; juliusmarminge current-main rebase and test port. Original PR body, historical tests/reviews, commit ancestry and branch muse/relay-client-download-timeout are preserved. Existing evidence is historical, not rerun certification. No new test/CI, source change, origin write, branch deletion or default merge. Closeout authorized by the current direct user instruction; bounded queue lease.

@kvnloo kvnloo closed this Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

keep pr-janitor: never auto-close size:XS vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.