Skip to content

feat(responses): opt in to incremental WebSocket text and tool snapshots - #3973

Merged
markstuart-oai merged 16 commits into
mainfrom
codex/sdk-1021-python-responses-accumulator
Sep 28, 2026
Merged

markstuart-oai merged 16 commits into
mainfrom
codex/sdk-1021-python-responses-accumulator

Conversation

@markstuart-oai

Copy link
Copy Markdown
Contributor

WebSocket callers currently cannot inspect cumulative text and tool inputs when a stream omits the scaffolding required by HTTP/SSE accumulation. Adds an optional caller-fed ResponsesWebSocketAccumulator with immutable partial snapshots and a separate exact received terminal response. It handles sync and async connections, failed/incomplete results, empty versus omitted output and item corrections without owning a socket or running tools. Existing lane and SSE methods are unchanged.

Known malformed text/tool fields are rejected before they can corrupt a snapshot. Raw events, missing/nullable fields on terminal responses, and unknown variants remain available to the caller.

Validation: 190 WebSocket/accumulator and 23 Responses tests passed on each of Pydantic v1 and v2, full Ruff, mypy on src, Pyright. The nullable-content setup originally hit the environment's unsupported SOCKS proxy and passed using NO_PROXY=* for the local fixture tests. Cases cover independent interleaved lanes, malformed input, exact terminals and disposal/reuse.

@markstuart-oai
markstuart-oai requested a review from a team as a code owner September 27, 2026 19:05
@openai-sdks

openai-sdks Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 236/236 SDK tests passed in 6.899s for Python SDK PR #3973.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 151ms
tests/chat-completions-create.test.ts ✅ Passed 164ms
tests/chat-completions-stream.test.ts ✅ Passed 129ms
tests/files-content-binary.test.ts ✅ Passed 68ms
tests/files-create-multipart.test.ts ✅ Passed 82ms
tests/files-list-pagination.test.ts ✅ Passed 83ms
tests/initialize-config.test.ts ✅ Passed 79ms
tests/instance-isolation.test.ts ✅ Passed 64ms
tests/models-list.test.ts ✅ Passed 69ms
tests/responses-background-lifecycle.test.ts ✅ Passed 112ms
tests/responses-body-method-errors.test.ts ✅ Passed 220ms
tests/responses-cancel-timeout.test.ts ✅ Passed 165ms
tests/responses-cancel.test.ts ✅ Passed 127ms
tests/responses-compact-retries.test.ts ✅ Passed 204ms
tests/responses-compact.test.ts ✅ Passed 158ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 197ms
tests/responses-create-advanced.test.ts ✅ Passed 142ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.095s
tests/responses-create-errors.test.ts ✅ Passed 175ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 70ms
tests/responses-create-retries.test.ts ✅ Passed 135ms
tests/responses-create-stream-failures.test.ts ✅ Passed 73ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 170ms
tests/responses-create-stream-wire.test.ts ✅ Passed 1.876s
tests/responses-create-stream.test.ts ✅ Passed 54ms
tests/responses-create-terminal-states.test.ts ✅ Passed 145ms
tests/responses-create-timeout.test.ts ✅ Passed 148ms
tests/responses-create.test.ts ✅ Passed 279ms
tests/responses-delete.test.ts ✅ Passed 115ms
tests/responses-input-items-errors.test.ts ✅ Passed 242ms
tests/responses-input-items-list.test.ts ✅ Passed 177ms
tests/responses-input-items-options.test.ts ✅ Passed 151ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 187ms
tests/responses-input-tokens-count.test.ts ✅ Passed 135ms
tests/responses-malformed-inputs.test.ts ✅ Passed 1.224s
tests/responses-not-found-errors.test.ts ✅ Passed 159ms
tests/responses-parse.test.ts ✅ Passed 136ms
tests/responses-retrieve-retries.test.ts ✅ Passed 122ms
tests/responses-retrieve.test.ts ✅ Passed 141ms
tests/responses-stored-method-errors.test.ts ✅ Passed 389ms
tests/retry-behavior.test.ts ✅ Passed 2.999s
tests/sdk-error-shape.test.ts ✅ Passed 141ms

View OkTest run #36362342203

SDK merge (20f80129ccb4) · head (38f42e91b07d) · base (4ef4129e85e8) · OkTest (52272cfde56b)

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

✅ No new custom-code files detected.

48 mixed files remain; 0 existing customizations changed.

Compared 4ef4129e85e8 → 38f42e91b07d. Generated baselines verified.

