Skip to content

feat(api): Ultrafast tier, structured MCP and websocket errors, separate websocket events - #863

Merged
apcha-oai merged 1 commit into
mainfrom
castiron/promotions/pr-22-67f9f40a004c
Aug 14, 2026
Merged

feat(api): Ultrafast tier, structured MCP and websocket errors, separate websocket events#863
apcha-oai merged 1 commit into
mainfrom
castiron/promotions/pr-22-67f9f40a004c

Conversation

@apcha-oai

@apcha-oai apcha-oai commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add GPT-5.5 dated and Pro model constants, the ultrafast Responses service tier, and optional model shutdown dates.
  • Expose reusable stable and beta MCP error models with protocol, tool-execution, and HTTP variants instead of describing MCP errors as strings the API never accepts or emits.
  • MCP error getters and builders now use structured error types rather than strings; consumers relying on the previous inaccurate signatures must update.
  • Correct Responses WebSocket failures to expose their actual nested error payload and transport metadata instead of the ordinary response-error event shape.
  • The API compatibility check is expected to flag these intentional signature corrections; Responses WebSockets are not an officially supported Java surface.

@apcha-oai
apcha-oai marked this pull request as ready for review August 14, 2026 16:17
@apcha-oai
apcha-oai requested a review from a team as a code owner August 14, 2026 16:17
@openai-sdks

openai-sdks Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

OkTest Summary

237/237 SDK tests passed in 19.709s for Java SDK PR #863.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 317ms
tests/chat-completions-create.test.ts ✅ Passed 864ms
tests/chat-completions-stream.test.ts ✅ Passed 350ms
tests/files-content-binary.test.ts ✅ Passed 285ms
tests/files-create-multipart.test.ts ✅ Passed 456ms
tests/files-list-pagination.test.ts ✅ Passed 373ms
tests/initialize-config.test.ts ✅ Passed 187ms
tests/instance-isolation.test.ts ✅ Passed 264ms
tests/models-list.test.ts ✅ Passed 194ms
tests/responses-background-lifecycle.test.ts ✅ Passed 311ms
tests/responses-body-method-errors.test.ts ✅ Passed 455ms
tests/responses-cancel-timeout.test.ts ✅ Passed 216ms
tests/responses-cancel.test.ts ✅ Passed 433ms
tests/responses-compact-retries.test.ts ✅ Passed 369ms
tests/responses-compact.test.ts ✅ Passed 554ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 574ms
tests/responses-create-advanced.test.ts ✅ Passed 1.551s
tests/responses-create-disconnect.test.ts ✅ Passed 1.214s
tests/responses-create-errors.test.ts ✅ Passed 349ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 315ms
tests/responses-create-retries.test.ts ✅ Passed 628ms
tests/responses-create-stream-failures.test.ts ✅ Passed 253ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 210ms
tests/responses-create-stream-wire.test.ts ✅ Passed 8.478s
tests/responses-create-stream.test.ts ✅ Passed 443ms
tests/responses-create-terminal-states.test.ts ✅ Passed 480ms
tests/responses-create-timeout.test.ts ✅ Passed 204ms
tests/responses-create.test.ts ✅ Passed 296ms
tests/responses-delete.test.ts ✅ Passed 349ms
tests/responses-input-items-errors.test.ts ✅ Passed 307ms
tests/responses-input-items-list.test.ts ✅ Passed 378ms
tests/responses-input-items-options.test.ts ✅ Passed 587ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 271ms
tests/responses-input-tokens-count.test.ts ✅ Passed 352ms
tests/responses-malformed-inputs.test.ts ✅ Passed 7.515s
tests/responses-not-found-errors.test.ts ✅ Passed 428ms
tests/responses-parse.test.ts ✅ Passed 580ms
tests/responses-retrieve-retries.test.ts ✅ Passed 339ms
tests/responses-retrieve.test.ts ✅ Passed 304ms
tests/responses-stored-method-errors.test.ts ✅ Passed 969ms
tests/retry-behavior.test.ts ✅ Passed 3.625s
tests/sdk-error-shape.test.ts ✅ Passed 515ms

View OkTest run #31834840899

SDK merge (a814c200b147) · head (73a04d7e3d7d) · base (73b39b82618b) · OkTest (a845fa206fa4)

@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: dc4f09a5ac

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

private val responseContentPartDone: ResponseContentPartDoneEvent? = null,
private val responseCreated: ResponseCreatedEvent? = null,
private val error: ResponseErrorEvent? = null,
private val error: ResponseWsError? = null,

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 Read the typed stream ID from WebSocket errors

