Skip to content

Speed up progressive snapshots and add completion events#21

Merged
roodboi merged 1 commit into
mainfrom
codex/faster-progressive-snapshots
Jul 12, 2026
Merged

Speed up progressive snapshots and add completion events#21
roodboi merged 1 commit into
mainfrom
codex/faster-progressive-snapshots

Conversation

@roodboi

@roodboi roodboi commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • eliminate the normal iterate-path UTF-8 JSON round trip and batch parser hot paths
  • add completion events, explicit snapshot policies, deterministic benchmarks, and complex nested coverage
  • add OpenAI Agents, Vercel AI SDK, and Mastra integrations plus a real WebSocket browser example
  • document the server-side parsing and browser transport tradeoffs with an adversarial SSE, Fetch streams, and WebSocket comparison

Performance

Representative retained benchmark results show a 7.80x gain on Bun and a 36.83x gain on Node for the long-string, one-character-chunk hotspot. Object-heavy cases remain near parity or show modest gains, so this change deliberately stays in TypeScript instead of adding a native addon.

Run bun run benchmark for the formatted comparison table and bun run benchmark --json for machine-readable evidence.

Integration and UX

  • deterministic Fixture mode and real OpenAI mode
  • server-side partial parsing with complete JSON snapshots per WebSocket message
  • incremental dashboard materialization, completion-event log, and a progressive raw JSON panel
  • documented conditional decisions from key/value completion events
  • runnable examples for core streams, OpenAI Agents, Vercel AI SDK, Mastra, and Bun WebSockets

Verification

  • bun run check
  • 66 tests passed, 4 opt-in live tests skipped, 2,569 assertions
  • packed Node/Bun ESM/CJS and Zod 3, Zod 4, and Zod Mini consumer matrix
  • bun run test:coverage (90.84% line coverage)
  • bun run examples
  • bun run benchmark
  • bun run benchmark --completion-scaling
  • live OpenAI Agents and Mastra end-to-end runs
  • bun audit --production --audit-level=high
  • desktop and mobile browser verification of the WebSocket example

roodboi commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 06e422c493

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@roodboi roodboi merged commit ee70009 into main Jul 12, 2026
4 checks passed
@roodboi roodboi deleted the codex/faster-progressive-snapshots branch July 12, 2026 03:02
@github-actions github-actions Bot mentioned this pull request Jul 12, 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.

1 participant