48 existing customizations unchanged
  • api.md
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py
  • src/openai/init.py
  • src/openai/_client.py
  • src/openai/resources/audio/transcriptions.py
  • src/openai/resources/audio/translations.py
  • src/openai/resources/beta/agents/sessions/sessions.py
  • src/openai/resources/beta/beta.py
  • src/openai/resources/beta/responses/responses.py
  • src/openai/resources/beta/threads/runs/runs.py
  • src/openai/resources/beta/threads/threads.py
  • src/openai/resources/chat/completions/completions.py
  • src/openai/resources/embeddings.py
  • src/openai/resources/files.py
  • src/openai/resources/live/forks.py
  • src/openai/resources/live/live.py
  • src/openai/resources/live/sideband.py
  • src/openai/resources/realtime/api.md
  • src/openai/resources/realtime/realtime.py
  • src/openai/resources/responses/responses.py
  • src/openai/resources/uploads/uploads.py
  • src/openai/resources/vector_stores/file_batches.py
  • src/openai/resources/vector_stores/files.py
  • src/openai/resources/videos.py
  • src/openai/resources/webhooks/init.py
  • src/openai/resources/webhooks/webhooks.py
  • src/openai/types/beta/agent_session_message.py
  • src/openai/types/chat/init.py
  • src/openai/types/chat/chat_completion_message_tool_call.py
  • src/openai/types/fine_tuning/fine_tuning_job_integration.py
  • src/openai/types/realtime/conversation_item_input_audio_transcription_delta_event.py
  • src/openai/types/realtime/realtime_error_event.py
  • src/openai/types/responses/init.py
  • src/openai/types/responses/response.py
  • src/openai/types/responses/response_function_web_search.py
  • src/openai/types/responses/response_function_web_search_param.py
  • src/openai/types/responses/responses_client_event.py
  • src/openai/types/responses/responses_client_event_param.py

8 more in the full report.

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 36362359910 --repo openai/openai-python \
  --name castiron-custom-code-36362359910-1 --dir /tmp/castiron-custom-code-36362359910-1
git apply --stat /tmp/castiron-custom-code-36362359910-1/custom-code.patch
cat /tmp/castiron-custom-code-36362359910-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin 4ef4129e85e81a285905755e57b392aa9e77f9bd 38f42e91b07db6049f4eae293b255c0b74316bea
python3 scripts/castiron/custom_code_report.py report \
  --base 4ef4129e85e81a285905755e57b392aa9e77f9bd \
  --head 38f42e91b07db6049f4eae293b255c0b74316bea --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-38f42e91b07d
cat /tmp/castiron-custom-code-38f42e91b07d/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

Comment thread src/openai/lib/responses_websocket/_accumulator.py Fixed
Comment thread src/openai/lib/responses_websocket/_accumulator.py Fixed

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 12ac7ed8be

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/openai/lib/responses_websocket/_accumulator.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 12ac7ed8be

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread src/openai/lib/responses_websocket/_accumulator.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a9a072e9ac

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/openai/lib/responses_websocket/_accumulator.py
Comment thread src/openai/lib/responses_websocket/_accumulator.py Outdated
Comment thread src/openai/lib/responses_websocket/_accumulator.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a67024a260

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/openai/lib/responses_websocket/_accumulator.py Outdated
Comment thread src/openai/lib/responses_websocket/_accumulator.py

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c86dea9cb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/openai/lib/responses_websocket/_accumulator.py Outdated
Comment thread src/openai/lib/responses_websocket/_accumulator.py Outdated
Comment thread src/openai/lib/responses_websocket/_accumulator.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4446ef16e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/openai/lib/responses_websocket/_accumulator.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: a86c8978d0

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread src/openai/lib/responses_websocket/_accumulator.py Outdated

@dpiet-oai dpiet-oai 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.

One verified medium-severity denial-of-service risk remains in the opt-in accumulator.

Comment thread src/openai/lib/responses_websocket/_accumulator.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 80973d71a5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/openai/lib/responses_websocket/_accumulator.py

@dpiet-oai dpiet-oai 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.

One verified medium-severity partial-snapshot correctness gap remains on the current head.

Comment thread src/openai/lib/responses_websocket/_accumulator.py

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed 80973d71a5781dc746a79a6639f46f60086c6c98. I found two remaining snapshot/terminal correctness gaps and left focused inline comments.

I reproduced both using this commit's actual Responses WebSocket decoder and accumulator loaded from the commit archive in memory (Python 3.12 / Pydantic 2). Controls for ordinary text-done replacement, prior text snapshot isolation, explicit empty terminal output, and reset passed. I read the full change and the follow-up sparse-index fix; I did not run the repository's full test suite or contact a live API.

