Skip to content

fix: bound vector store file polling#3401

Open
he-yufeng wants to merge 1 commit into
openai:mainfrom
he-yufeng:fix/vector-store-file-poll-timeout
Open

fix: bound vector store file polling#3401
he-yufeng wants to merge 1 commit into
openai:mainfrom
he-yufeng:fix/vector-store-file-poll-timeout

Conversation

@he-yufeng

Copy link
Copy Markdown

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

  • I understand that this repository is auto-generated and my pull request may not be merged

@he-yufeng he-yufeng requested a review from a team as a code owner June 14, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vector_stores.files.upload_and_poll() can hang indefinitely with file status stuck at in_progress

1 participant