Skip to content

feat(api): add WebSocket stream IDs - #861

Merged
jbeckwith-oai merged 6 commits into
mainfrom
codex/castiron-openapi-1e5b3b1f
Aug 13, 2026
Merged

feat(api): add WebSocket stream IDs#861
jbeckwith-oai merged 6 commits into
mainfrom
codex/castiron-openapi-1e5b3b1f

Conversation

@jbeckwith-oai

Copy link
Copy Markdown
Contributor

Summary

Adds optional WebSocket-only stream_id routing metadata to Responses client events and all server response events. Events sharing a stream ID are processed FIFO and response events echo that identifier.

Source: https://github.com/openai/openai/pull/1282468
OpenAPI commit: 1e5b3b1f1d21b51c5a37d6122c2b3b2d70ef5a1a

Validation

  • Castiron public-baseline generation and formatter completed
  • Generated event tests cover stream ID builders, accessors, and serialization
  • Strict generated-diff quality review passed
  • No private inputs, workflow files, or internal-repository changes are included

@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner August 13, 2026 19:14
@openai-sdks

openai-sdks Bot commented Aug 13, 2026

Copy link
Copy Markdown

OkTest Summary

237/237 SDK tests passed in 13.744s for Java SDK PR #861.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 370ms
tests/chat-completions-create.test.ts ✅ Passed 297ms
tests/chat-completions-stream.test.ts ✅ Passed 260ms
tests/files-content-binary.test.ts ✅ Passed 247ms
tests/files-create-multipart.test.ts ✅ Passed 453ms
tests/files-list-pagination.test.ts ✅ Passed 207ms
tests/initialize-config.test.ts ✅ Passed 115ms
tests/instance-isolation.test.ts ✅ Passed 118ms
tests/models-list.test.ts ✅ Passed 288ms
tests/responses-background-lifecycle.test.ts ✅ Passed 205ms
tests/responses-body-method-errors.test.ts ✅ Passed 465ms
tests/responses-cancel-timeout.test.ts ✅ Passed 189ms
tests/responses-cancel.test.ts ✅ Passed 283ms
tests/responses-compact-retries.test.ts ✅ Passed 379ms
tests/responses-compact.test.ts ✅ Passed 265ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 278ms
tests/responses-create-advanced.test.ts ✅ Passed 964ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.04s
tests/responses-create-errors.test.ts ✅ Passed 280ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 153ms
tests/responses-create-retries.test.ts ✅ Passed 231ms
tests/responses-create-stream-failures.test.ts ✅ Passed 155ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 203ms
tests/responses-create-stream-wire.test.ts ✅ Passed 5.117s
tests/responses-create-stream.test.ts ✅ Passed 73ms
tests/responses-create-terminal-states.test.ts ✅ Passed 239ms
tests/responses-create-timeout.test.ts ✅ Passed 208ms
tests/responses-create.test.ts ✅ Passed 743ms
tests/responses-delete.test.ts ✅ Passed 223ms
tests/responses-input-items-errors.test.ts ✅ Passed 328ms
tests/responses-input-items-list.test.ts ✅ Passed 233ms
tests/responses-input-items-options.test.ts ✅ Passed 183ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 187ms
tests/responses-input-tokens-count.test.ts ✅ Passed 447ms
tests/responses-malformed-inputs.test.ts ✅ Passed 4.227s
tests/responses-not-found-errors.test.ts ✅ Passed 351ms
tests/responses-parse.test.ts ✅ Passed 507ms
tests/responses-retrieve-retries.test.ts ✅ Passed 275ms
tests/responses-retrieve.test.ts ✅ Passed 252ms
tests/responses-stored-method-errors.test.ts ✅ Passed 933ms
tests/retry-behavior.test.ts ✅ Passed 3.444s
tests/sdk-error-shape.test.ts ✅ Passed 397ms

View OkTest run #31746303324

SDK merge (7cad16cb5c6e) · head (c9431157fbd4) · base (a191575f0c9a) · OkTest (a845fa206fa4)

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

fun toResponseAudioDoneEvent(): ResponseAudioDoneEvent =
ResponseAudioDoneEvent.builder().sequenceNumber(sequenceNumber).type(type).build()

P2 Badge Preserve extra fields when converting WebSocket events

When a response.audio.done payload is parsed, its response_id is captured in the wrapper's additionalProperties because it is not modeled as a typed field, but this conversion rebuilds the base event using only sequenceNumber and type. Calling toResponseAudioDoneEvent() therefore silently discards the response identifier, along with any other forward-compatible fields; the same omission occurs throughout the new toResponse...Event() helpers. Pass the wrapper's additional properties to the target builder.

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

@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: 27792da10e

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

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

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

@HAYDEN-OAI HAYDEN-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 all changed files and the stable/beta WebSocket stream-ID paths at commit e20237c. The earlier malformed-accessor and factory-serialization issues are resolved, but one substantive validation-contract issue remains in both server-event unions; see the inline comment.

@HAYDEN-OAI HAYDEN-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 the current head and confirmed stable and beta WebSocket stream IDs preserve factory/deserialization behavior, reject malformed values, and are validated consistently by both server-event unions. All previously reported substantive issues are resolved.

@jbeckwith-oai
jbeckwith-oai merged commit 4936d0b into main Aug 13, 2026
9 checks passed
@openai-sdks openai-sdks Bot mentioned this pull request Aug 13, 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.

2 participants