Skip to content

docs: document abort event handling#1971

Open
HAYDEN-OAI wants to merge 1 commit into
mainfrom
codex/document-abort-events
Open

docs: document abort event handling#1971
HAYDEN-OAI wants to merge 1 commit into
mainfrom
codex/document-abort-events

Conversation

@HAYDEN-OAI

Copy link
Copy Markdown
Contributor

Summary

  • clarify that user-initiated aborts emit abort, not error
  • document that done() and the final* helpers reject with the same APIUserAbortError

Root cause

The event reference described error and abort separately, but did not explicitly state that aborts are intentionally excluded from the error event. That made correct abort behavior look like a missing error callback.

Impact

Users now have direct guidance to listen for abort and can handle the corresponding promise rejection consistently when awaiting stream helpers.

Validation

  • pnpm run format
  • git diff --check

Resolves #526

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

openai-sdks Bot commented Jul 6, 2026

Copy link
Copy Markdown

OkTest Summary

237/237 SDK tests passed in 10.289s for Node SDK PR #1971.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 145ms
tests/chat-completions-create.test.ts ✅ Passed 193ms
tests/chat-completions-stream.test.ts ✅ Passed 120ms
tests/files-content-binary.test.ts ✅ Passed 128ms
tests/files-create-multipart.test.ts ✅ Passed 164ms
tests/files-list-pagination.test.ts ✅ Passed 189ms
tests/initialize-config.test.ts ✅ Passed 169ms
tests/instance-isolation.test.ts ✅ Passed 133ms
tests/models-list.test.ts ✅ Passed 136ms
tests/responses-background-lifecycle.test.ts ✅ Passed 247ms
tests/responses-body-method-errors.test.ts ✅ Passed 272ms
tests/responses-cancel-timeout.test.ts ✅ Passed 279ms
tests/responses-cancel.test.ts ✅ Passed 208ms
tests/responses-compact-retries.test.ts ✅ Passed 214ms
tests/responses-compact.test.ts ✅ Passed 227ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 122ms
tests/responses-create-advanced.test.ts ✅ Passed 177ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.075s
tests/responses-create-errors.test.ts ✅ Passed 177ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 160ms
tests/responses-create-retries.test.ts ✅ Passed 246ms
tests/responses-create-stream-failures.test.ts ✅ Passed 169ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 2.178s
tests/responses-create-stream-wire.test.ts ✅ Passed 2.467s
tests/responses-create-stream.test.ts ✅ Passed 153ms
tests/responses-create-terminal-states.test.ts ✅ Passed 188ms
tests/responses-create-timeout.test.ts ✅ Passed 270ms
tests/responses-create.test.ts ✅ Passed 161ms
tests/responses-delete.test.ts ✅ Passed 253ms
tests/responses-input-items-errors.test.ts ✅ Passed 171ms
tests/responses-input-items-list.test.ts ✅ Passed 178ms
tests/responses-input-items-options.test.ts ✅ Passed 185ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 252ms
tests/responses-input-tokens-count.test.ts ✅ Passed 183ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.175s
tests/responses-not-found-errors.test.ts ✅ Passed 244ms
tests/responses-parse.test.ts ✅ Passed 156ms
tests/responses-retrieve-retries.test.ts ✅ Passed 254ms
tests/responses-retrieve.test.ts ✅ Passed 277ms
tests/responses-stored-method-errors.test.ts ✅ Passed 512ms
tests/retry-behavior.test.ts ✅ Passed 3.196s
tests/sdk-error-shape.test.ts ✅ Passed 263ms

View OkTest run #28814868396

SDK merge (b77b26d3ccdf) · head (c5a3c2f4aecb) · base (95b54e589491) · OkTest (7fc645091b1a)

@HAYDEN-OAI HAYDEN-OAI changed the title [codex] document abort event handling docs: document abort event handling Jul 6, 2026
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.

on('error', () => ...) event does not fire on APIUserAbortError

1 participant