Skip to content

Stream remote media downloads with size limits - #29430

Closed
rayasa07 wants to merge 1 commit into
NousResearch:mainfrom
rayasa07:fix/stream-remote-media-downloads
Closed

Stream remote media downloads with size limits#29430
rayasa07 wants to merge 1 commit into
NousResearch:mainfrom
rayasa07:fix/stream-remote-media-downloads

Conversation

@rayasa07

Copy link
Copy Markdown

Summary

  • stream remote image and video downloads to disk instead of reading full responses into memory
  • enforce media byte limits from Content-Length and during chunked writes
  • remove partial download files when a stream exceeds the configured limit

Validation

  • scripts/run_tests.sh tests/tools/test_vision_tools.py tests/tools/test_video_analyze.py

@alt-glitch alt-glitch added type/security Security vulnerability or hardening P2 Medium — degraded but workaround exists tool/vision Vision analysis and image generation labels May 20, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #10440 (stream vision downloads before size checks) and #13145 (no size cap on inbound media downloads). Also related to #13341 (cap inbound media bytes). This PR addresses the same streaming + size limit concern for vision_tools.py.

@teknium1

Copy link
Copy Markdown
Contributor

Closing in favor of #50321#50321 — which streams remote media downloads with a configurable size limit in the shared cache helpers.

Your "stream with size limits" approach matches what landed. The merged fix is credited to @sgaofen (#13341, the earliest report of this), reapplied onto current main with the video guard and a config.yaml knob added. Thanks for the contribution.

@teknium1 teknium1 closed this Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Medium — degraded but workaround exists tool/vision Vision analysis and image generation type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants