Repository navigation
fix(tlon): add request timeout to media downloads and image uploads - #103199
wangmiao0668000666 wants to merge 1 commit into
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
Codex review: needs real behavior proof before merge. Reviewed July 10, 2026, 5:10 AM ET / 09:10 UTC. Summary PR surface: Source +8. Total +8 across 2 files. Reproducibility: yes. from source with high confidence: both current Tlon fetch paths omit the explicit guarded-request deadline, so their body-idle timeout cannot bound a server that never begins or completes the response. 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:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Keep the finite deadline at these Tlon-owned call sites, but merge only after a Tlon owner confirms the total-duration envelope and redacted controlled-stall evidence demonstrates both established failure/fallback outcomes. Do we have a high-confidence way to reproduce the issue? Yes, from source with high confidence: both current Tlon fetch paths omit the explicit guarded-request deadline, so their body-idle timeout cannot bound a server that never begins or completes the response. Is this the best way to solve the issue? The Tlon call sites are the narrowest maintainable ownership boundary, but the hard two-minute duration is not yet proven to be the safest policy for legitimate transfers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6f01c23e712d. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +8. Total +8 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
|
|
Closing in favor of the canonical PR #103206, which absorbs this branch's Tlon changes. Decision: close as a subset duplicate. Why: This branch's two Tlon changes (
Keeping this separate PR open would only conflict with #103206 on the same two files. Supported alternative: the agent-tools caller wiring continues in #103209 (rebased to agent-tool-only plus the shared seam, stacked on #103206). What would change the decision: none expected - the Tlon work is fully covered by #103206. Reopen only if a maintainer wants the Tlon deadline landed independently of the shared seam. |
Apply the shared bounded-media ceiling (15 min, matching the canonical precedent in PR openclaw#103266) to the three agent-tool remote-media callers (image, image-generate, pdf) via the new REMOTE_MEDIA_TIMEOUT_MS constant, forwarded through loadWebMedia / loadWebMediaRaw's timeoutMs seam. Bounds endpoints that never respond while REMOTE_MEDIA_READ_IDLE_TIMEOUT_MS keeps protecting slow-but-progressing transfers. This branch includes the WebMediaOptions.timeoutMs seam so it typechecks and stays green as a standalone fork PR; it reduces to agent-tool-only once the canonical seam+Tlon PR openclaw#103206 lands. The Tlon caller changes live in openclaw#103206 (the earlier openclaw#103199 is closed as a subset). - src/agents/tools/media-tool-shared.ts: export REMOTE_MEDIA_TIMEOUT_MS = 15*60_000. - image-tool / image-generate-tool / pdf-tool: pass timeoutMs on remote (http) loads. - src/media/web-media.ts: forward timeoutMs (shared seam; see openclaw#103206). - tests: assert timeoutMs forwarding for all three agent tools. Co-Authored-By: Claude <[email protected]>
* fix(agent-tools): bound remote media fetches with a 15-min total timeout Apply the shared bounded-media ceiling (15 min, matching the canonical precedent in PR #103266) to the three agent-tool remote-media callers (image, image-generate, pdf) via the new REMOTE_MEDIA_TIMEOUT_MS constant, forwarded through loadWebMedia / loadWebMediaRaw's timeoutMs seam. Bounds endpoints that never respond while REMOTE_MEDIA_READ_IDLE_TIMEOUT_MS keeps protecting slow-but-progressing transfers. This branch includes the WebMediaOptions.timeoutMs seam so it typechecks and stays green as a standalone fork PR; it reduces to agent-tool-only once the canonical seam+Tlon PR #103206 lands. The Tlon caller changes live in #103206 (the earlier #103199 is closed as a subset). - src/agents/tools/media-tool-shared.ts: export REMOTE_MEDIA_TIMEOUT_MS = 15*60_000. - image-tool / image-generate-tool / pdf-tool: pass timeoutMs on remote (http) loads. - src/media/web-media.ts: forward timeoutMs (shared seam; see #103206). - tests: assert timeoutMs forwarding for all three agent tools. Co-Authored-By: Claude <[email protected]> * fix(agent-tools): adopt canonical responseHeaderTimeoutMs seam from main * test(agent-tools): cover media header deadlines Lock the existing image, image-generation, and PDF remote-media call sites to the proposed header-only deadline and remove the PR-only proof script.\n\nCo-authored-by: wangmiao0668000666 <[email protected]> * style: oxfmt * fix(media): default stalled header deadline Co-authored-by: wangmiao0668000666 <[email protected]> --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
* fix(agent-tools): bound remote media fetches with a 15-min total timeout Apply the shared bounded-media ceiling (15 min, matching the canonical precedent in PR openclaw#103266) to the three agent-tool remote-media callers (image, image-generate, pdf) via the new REMOTE_MEDIA_TIMEOUT_MS constant, forwarded through loadWebMedia / loadWebMediaRaw's timeoutMs seam. Bounds endpoints that never respond while REMOTE_MEDIA_READ_IDLE_TIMEOUT_MS keeps protecting slow-but-progressing transfers. This branch includes the WebMediaOptions.timeoutMs seam so it typechecks and stays green as a standalone fork PR; it reduces to agent-tool-only once the canonical seam+Tlon PR openclaw#103206 lands. The Tlon caller changes live in openclaw#103206 (the earlier openclaw#103199 is closed as a subset). - src/agents/tools/media-tool-shared.ts: export REMOTE_MEDIA_TIMEOUT_MS = 15*60_000. - image-tool / image-generate-tool / pdf-tool: pass timeoutMs on remote (http) loads. - src/media/web-media.ts: forward timeoutMs (shared seam; see openclaw#103206). - tests: assert timeoutMs forwarding for all three agent tools. Co-Authored-By: Claude <[email protected]> * fix(agent-tools): adopt canonical responseHeaderTimeoutMs seam from main * test(agent-tools): cover media header deadlines Lock the existing image, image-generation, and PDF remote-media call sites to the proposed header-only deadline and remove the PR-only proof script.\n\nCo-authored-by: wangmiao0668000666 <[email protected]> * style: oxfmt * fix(media): default stalled header deadline Co-authored-by: wangmiao0668000666 <[email protected]> --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
The Tlon media download helpers (
downloadMedia,uploadImageFromUrl) already time out idle chunks viareadIdleTimeoutMs(30s) but have no overall request timeout. A remote server that accepts the TCP connection then hangs without sending any data will hold the download open indefinitely.This is the same gap Alix-007 is systematically fixing across channel extensions (telegram #103020, nodes-camera #103019, qqbot #103018).
Why This Change Was Made
saveRemoteMediaandreadRemoteMediaBufferalready supporttimeoutMsin their options. The helpers just weren't passing it through.User Impact
Prevents indefinite hangs on Tlon media downloads/uploads when the remote server never responds.
Evidence
extensions/tlon/src/monitor/media.ts:downloadMedia()callssaveRemoteMedia/readRemoteMediaBuffer— addedtimeoutMs: 120_000extensions/tlon/src/urbit/upload.ts:uploadImageFromUrl()callsreadRemoteMediaBuffer— addedtimeoutMs: 120_000timeoutMsandreadIdleTimeoutMsparallel the structure used by Alix-007's telegram PR fix(telegram): recover when media downloads stall #103020Change: 8 insertions, 0 deletions across 2 files.