Skip to content

chore(api): declare SSE response contracts for streaming endpoints - #2954

Closed
jbeckwith-oai wants to merge 1 commit into
mainfrom
castiron/promotions/pr-315
Closed

jbeckwith-oai wants to merge 1 commit into
mainfrom
castiron/promotions/pr-315

Conversation

@jbeckwith-oai

@jbeckwith-oai jbeckwith-oai commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Declare text/event-stream responses for Completions, stable/beta Responses retrieval, and the three Assistants run operations in the API reference. Existing JSON responses, runtime behavior, public types, compact schemas, and WebSocket customizations remain unchanged.

Validation

Pre-promotion CI passed. The historical generation checkpoint was also verified as both a current and previous baseline, and all 95 tooling regression tests passed. This public PR runs its own CI before merge.

Castiron-Internal-PR: openai/openai-node-internal#315
Castiron-Source-SHA: 1758e79e0de8d635048a02e713744665cb6fd1f6
Castiron-Public-Base-SHA: 7665932
@jbeckwith-oai
jbeckwith-oai marked this pull request as ready for review October 16, 2026 15:37
@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner October 16, 2026 15:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-10-16T15:40:12.821405Z f97846d Draft marked ready
🔒 Security Review ✅ Completed 2026-10-16T15:39:47.652697Z f97846d Draft marked ready
ℹ️ 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.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

Evaluated main: 7665932e2b7965a5e0a3123fe3de4dbdb4131933.

Trusted main policy: 7665932e2b7965a5e0a3123fe3de4dbdb4131933.

✅ No new custom-code files detected.

47 mixed files remain; 0 existing customizations changed.

Compared 7665932e2b79 → f97846d36d17. Generated baselines verified.

47 existing customizations unchanged
  • api.md
  • src/client.ts
  • src/resources/admin/organization/usage.ts
  • src/resources/audio/transcriptions.ts
  • src/resources/audio/translations.ts
  • src/resources/beta/agents/agents.ts
  • src/resources/beta/agents/environments/environments.ts
  • src/resources/beta/agents/environments/files.ts
  • src/resources/beta/agents/sessions/artifacts.ts
  • src/resources/beta/agents/sessions/sessions.ts
  • src/resources/beta/assistants.ts
  • src/resources/beta/beta.ts
  • src/resources/beta/index.ts
  • src/resources/beta/responses/internal-base.ts
  • src/resources/beta/responses/responses.ts
  • src/resources/beta/responses/ws-base.ts
  • src/resources/beta/responses/ws.ts
  • src/resources/beta/threads/index.ts
  • src/resources/beta/threads/runs/index.ts
  • src/resources/beta/threads/runs/runs.ts
  • src/resources/beta/threads/threads.ts
  • src/resources/chat/completions/completions.ts
  • src/resources/chat/completions/index.ts
  • src/resources/conversations/index.ts
  • src/resources/embeddings.ts
  • src/resources/files.ts
  • src/resources/fine-tuning/checkpoints/permissions.ts
  • src/resources/images.ts
  • src/resources/live/forks/ws-base.ts
  • src/resources/live/forks/ws.ts
  • src/resources/live/sideband/ws-base.ts
  • src/resources/live/sideband/ws.ts
  • src/resources/live/ws-base.ts
  • src/resources/live/ws.ts
  • src/resources/responses/internal-base.ts
  • src/resources/responses/responses.ts
  • src/resources/responses/ws-base.ts
  • src/resources/responses/ws.ts
  • src/resources/skills/skills.ts
  • src/resources/skills/versions/versions.ts

7 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 38925545560 --repo openai/openai-node \
  --name castiron-custom-code-38925545560-1 --dir /tmp/castiron-custom-code-38925545560-1
git apply --stat /tmp/castiron-custom-code-38925545560-1/custom-code.patch
cat /tmp/castiron-custom-code-38925545560-1/custom-code.patch

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

