Repository navigation
fix(tlon): add timeouts to file upload HTTP requests - #102903
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 11:37 AM ET / 15:37 UTC. Summary PR surface: Source +9, Tests +3. Total +12 across 2 files. Reproducibility: Source-level yes: current main omits Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the owner-local timeout wiring once maintainers accept the 30s/120s budgets and exact-head checks confirm the focused Tlon upload tests still pass. Do we have a high-confidence way to reproduce the issue? Source-level yes: current main omits Is this the best way to solve the issue? Yes for the code shape: owner-local constants passed through the existing guarded-fetch seam are narrower than changing a global fetch default or adding configuration. The remaining judgment is the timeout budget, not the implementation layer. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3c048ef05297. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +9, Tests +3. Total +12 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
|
@clawsweeper re-review\n\nAdded loopback timeout proof to the PR body. A hanging local server causes |
|
Maintainer pass complete. Land-ready at exact head Improvement: kept the 30-second Memex lookup deadline and raised both bounded upload deadlines to five minutes, preserving hang protection without making plausible 6 MiB uploads fail too aggressively. Proof:
Known gap: no live Tlon/Memex/custom-S3 credentials were used; request-option forwarding and all three owner branches are covered by focused tests. |
|
Merged via squash.
|
* fix(tlon): add timeouts to file upload HTTP requests * fix(tlon): allow slow bounded uploads --------- Co-authored-by: chengzhichao-xydt <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
* fix(tlon): add timeouts to file upload HTTP requests * fix(tlon): allow slow bounded uploads --------- Co-authored-by: chengzhichao-xydt <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Tlon file delivery made three outbound requests without an owner-level total deadline: Memex upload-URL lookup, Memex upload, and custom-S3 upload. The shared SSRF guard bounds the complete operation only when its caller supplies
timeoutMs, so stalled DNS or response work could otherwise outlive delivery indefinitely.Why This Change Was Made
Pass explicit deadlines through the existing SSRF-safe fetch path at the Tlon owner boundary: 30 seconds for the small upload-URL lookup and 300 seconds for uploads. The five-minute upload limit keeps the operation bounded while allowing realistic headroom for the existing 6 MiB source-media cap.
Direct Undici 8.5.0 source inspection confirmed its defaults are not an equivalent contract: connect timeout is 10 seconds, while header/body timeouts are 300-second idle limits rather than one total DNS-to-body deadline.
User Impact
Tlon uploads now fail predictably when network work stalls, while slow valid uploads retain five minutes to complete.
Evidence
tbx_01kxjvmc4cn3xmqyhkyq2mvmnt:CI=1 pnpm test extensions/tlon/src/tlon-api.test.ts— 15/15 passed.CI=1 ... pnpm check:changed— extension production/tests typechecks, lint, database-first guard, media helper guard, sidecar guard, and import-cycle check passed.AI-assisted: This PR was prepared with AI assistance.