fix: bound vector store file polling (#3401)
Fixes #3097 ## Summary - add an optional `max_wait_seconds` bound to `vector_stores.files.poll()` - thread the same bound through sync/async `create_and_poll()` and `upload_and_poll()` - raise `TimeoutError` instead of waiting forever when a vector store file stays `in_progress` ## Why `upload_and_poll()` currently waits until the vector store file reaches a terminal state. If the backend leaves the vector store file in `in_progress` indefinitely, the helper never returns and the caller has no SDK-level escape hatch. The new argument keeps the default behavior unchanged, while letting callers opt into a bounded wait. ## Validation - `PYTHONPATH=src python -m pytest tests/api_resources/vector_stores/test_files.py::TestFiles::test_poll_timeout tests/api_resources/vector_stores/test_files.py::TestAsyncFiles::test_poll_timeout -q` - `PYTHONPATH=src python -m pytest tests/api_resources/vector_stores/test_files.py::test_create_and_poll_method_in_sync tests/api_resources/vector_stores/test_files.py::test_upload_and_poll_method_in_sync -q` - `PYTHONPATH=src python -m ruff check src/openai/resources/vector_stores/files.py tests/api_resources/vector_stores/test_files.py` - `python -m compileall -q src/openai/resources/vector_stores/files.py tests/api_resources/vector_stores/test_files.py` - `git diff --check` - [x] I understand that this repository is auto-generated and my pull request may not be merged Co-authored-by: Marcus Wood <marcuswood@openai.com>
Y
Yufeng He committed
ae41bc46cdd53d17e948ac8a73e16bdbf34123a1
Parent: 8f84fbd
Committed by GitHub <noreply@github.com>
on 9/10/2026, 10:03:20 PM