Skip to content

fix(streaming): omit payloads from invalid delta errors - #4375

Merged
marcuswood-oai merged 1 commit into
mainfrom
msw/stream-delta-errors
Dec 5, 2026
Merged

marcuswood-oai merged 1 commit into
mainfrom
msw/stream-delta-errors

Conversation

@marcuswood-oai

Copy link
Copy Markdown
Contributor

Changes being requested

When a streaming list entry has the wrong shape or its index is missing or invalid, report the expected structure and omit the received value from the exception message. The shared accumulator keeps the existing exception types and the missing key's cause. The three existing malformed-entry tests now assert the complete message.

Additional context & links

Verified all three cases through sync and async chat.completions.stream() using a mock transport. Valid tool arguments round-trip. The change covers the accumulator's exception text. Pydantic can separately emit serialization warnings for values of the wrong type.

The three regression cases failed against the base revision and passed with this change. The focused delta, Chat Completions, and Assistants tests passed with Pydantic v2 (153 passed) and v1 (152 passed, 1 skipped). Ruff and ty passed.

@marcuswood-oai
marcuswood-oai requested a review from a team as a code owner December 5, 2026 01:06
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-05T01:07:33.043930Z dbe971a PR opened
🔒 Security Review ✅ Completed 2026-12-05T01:07:57.545361Z dbe971a 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.

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

No actionable findings in the static review, including an independent second review. All three invalid indexed-delta errors now omit payload contents while preserving exception types and the safe missing-index cause. Exact-message regression assertions cover each changed branch; valid accumulation behavior is unchanged. Reviewed the shared Chat Completions and Assistants call paths.

Hosted lint, build, type checks, breaking-change analysis, and CodeQL passed. Python 3.10/3.14 tests and OkTest are still running. No local code or tests were executed.

@marcuswood-oai
marcuswood-oai added this pull request to the merge queue Dec 5, 2026
Merged via the queue into main with commit ba6e577 Dec 5, 2026
26 checks passed
@marcuswood-oai
marcuswood-oai deleted the msw/stream-delta-errors branch December 5, 2026 01:18
@openai-sdks openai-sdks Bot mentioned this pull request Dec 5, 2026
dpiet-oai pushed a commit that referenced this pull request Dec 5, 2026
Automated Release PR
---


## [3.64.0](v3.63.0...v3.64.0) (2026-12-05)


### ⚠ BREAKING CHANGES

* **api:** Type checkers can flag direct `provider.region` access even for bucket-only callers. At runtime, reading it on a custom endpoint raises `AttributeError`. Check `provider.type != "custom_endpoint"` first. ([#4374](#4374))

### Features

* **api:** add memory and history to beta agents ([#4372](#4372)) ([cc52701](cc52701))
* **api:** add model and token category to organization costs ([#4365](#4365)) ([43b6ff6](43b6ff6))
* **api:** add project API key status filters ([#4371](#4371)) ([7adbcba](7adbcba))
* **api:** support custom HTTPS providers for external storage ([#4374](#4374)) ([dfed070](dfed070))


### Bug Fixes

* **streaming:** omit payloads from invalid delta errors ([#4375](#4375)) ([ba6e577](ba6e577))


### Chores

* **api:** clarify agent session deletion ([#4368](#4368)) ([8f651c7](8f651c7))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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