fix(docs): correct the chat streaming helper contract - #2596
Conversation
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. |
Castiron custom code✅ No new custom-code files detected. 32 mixed files remain; 0 existing customizations changed. Compared 32 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 33829068742 --repo openai/openai-node \
--name castiron-custom-code-33829068742-1 --dir /tmp/castiron-custom-code-33829068742-1
git apply --stat /tmp/castiron-custom-code-33829068742-1/custom-code.patch
cat /tmp/castiron-custom-code-33829068742-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 6153484a88c2ce97bc81fe9c773b7c51b2f11d8f 0737b8f0558b4b4340875f6510125e6de38490d9
python3 scripts/castiron/custom_code_report.py report \
--base 6153484a88c2ce97bc81fe9c773b7c51b2f11d8f \
--head 0737b8f0558b4b4340875f6510125e6de38490d9 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-0737b8f0558b
cat /tmp/castiron-custom-code-0737b8f0558b/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Validated the exact-head documentation correction. The public chat completions stream helper accepts only omitted or true stream mode and returns ChatCompletionStream, not the tool-runner type. The updated signature and prose now match the public API contract. Review is complete; CI is still running.
Summary
Correct three tokens in the handwritten Chat Streaming guide:
streamflag accepted bychat.completions.stream()istrue, notfalse.ChatCompletionStream, notChatCompletionStreamingRunner(which is used for streaming tool runners).The current documented
stream: falsecall fails type checking with TS2322. The public helper always enables streaming. No SDK implementation, generated files, public declarations, dependencies, or lockfiles change.docs/helpers.mdis absent from the pinned Castiron generated snapshot. I checked open PRs; #2591 edits an unrelatedafterCompletionsection of the same guide and does not address this issue.Validation
OpenAIexport:stream: falseis rejected; omittedstreamandstream: trueare accepted..stream()smoke test with synthetic SSE: exactChatCompletionStreamprototype, not aChatCompletionStreamingRunner, serializedstream: true, successful completion, no live API calls../scripts/test tests/lib/ChatCompletionStream.test.ts: 40 passed on Node 22.22.2 and 40 passed on Node 24.19.0.git diff --checkpassed.qs@6.16.0in the configured registry; no installation safeguards or configuration were changed.Adversarial self-review
Reviewed public types, actual return identity, optional/explicit stream behavior, compatibility, and security implications. Independent review found no actionable issues. This is a documentation-only correction; compiler/runtime verification and the existing stream suite are proportionate, without adding a Markdown-parsing test harness for three tokens.