Skip to content

fix: settle WebSocket event waiters in linear time - #2389

Merged
HAYDEN-OAI merged 1 commit into
mainfrom
agent/linear-websocket-event-waiters
Aug 18, 2026
Merged

HAYDEN-OAI merged 1 commit into
mainfrom
agent/linear-websocket-event-waiters

Conversation

@HAYDEN-OAI

Copy link
Copy Markdown
Contributor
  • I understand that this repository is auto-generated and my pull request may not be merged

Summary

  • Settle concurrent Realtime and Responses WebSocket event waiters in linear time across their two independent handwritten event emitters.
  • Preserve public listener hooks, first-match removal, detached dispatch snapshots, nested events, duplicate overrides, arbitrary error identity, and internal emitters without declared error events.
  • Cover all six public stable/beta browser/Node Realtime and Responses WebSocket transports on both success and error paths; no generated resource files are changed.

Validation

  • Regression first: all 12 public transport/success-error cases performed 8,386,560 array shifts for 4,096 waiters before the fix; all now perform zero shifts.
  • 65,536 waiters settle in 28-49 ms across both emitters and both settlement paths.
  • Full handwritten suite: 101 files / 3,018 tests passed.
  • Full generated suite: 82 files / 559 tests passed.
  • Focused existing and new streaming/WebSocket coverage: 7 files / 281 tests passed.
  • Full generated-file lint, pinned oxfmt 0.62 formatting (646 files), and 415-rule oxlint (357 files).
  • Repository TypeScript, CommonJS/ESM build, packed npm artifact, and published-source checks on TypeScript 4.9 and current.

@openai-sdks

openai-sdks Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 237/237 SDK tests passed in 10.373s for Node SDK PR #2389.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 215ms
tests/chat-completions-create.test.ts ✅ Passed 236ms
tests/chat-completions-stream.test.ts ✅ Passed 137ms
tests/files-content-binary.test.ts ✅ Passed 135ms
tests/files-create-multipart.test.ts ✅ Passed 146ms
tests/files-list-pagination.test.ts ✅ Passed 150ms
tests/initialize-config.test.ts ✅ Passed 186ms
tests/instance-isolation.test.ts ✅ Passed 118ms
tests/models-list.test.ts ✅ Passed 136ms
tests/responses-background-lifecycle.test.ts ✅ Passed 200ms
tests/responses-body-method-errors.test.ts ✅ Passed 298ms
tests/responses-cancel-timeout.test.ts ✅ Passed 184ms
tests/responses-cancel.test.ts ✅ Passed 279ms
tests/responses-compact-retries.test.ts ✅ Passed 297ms
tests/responses-compact.test.ts ✅ Passed 223ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 118ms
tests/responses-create-advanced.test.ts ✅ Passed 219ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.25s
tests/responses-create-errors.test.ts ✅ Passed 223ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 125ms
tests/responses-create-retries.test.ts ✅ Passed 253ms
tests/responses-create-stream-failures.test.ts ✅ Passed 237ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 2.158s
tests/responses-create-stream-wire.test.ts ✅ Passed 2.533s
tests/responses-create-stream.test.ts ✅ Passed 86ms
tests/responses-create-terminal-states.test.ts ✅ Passed 247ms
tests/responses-create-timeout.test.ts ✅ Passed 193ms
tests/responses-create.test.ts ✅ Passed 143ms
tests/responses-delete.test.ts ✅ Passed 133ms
tests/responses-input-items-errors.test.ts ✅ Passed 173ms
tests/responses-input-items-list.test.ts ✅ Passed 179ms
tests/responses-input-items-options.test.ts ✅ Passed 104ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 233ms
tests/responses-input-tokens-count.test.ts ✅ Passed 295ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.244s
tests/responses-not-found-errors.test.ts ✅ Passed 237ms
tests/responses-parse.test.ts ✅ Passed 213ms
tests/responses-retrieve-retries.test.ts ✅ Passed 233ms
tests/responses-retrieve.test.ts ✅ Passed 202ms
tests/responses-stored-method-errors.test.ts ✅ Passed 514ms
tests/retry-behavior.test.ts ✅ Passed 3.061s
tests/sdk-error-shape.test.ts ✅ Passed 290ms

View OkTest run #32084612626

SDK merge (41b057fc6dc5) · head (5ea35a057674) · base (a88c2caa8a2e) · OkTest (7e7850017529)

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 5ea35a057674723f956c13aca14751871f297780 in two independent passes.

Both handwritten WebSocket emitters now settle concurrent event waiters in linear time while preserving nested dispatch snapshots, duplicate listeners, overridden hooks, arbitrary error identity, cleanup ordering, and the six public stable/beta transport variants. Focused 4,096-waiter success/error regressions and all Node 22/24/26, lint, build, ecosystem, performance, breaking-change, and security checks passed.

No findings.

@HAYDEN-OAI
HAYDEN-OAI added this pull request to the merge queue Aug 18, 2026
Merged via the queue into main with commit 489dc72 Aug 18, 2026
27 checks passed
@HAYDEN-OAI
HAYDEN-OAI deleted the agent/linear-websocket-event-waiters branch August 18, 2026 16:14
@openai-sdks openai-sdks Bot mentioned this pull request Aug 18, 2026

This branch was successfully deployed

1 active deployment
ci — 5ea35a05 Deployed Aug 18, 2026 by HAYDEN-OAI via examples #8344
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants