Repository navigation
fix(tlon): bound stalled inbound and outbound media header waits - #104132
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 12, 2026, 8:27 PM ET / July 13, 2026, 00:27 UTC. Summary PR surface: Source +5, Tests +2. Total +7 across 5 files. Reproducibility: yes. at source level: on current main, a server that accepts the connection but never returns headers leaves both Tlon calls waiting because only the post-header body-idle timer is configured. The controlled runtime transcript demonstrates the proposed header deadline firing on both paths. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the shared header-only timeout policy once exact-head checks are green, preserving the 30-second body-idle limit and existing inbound omission and outbound original-URL fallbacks. Do we have a high-confidence way to reproduce the issue? Yes at source level: on current main, a server that accepts the connection but never returns headers leaves both Tlon calls waiting because only the post-header body-idle timer is configured. The controlled runtime transcript demonstrates the proposed header deadline firing on both paths. Is this the best way to solve the issue? Yes. Reusing the shared header-only timeout contract at the Tlon owner boundary is narrower than a whole-request timeout, avoids capping healthy progressive bodies, and one shared local policy prevents inbound and outbound drift. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 55067fd5e7be. Label changesLabel justifications:
Evidence reviewedPR surface: Source +5, Tests +2. Total +7 across 5 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 (4 earlier review cycles)
|
ccddafd to
68329bc
Compare
|
@clawsweeper re-review Added controlled real-runtime proof for the Tlon media header timeout. A local server was used: a healthy endpoint returns a small PNG; a stalled endpoint accepts the connection but never sends headers. The shared media runtime was exercised with the same options this PR adds to Tlon ( Result:
Verification:
Full redacted output is included in the updated PR body. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Fixed the rendered PR body — the previous update stored the file path literal by mistake. The body now contains the full context and the redacted controlled runtime proof showing healthy inbound/outbound fetches succeed and stalled-header fetches abort near the 120-second deadline. Head SHA: 68329bcd54 |
847ce3e to
c40f08b
Compare
|
Maintainer closeout for #104132:
Thanks @chengzhichao-xydt. |
|
Merged via squash.
|
…nclaw#104132) * fix(tlon): bound stalled inbound and outbound media header waits * refactor(tlon): share media fetch timeout policy --------- Co-authored-by: Peter Steinberger <[email protected]>
…4132) * fix(tlon): bound stalled inbound and outbound media header waits * refactor(tlon): share media fetch timeout policy --------- Co-authored-by: Peter Steinberger <[email protected]> (cherry picked from commit cacd435)
What Problem This Solves
Tlon inbound
downloadMediaand outbounduploadImageFromUrlcallreadRemoteMediaBuffer/saveRemoteMediawith only a 30-second body-idle timeout. If the remote server never returns response headers, the idle timeout never starts and the request can hang indefinitely. This is the same root cause as the Telegram media stall fixed in #103020.Why This Change Was Made
Add a 120-second response-header deadline (
responseHeaderTimeoutMs) to both call sites, mirroring the Telegram media timeout policy, so stalled endpoints fail fast without cutting off healthy long transfers.User Impact
Tlon media downloads and image uploads time out predictably when a server never sends headers, instead of blocking the channel.
Evidence
Unit tests
pnpm test extensions/tlon/src/monitor/media.test.ts extensions/tlon/src/urbit/upload.test.ts --runResult: 2 files, 11 tests passed.
Type / lint
pnpm tsgo:extensions # exit 0 node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/tlon/src/monitor/media.ts extensions/tlon/src/monitor/media.test.ts extensions/tlon/src/urbit/upload.ts extensions/tlon/src/urbit/upload.test.tsBoth pass.
Controlled real-runtime proof
A local HTTP server was used: one endpoint returns a small PNG immediately; another endpoint accepts the connection but never sends response headers. The shared media runtime was exercised with the same options this PR now passes from Tlon (
responseHeaderTimeoutMs: 120_000,readIdleTimeoutMs: 30_000). SSRF was relaxed todangerouslyAllowPrivateNetworkonly for the loopback test server.Healthy transfers complete; stalled headers abort near the 120-second deadline. In the Tlon channel code the resulting rejection is caught and the message continues without the failed attachment (inbound) or falls back to the original image URL (outbound).
Release Note