Repository navigation
chore(api): declare SSE response contracts for streaming endpoints - #4089
jbeckwith-oai wants to merge 1 commit into
Conversation
Castiron-Internal-PR: openai/openai-python-internal#271 Castiron-Source-SHA: 54527f1c3ffce8594964193c16571a36ba9db26c Castiron-Public-Base-SHA: 230a923
Castiron custom codeEvaluated main: Trusted main policy: ✅ No new custom-code files detected. 36 mixed files remain; 0 existing customizations changed. Compared 36 existing customizations unchanged
A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload the exact patch produced by this run (requires repository access): gh run download 38925035853 --repo openai/openai-python \
--name castiron-custom-code-38925035853-1 --dir /tmp/castiron-custom-code-38925035853-1
git apply --stat /tmp/castiron-custom-code-38925035853-1/custom-code.patch
cat /tmp/castiron-custom-code-38925035853-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 230a923faba5574ebdc5b45a505a26b6bad79f61 fcd06ae329e584738795166c797c98d58a40b3a6
python3 scripts/castiron/custom_code_report.py report \
--base 230a923faba5574ebdc5b45a505a26b6bad79f61 \
--head fcd06ae329e584738795166c797c98d58a40b3a6 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-fcd06ae329e5
cat /tmp/castiron-custom-code-fcd06ae329e5/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fcd06ae329
ℹ️ 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".
| text/event-stream: | ||
| schema: | ||
| $ref: '#/components/schemas/CreateCompletionResponse' |
There was a problem hiding this comment.
Allow null finish reasons in streamed completion chunks
When stream: true, intermediate completion chunks contain "finish_reason": null, as the endpoint's own streaming example demonstrates at lines 3728-3734. CreateCompletionResponse instead requires finish_reason to be one of three non-null strings at lines 42119-42134, so assigning that schema to text/event-stream makes valid chunks fail OpenAPI validation and misleads clients generated from this contract. Use a streaming schema that permits null, or make the shared choice field nullable.
Useful? React with 👍 / 👎.
|
Closing this scope expansion. The Java-only handwritten test extraction is already merged in openai/openai-java#1190. |
Summary
Declare
text/event-streamresponses for Completions, stable/beta Responses retrieval, and the three Assistants run operations in the API reference. Existing JSON responses, runtime code, response types, and compact schemas remain unchanged.Validation
Pre-promotion checks passed for Python 3.10/3.14, HTTPX2, lint, build, type checks, CodeQL, and generated-baseline/custom-code verification. This public PR runs its own CI before merge.