Skip to content

docs: show typed response stream failures - #868

Open
SiluPanda wants to merge 1 commit into
openai:mainfrom
SiluPanda:docs/typed-response-stream-events
Open

docs: show typed response stream failures#868
SiluPanda wants to merge 1 commit into
openai:mainfrom
SiluPanda:docs/typed-response-stream-events

Conversation

@SiluPanda

Copy link
Copy Markdown

Summary

  • update the Responses streaming README snippet and runnable example to switch on stream.Current().AsAny()
  • show how to handle ResponseErrorEvent and ResponseFailedEvent
  • distinguish typed stream events from transport/API-level failures returned by stream.Err()

Testing

  • go -C examples vet ./responses-streaming
  • go -C examples test ./responses-streaming
  • go -C examples test ./...
  • git diff --check

Fixes #585

@SiluPanda
SiluPanda requested a review from a team as a code owner August 30, 2026 17:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 30, 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-08-30T17:55:24.529550Z 5f62608 PR opened
🔒 Security Review Completed 2026-08-30T17:56:24.939513Z 5f62608 PR opened
ℹ️ 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.

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

Checked this against the current streaming shape. AsAny() is the right boundary for the typed error/failed events, while keeping stream.Err() separate avoids implying transport or decode failures arrive as response events.

The completed case also pulls the final text from the terminal response instead of trying to rebuild it from deltas. Looks consistent.

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.

[ResponsesAPI] error and failed event issue

2 participants