Skip to content

fix(vector stores): refresh server poll intervals - #3775

Open
Hughhhhcoder wants to merge 1 commit into
openai:mainfrom
Hughhhhcoder:codex/openai-python-dynamic-poll-hints
Open

fix(vector stores): refresh server poll intervals#3775
Hughhhhcoder wants to merge 1 commit into
openai:mainfrom
Hughhhhcoder:codex/openai-python-dynamic-poll-hints

Conversation

@Hughhhhcoder

@Hughhhhcoder Hughhhhcoder commented Sep 1, 2026

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

Changes being requested

When poll_interval_ms is omitted, the vector-store polling helpers currently assign the first response's openai-poll-after-ms value back to poll_interval_ms. That makes the value appear caller-specified on later iterations, so subsequent server hints are ignored.

For example, two pending responses with 100 ms and 2000 ms hints currently sleep for [0.1, 0.1] seconds instead of [0.1, 2.0].

This change keeps an explicitly supplied interval fixed, while resolving an omitted interval from every pending response. The behavior now matches the response-scoped hint handling in the other OpenAI SDK polling implementations.

The regression covers all four public vector-store polling paths:

  • Files
  • AsyncFiles
  • FileBatches
  • AsyncFileBatches

Additional context & links

The patch is limited to the SDK-owned src/openai/lib/_vector_stores.py helper and its focused tests. It does not change any public signature, request header, terminal-state behavior, or generated resource file.

Validation:

  • Before the fix, the new regression failed all 4 variants with [0.1, 0.1].
  • Focused Vector Store matrix:
    • Pydantic v2: 252 passed
    • Pydantic v1: 252 passed
  • Full non-functional test matrix:
    • Pydantic v2: 11,236 passed, 144 skipped
    • Pydantic v1: 11,222 passed, 158 skipped
  • ./scripts/lint: Ruff, Pyright, mypy, and import check passed
  • Castiron custom-code budget: passed, 6566 / 10000 lines; no new custom-code files or generated customizations
  • git diff --check: passed

@Hughhhhcoder
Hughhhhcoder requested a review from a team as a code owner September 1, 2026 10:18
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T10:21:06.739423Z 772a642 PR opened
🔒 Security Review Completed 2026-09-01T10:22:08.482793Z 772a642 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sylvesterkaczmarek sylvesterkaczmarek left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I traced this through all four vector-store polling paths. The important part is that an omitted poll_interval_ms now remains omitted across iterations, so _get_poll_interval_ms(response.headers) is evaluated against each pending response instead of the first server hint becoming accidental caller state.

An explicit interval is still stable: it continues to set X-Stainless-Custom-Poll-Interval once and is selected on every iteration. When no server hint is present, _get_poll_interval_ms also preserves the existing 1000 ms fallback.

The two-response 100 ms -> 2000 ms regression directly pins the failure mode, and the shared parameterized test covers the sync/async file and file-batch entry points. I don't see a blocking behavior change beyond the intended response-scoped hint refresh.

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.

2 participants