Skip to content

docs: document assistant stream failures#1979

Open
HAYDEN-OAI wants to merge 1 commit into
mainfrom
codex/handle-unhandled-rejections
Open

docs: document assistant stream failures#1979
HAYDEN-OAI wants to merge 1 commit into
mainfrom
codex/handle-unhandled-rejections

Conversation

@HAYDEN-OAI

Copy link
Copy Markdown
Contributor

Summary

  • document the Assistants stream abort event alongside error and end
  • explain that cancellation through an AbortSignal or .abort() emits abort
  • add a safe example that registers both listeners and catches the finalRun() promise

Why

Issue #959 reports unhandled rejections while retrying or cancelling Assistant streams. The current helper already separates API and SDK failures from cancellations, but the Assistants event docs only showed error and did not explain that promise-returning helpers still need their own await or catch.

Impact

Users now have an explicit pattern for handling stream failures before handing a stream to another consumer, including client disconnect and cancellation paths. This clarifies the existing runtime behavior without changing stream semantics.

Validation

  • pnpm run format
  • pnpm run lint

Resolves #959

@HAYDEN-OAI HAYDEN-OAI marked this pull request as ready for review July 6, 2026 21:33
@HAYDEN-OAI HAYDEN-OAI requested a review from a team as a code owner July 6, 2026 21:33
@HAYDEN-OAI HAYDEN-OAI requested a review from apcha-oai July 6, 2026 21:33
@openai-sdks

openai-sdks Bot commented Jul 6, 2026

Copy link
Copy Markdown

OkTest Summary

237/237 SDK tests passed in 10.845s for Node SDK PR #1979.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 198ms
tests/chat-completions-create.test.ts ✅ Passed 214ms
tests/chat-completions-stream.test.ts ✅ Passed 213ms
tests/files-content-binary.test.ts ✅ Passed 162ms
tests/files-create-multipart.test.ts ✅ Passed 175ms
tests/files-list-pagination.test.ts ✅ Passed 213ms
tests/initialize-config.test.ts ✅ Passed 174ms
tests/instance-isolation.test.ts ✅ Passed 106ms
tests/models-list.test.ts ✅ Passed 142ms
tests/responses-background-lifecycle.test.ts ✅ Passed 270ms
tests/responses-body-method-errors.test.ts ✅ Passed 329ms
tests/responses-cancel-timeout.test.ts ✅ Passed 209ms
tests/responses-cancel.test.ts ✅ Passed 230ms
tests/responses-compact-retries.test.ts ✅ Passed 294ms
tests/responses-compact.test.ts ✅ Passed 251ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 108ms
tests/responses-create-advanced.test.ts ✅ Passed 237ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.198s
tests/responses-create-errors.test.ts ✅ Passed 215ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 151ms
tests/responses-create-retries.test.ts ✅ Passed 237ms
tests/responses-create-stream-failures.test.ts ✅ Passed 292ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 2.193s
tests/responses-create-stream-wire.test.ts ✅ Passed 2.67s
tests/responses-create-stream.test.ts ✅ Passed 81ms
tests/responses-create-terminal-states.test.ts ✅ Passed 217ms
tests/responses-create-timeout.test.ts ✅ Passed 216ms
tests/responses-create.test.ts ✅ Passed 141ms
tests/responses-delete.test.ts ✅ Passed 170ms
tests/responses-input-items-errors.test.ts ✅ Passed 174ms
tests/responses-input-items-list.test.ts ✅ Passed 160ms
tests/responses-input-items-options.test.ts ✅ Passed 280ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 227ms
tests/responses-input-tokens-count.test.ts ✅ Passed 228ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.329s
tests/responses-not-found-errors.test.ts ✅ Passed 290ms
tests/responses-parse.test.ts ✅ Passed 190ms
tests/responses-retrieve-retries.test.ts ✅ Passed 235ms
tests/responses-retrieve.test.ts ✅ Passed 333ms
tests/responses-stored-method-errors.test.ts ✅ Passed 577ms
tests/retry-behavior.test.ts ✅ Passed 3.088s
tests/sdk-error-shape.test.ts ✅ Passed 268ms

View OkTest run #28824774087

SDK merge (2ad625900c9b) · head (48f787a31acb) · base (95b54e589491) · OkTest (7fc645091b1a)

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.

Getting Unhandled Rejection event, randomly.

1 participant