Skip to content

refactor: extract stream parsing into its own protocol module - #14

Merged
TheGreatAxios merged 1 commit into
cl-9219-openai-responses-extract-request-body-building-intofrom
cl-9317-openai-responses-extract-stream-parsing-into
Sep 27, 2026
Merged

TheGreatAxios merged 1 commit into
cl-9219-openai-responses-extract-request-body-building-intofrom
cl-9317-openai-responses-extract-stream-parsing-into

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Moves the event schemas, SSE streaming parse, non-streaming JSON parse, block indexing and terminal-event detection from src/responses.ts into src/protocol/iterator.ts.
  • src/responses.ts now holds the quirks resolver, header extractors and the factory that wires body and iterator together.
  • tagSignature stays in body.ts next to its untag/replay counterpart; iterator.ts imports it.
  • src/index.ts imports isResponsesStreamTerminal from its new location; the export list is unchanged.
  • Updates the AGENTS.md layout section. Code is moved verbatim; no behavior change.
  • Stacked on refactor: extract request body building into its own protocol module #13.

Verification

  • bun run check (typecheck, lint, format:check, test): 39 pass, 2 skip, 0 fail
  • bun run build emits dist/protocol/iterator.js

Closes CL-9317

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed the full diff against #13: event schemas, stream/JSON parsing and the block indexer move verbatim; responses.ts keeps only quirks, header extractors and wiring. Public exports from src/index.ts are unchanged. Check and build pass locally.

@TheGreatAxios
TheGreatAxios force-pushed the cl-9317-openai-responses-extract-stream-parsing-into branch from 3139a49 to bce7a6e Compare September 25, 2026 06:01
@TheGreatAxios

Copy link
Copy Markdown
Contributor Author

Independent review findings addressed and force-pushed: commit message reworded. check passes.

@TheGreatAxios
TheGreatAxios force-pushed the cl-9317-openai-responses-extract-stream-parsing-into branch 2 times, most recently from 5bbfe2c to 445d930 Compare September 25, 2026 22:48
@TheGreatAxios TheGreatAxios changed the title refactor: extract stream parsing into protocol/iterator.ts (CL-9317) Extract stream parsing into protocol/iterator.ts Sep 25, 2026
Moves the event schemas, SSE streaming parse, non-streaming JSON parse,
block indexing and terminal-event detection out of the adapter module,
which now holds only the quirks resolver, header extractors and the
factory wiring body and iterator together. No behavior change.
@TheGreatAxios
TheGreatAxios force-pushed the cl-9317-openai-responses-extract-stream-parsing-into branch from 445d930 to 1951d30 Compare September 26, 2026 01:33
@TheGreatAxios TheGreatAxios changed the title Extract stream parsing into protocol/iterator.ts refactor: extract stream parsing into its own protocol module Sep 26, 2026
@TheGreatAxios
TheGreatAxios added this pull request to stack #19 September 26, 2026 01:58
@TheGreatAxios
TheGreatAxios merged commit eedaf36 into main Sep 27, 2026
1 check passed
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