You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this, Xiangyu Li (@lxingy3) — bounding the file-transfer requests with timeouts was the right call.
The same fix has since landed on next via #3563 (merged as dd40a9b), which covers the identical call sites (S3 PUT on the local-file and URL-source upload paths, the streaming download GET, and the session-file upload/download in tool_router_session_files.py) and adds a couple of refinements on top — URL sanitization in error/log messages and wrapping the streaming-read loop, not just the initial request. I checked next and every requests.* call in both files now passes timeout=(_CONNECT_TIMEOUT, _READ_TIMEOUT), so there's no remaining gap.
Closing as superseded by #3563. Really appreciate the contribution. 🙏
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
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.
Summary
Adds bounded connect/read timeouts to Python SDK file transfer paths that previously called
requestswithout a local deadline.Covered paths:
RemoteFile.buffer()session file downloadsToolRouterSessionFilesMount.upload()presigned session file uploadsFileDownloadable.download()S3/presigned file downloadsRequest-level failures are translated into the SDK's existing file errors instead of leaking raw
requestsexceptions.Fixes #3560
Fixes #3561
Fixes #3562
Tests
.venv\Scripts\python.exe -m pytest python\tests\test_tool_router_session_files.py python\tests\test_files.py -q.venv\Scripts\python.exe -m ruff check python\composio\core\models\tool_router_session_files.py python\composio\core\models\_files.py python\tests\test_tool_router_session_files.py python\tests\test_files.pygit diff --check