When an error event is constructed with ResponseWsError.builder().streamId(...) and wrapped using ResponsesServerEvent.ofError, the outer streamId() accessor returns empty because streamIdField() still searches error._additionalProperties() rather than the new typed stream-ID field. Deserialized events appear correct only because _json supplies the value. Update the error branch, and the equivalent beta branch, to read the typed field.

Useful? React with 👍 / 👎.

Comment on lines +5242 to +5244
val bestMatches =
sequenceOf(
tryDeserialize(node, jacksonTypeRef<McpProtocolError>())?.let {

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 unknown structured MCP errors

When the API returns a future structured MCP error with an unrecognized type, each object deserializer here still succeeds because unknown fields and discriminator values are retained, so bestMatches selects an invalid known variant (usually McpProtocolError) instead of the union's unknown variant. Consequently accept dispatches to the wrong visitor and validate() throws, despite the documented forward-compatible unknown path. Dispatch recognized object types by their discriminator and preserve unrecognized types as _json; the same generated MCP error union is duplicated in the other response item models.

Useful? React with 👍 / 👎.

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

I found two blocking issues at exact head dc4f09a5ac9c1e080ea92e9b54f0782444f99878:

  1. [High] Preserve the existing MCP error getter API. In ResponseInputItem.kt:14279 (and the corresponding stable, beta, output, and conversation models), error() changes from Optional<String> to Optional<Error>. Existing source callers no longer compile even though a string remains a supported wire variant. Please retain a deprecated error(): Optional<String> that projects the string variant and add a separate structured accessor such as errorUnion(), while keeping builder overloads for both; otherwise defer the replacement to a major release.

  2. [Medium] Reuse the named generated unions instead of embedding thousands of lines per owner. The same MCP error union is emitted as roughly 987 lines in each of seven model owners, while the annotation-added event grows from 434 to 2,073 lines (representative ResponseOutputTextAnnotationAddedEvent.kt:457). The transformed schema already names Annotation and MCPToolCallError, so the Java generator should preserve/reuse that identity and introduce one named outer string-or-MCP-error union rather than duplicating full builders and serializers in every owner. Please add one canonical round-trip suite covering the legacy string plus all structured MCP variants; the changed owner tests currently exercise only the string case.

The remaining generated schema updates look internally consistent.

…ate websocket events

Castiron-Internal-PR: openai/openai-java-internal#22
Castiron-Source-SHA: aad4f8fe638f7f0430637578c874b1dc1d9cf28d
Castiron-Public-Base-SHA: 73b39b8
@apcha-oai
apcha-oai force-pushed the castiron/promotions/pr-22-67f9f40a004c branch from dc4f09a to 73a04d7 Compare August 14, 2026 19:47
@apcha-oai
apcha-oai merged commit ec274a8 into main Aug 14, 2026
7 of 9 checks passed
@openai-sdks openai-sdks Bot mentioned this pull request Aug 14, 2026
apcha-oai pushed a commit that referenced this pull request Aug 14, 2026
Automated Release PR
---


##
[4.51.0](v4.50.0...v4.51.0)
(2026-08-14)


### Features

* **api:** Add GPT_DAYBREAK and GPT_5_6_CYBER model identifiers
([5b9ba3a](5b9ba3a))
* **api:** add WebSocket stream IDs
([#861](#861))
([4936d0b](4936d0b))
* **api:** add workload identity access token issued event
([#859](#859))
([2b763fe](2b763fe))
* **api:** deprecate Sora video APIs
([#860](#860))
([a191575](a191575))
* **api:** Ultrafast tier, structured MCP and websocket errors, separate
websocket events
([#863](#863))
([ec274a8](ec274a8))


### Bug Fixes

* **api:** Add GPT_DAYBREAK and GPT_5_6_CYBER model identifiers
([#856](#856))
([5b9ba3a](5b9ba3a))
* **api:** clarify audio upload metadata requirements
([#857](#857))
([593f04c](593f04c))
* restore ProGuard configuration caching
([#842](#842))
([fb8daa4](fb8daa4))


### Chores

* **api:** Update generated file header text
([#846](#846))
([d11a357](d11a357))
* remove Stainless attribution and infrastructure
([#858](#858))
([942a097](942a097))


### Documentation

* **api:** describe response stream event unions
([#862](#862))
([73b39b8](73b39b8))
* keep README badges on latest release
([#839](#839))
([33c6b57](33c6b57))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.com>
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