Repository navigation
fix(cli): bound node camera URL downloads - #103266
Merged
steipete merged 5 commits intoJul 10, 2026
Merged
Conversation
Contributor
|
Land-ready maintainer pass complete.
Merging with contributor credit preserved. Thanks @mikasa0818. |
Contributor
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 10, 2026
* fix(cli): bound node camera URL downloads * refactor(cli): enforce camera download policy at guard * refactor(cli): enforce camera download policy at guard * refactor(cli): enforce camera download policy at guard --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
wangmiao0668000666
added a commit
to wangmiao0668000666/openclaw
that referenced
this pull request
Jul 11, 2026
Add WebMediaOptions.timeoutMs passthrough and apply the shared bounded-media ceiling (15 min, matching the canonical precedent in PR openclaw#103266) to the Tlon download/upload fetch paths. Bounds endpoints that never respond, while readIdleTimeoutMs continues to protect slow-but-progressing transfers. - src/media/web-media.ts: forward timeoutMs through loadWebMediaInternal to readRemoteMediaBuffer / fetchWithSsrFGuard's abort signal. - extensions/tlon: set a 15-min total deadline on downloadMedia and uploadImageFromUrl; their existing null / original-URL fallbacks now bound indefinite stalls. - tests: switch the two exact-match Tlon option assertions to objectContaining and assert the new timeoutMs value; add a controlled stalled-endpoint test proving loadWebMediaRaw aborts a never-responding fetch at the timeoutMs deadline. Co-Authored-By: Claude <[email protected]>
steipete
pushed a commit
to wangmiao0668000666/openclaw
that referenced
this pull request
Jul 21, 2026
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]>
steipete
added a commit
that referenced
this pull request
Jul 21, 2026
* 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]>
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.
What Problem This Solves
openclaw nodes camera snaporclipwith a URL-backed payload could have the CLI remain occupied indefinitely when the node server sent valid response headers but then streamed too slowly or never completed the body.writeUrlToFile().Content-Length, and streamed byte caps, but omittedtimeoutMsfromfetchWithSsrFGuard(). The guard therefore had no request-lifetime abort to interrupt a stalled body read.Why This Change Was Made
reader.read().fetchWithSsrFGuard()andbuildTimeoutAbortSignal()own the request lifetime. The default is the existing bounded-media ceiling of 15 minutes rather than a short control-request deadline, while tests and direct callers can provide a smaller deadline.origin/mainat6b90610cdb985e7413d43efd9ea64c7c4fd5ad89still omitted the timeout. This patch differs by using the bounded-media ceiling and proving a post-header, continuously slow body plus file/socket cleanup.User Impact
Evidence
npx -y [email protected] scripts/run-vitest.mjs src/cli/nodes-camera.test.tspnpm tsgo:core && pnpm tsgo:test:srcpnpm exec oxfmt --check --threads=1 src/cli/nodes-camera.ts src/cli/nodes-camera.test.tspnpm exec oxlint src/cli/nodes-camera.ts src/cli/nodes-camera.test.tsgit diff --checkwriteUrlToFile -> fetchWithSsrFGuard -> response body readercall against a local HTTPS server that flushed200headers, wrote a valid prefix, then emitted one byte every 25 ms without ending.TimeoutError: request timed outafter 3296 ms; the partial output did not exist afterward; the server observed response closure; open sockets after guarded-fetch release were 0.