Existing primitive-item replacement and retired-item-ID findings are tracked in #3973 (comment) and #3973 (comment); I have not duplicated those threads. CI was still running on this head, with lint failing, at the last check.

Comment thread src/openai/lib/responses_websocket/_accumulator.py
Comment thread src/openai/lib/responses_websocket/_accumulator.py

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 80973d71a5

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread src/openai/lib/responses_websocket/README.md Outdated
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 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-28T00:33:54.018112Z 38f42e9 New commits
🔒 Security Review ✅ Completed 2026-09-28T00:31:52.288019Z 38f42e9 New commits

Security findings

Advisory findings (3)

ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd3319b8bd

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/openai/lib/responses_websocket/_accumulator.py Outdated
Comment thread src/openai/lib/responses_websocket/_accumulator.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27bd5b4097

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/openai/lib/responses_websocket/_accumulator.py Outdated
Comment thread src/openai/lib/responses_websocket/_accumulator.py Outdated
Comment thread src/openai/lib/responses_websocket/README.md Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a3a1e21be

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/openai/lib/responses_websocket/_accumulator.py
Comment thread src/openai/lib/responses_websocket/_accumulator.py Outdated
Comment thread src/openai/lib/responses_websocket/_accumulator.py

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b38e7cc4f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/openai/lib/responses_websocket/_accumulator.py

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d18e1e1705

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/openai/lib/responses_websocket/README.md Outdated

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed db90e317271737e4425a0449d7fa0afc5a0fd5cc; my two snapshot/terminal blockers are fixed, so I am clearing my changes request.

An authoritative non-text content part now clears only its selected text slot, preserving neighboring content. Malformed non-null lifecycle output is rejected before state replacement or terminal success, and invalid terminal errors remain available through get_final_response(). I also checked the follow-up primitive/metadata validation, retired-ID handling for full and incremental replacements, unknown-type handling, lane/response identity checks, and the corrected progress example. Omitted/null compatibility and exact received terminal responses remain distinct from the partial projection.

Reviewed all three fix-delta files and the complete helper, including sync/async wire regressions and snapshot/raw-event isolation. Exact-head Python 3.10 CI passed 14,102 tests with Pydantic 2 and 14,088 with Pydantic 1; the HTTPX2 job passed the same suites. Python 3.14, lint, build, and compatibility checks are green. This re-review used source inspection and hosted CI, not a local full-suite rerun. No remaining blocking findings.

@markstuart-oai
markstuart-oai added this pull request to the merge queue Sep 28, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38f42e91b0

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if getattr(event, "stream_id", None) != expected_stream_id:
continue
accumulator.add_event(event)
event_type = event.type

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Guard missing event types in the example

Fresh evidence beyond the resolved unhashable-type case: when a default-lane or direct-connection consumer receives a malformed top-level JSON value or object without type, the loose parser can return a value with no .type attribute. add_event() safely ignores it, but this access then raises AttributeError and terminates the documented receive loop; retrieve the type with getattr(event, "type", None) and use that guarded value for all subsequent comparisons.

Useful? React with 👍 / 👎.

self._error = error
raise
self._output = replacement
self._response_id = response_id or self._response_id

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve empty response IDs when binding state

When a compatible provider supplies an empty-string response ID, it passes the preceding string validation but this truthiness fallback stores None instead. Besides exposing the wrong snapshot().response_id, that leaves the accumulator unbound to the response identity, so a later lifecycle event with a different nonempty ID bypasses the mismatch check and can replace or finalize the existing projection. Assign the new ID whenever it is not None, rather than only when it is truthy.

Useful? React with 👍 / 👎.

Comment on lines +21 to +22
@pytest.mark.parametrize("field", ["output_index", "content_index"])
def test_large_sparse_indices_keep_numeric_order_and_prior_snapshots(field: str) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reduce the handwritten regression suite

This change adds a 1,132-line handwritten test module with many repeated sync/async socket scripts and state-preservation assertions, despite the repository requirement that handwritten tests remain small. Consolidate the repeated frame-driving and assertion patterns into compact helpers or focused tables so future protocol changes do not require editing a large duplicated matrix.

AGENTS.md reference: AGENTS.md:L5-L8

Useful? React with 👍 / 👎.

Merged via the queue into main with commit d0207b4 Sep 28, 2026
26 checks passed
@markstuart-oai
markstuart-oai deleted the codex/sdk-1021-python-responses-accumulator branch September 28, 2026 00:37
@openai-sdks openai-sdks Bot mentioned this pull request Sep 27, 2026
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.

3 participants