git fetch --no-tags origin 7665932e2b7965a5e0a3123fe3de4dbdb4131933 f97846d36d17b6df2af0f9e8a6f4ba74875a1014
python3 scripts/castiron/custom_code_report.py report \
  --base 7665932e2b7965a5e0a3123fe3de4dbdb4131933 \
  --head f97846d36d17b6df2af0f9e8a6f4ba74875a1014 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-f97846d36d17
cat /tmp/castiron-custom-code-f97846d36d17/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

@openai-sdks

openai-sdks Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 236/236 SDK tests passed in 8.244s for Node SDK PR #2954.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 203ms
tests/chat-completions-create.test.ts ✅ Passed 197ms
tests/chat-completions-stream.test.ts ✅ Passed 129ms
tests/files-content-binary.test.ts ✅ Passed 247ms
tests/files-create-multipart.test.ts ✅ Passed 230ms
tests/files-list-pagination.test.ts ✅ Passed 163ms
tests/initialize-config.test.ts ✅ Passed 166ms
tests/instance-isolation.test.ts ✅ Passed 215ms
tests/models-list.test.ts ✅ Passed 196ms
tests/responses-background-lifecycle.test.ts ✅ Passed 198ms
tests/responses-body-method-errors.test.ts ✅ Passed 226ms
tests/responses-cancel-timeout.test.ts ✅ Passed 260ms
tests/responses-cancel.test.ts ✅ Passed 176ms
tests/responses-compact-retries.test.ts ✅ Passed 261ms
tests/responses-compact.test.ts ✅ Passed 179ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 150ms
tests/responses-create-advanced.test.ts ✅ Passed 158ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.029s
tests/responses-create-errors.test.ts ✅ Passed 155ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 116ms
tests/responses-create-retries.test.ts ✅ Passed 206ms
tests/responses-create-stream-failures.test.ts ✅ Passed 119ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 2.202s
tests/responses-create-stream-wire.test.ts ✅ Passed 1.221s
tests/responses-create-stream.test.ts ✅ Passed 129ms
tests/responses-create-terminal-states.test.ts ✅ Passed 206ms
tests/responses-create-timeout.test.ts ✅ Passed 252ms
tests/responses-create.test.ts ✅ Passed 175ms
tests/responses-delete.test.ts ✅ Passed 187ms
tests/responses-input-items-errors.test.ts ✅ Passed 151ms
tests/responses-input-items-list.test.ts ✅ Passed 157ms
tests/responses-input-items-options.test.ts ✅ Passed 188ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 254ms
tests/responses-input-tokens-count.test.ts ✅ Passed 171ms
tests/responses-malformed-inputs.test.ts ✅ Passed 921ms
tests/responses-not-found-errors.test.ts ✅ Passed 218ms
tests/responses-parse.test.ts ✅ Passed 184ms
tests/responses-retrieve-retries.test.ts ✅ Passed 208ms
tests/responses-retrieve.test.ts ✅ Passed 225ms
tests/responses-stored-method-errors.test.ts ✅ Passed 377ms
tests/retry-behavior.test.ts ✅ Passed 2.937s
tests/sdk-error-shape.test.ts ✅ Passed 252ms

View OkTest run #38925432752

SDK merge (a9c4aade411e) · head (f97846d36d17) · base (7665932e2b79) · OkTest (34e505148f02)

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

ℹ️ 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 on lines +3576 to +3578
text/event-stream:
schema:
$ref: '#/components/schemas/CreateCompletionResponse'

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 Model nullable usage in completion stream events

When stream: true is combined with stream_options.include_usage, the option's own contract says every non-final chunk includes usage: null, but CreateCompletionResponse.usage only permits a non-null CompletionUsage. Reusing that schema for text/event-stream therefore makes valid completion events fail schema validation and tells generated consumers that any present usage is an object; use a distinct stream-event schema that permits the incomplete wire shape.

AGENTS.md reference: AGENTS.md:L36-L39

Useful? React with 👍 / 👎.

@jbeckwith-oai
jbeckwith-oai marked this pull request as draft October 16, 2026 15:43
@jbeckwith-oai

Copy link
Copy Markdown
Contributor Author

Closing this scope expansion. The Java-only handwritten test extraction is already merged in openai/openai-java#1190.

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.

1 participant