Skip to content

Add timeouts for Python file transfers#3592

Closed
Xiangyu Li (lxingy3) wants to merge 1 commit into
ComposioHQ:nextfrom
lxingy3:fix-python-file-request-timeouts
Closed

Add timeouts for Python file transfers#3592
Xiangyu Li (lxingy3) wants to merge 1 commit into
ComposioHQ:nextfrom
lxingy3:fix-python-file-request-timeouts

Conversation

@lxingy3

Copy link
Copy Markdown

Summary

Adds bounded connect/read timeouts to Python SDK file transfer paths that previously called requests without a local deadline.

Covered paths:

  • RemoteFile.buffer() session file downloads
  • ToolRouterSessionFilesMount.upload() presigned session file uploads
  • FileDownloadable.download() S3/presigned file downloads
  • adjacent Python file upload helpers that send bytes to presigned S3 URLs

Request-level failures are translated into the SDK's existing file errors instead of leaking raw requests exceptions.

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.py
  • git diff --check

@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

Xiangyu Li (@lxingy3) is attempting to deploy a commit to the Composio Team on Vercel.

A member of the Team first needs to authorize it.

@jkomyno

Copy link
Copy Markdown
Collaborator

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. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants