Skip to content

[Refactor] Batch roll out stream helpers to OpenAI-family specs - #1091

Merged
edelauna merged 1 commit into
mainfrom
refactor/openai-family-stream-test-utils-06q4nypl2c73c
Aug 1, 2026
Merged

[Refactor] Batch roll out stream helpers to OpenAI-family specs#1091
edelauna merged 1 commit into
mainfrom
refactor/openai-family-stream-test-utils-06q4nypl2c73c

Conversation

@zoomote

@zoomote zoomote Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Created by Roomote. Follow up by mentioning @roomote, in the web UI, or in Discord.

What changed

  • Batched the shared stream-helper rollout across four OpenAI-family provider specs: openrouter, openai-codex, openai-native-tools, and openai-codex-native-tool-calls.
  • Replaced pure async-iterator mock streams with asyncStreamFrom and pure collect/drain loops with collectStream, including local helper reimplementations where those helpers were just duplicating the shared pattern.
  • Left side-effect generator loops inline where the loop itself drives NativeToolCallParser state.
  • Reduced ESLint suppression counts only where the refactor removed explicit-any violations.

Why this change was made

This is the more ambitious continuation of the approved test-utils rollout: a cohesive multi-file batch instead of another single-spec migration, with the same rule that helpers only remove mechanical stream setup and collection.

Impact

No user-facing behavior change. Four provider specs now share the same stream-helper idiom, targeted batch tests passed, src lint/typecheck passed, and the full Zoo-Code test suite passed.

Related PRs

@zoomote

zoomote Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

1 issue outstanding. See task

  • src/api/providers/__tests__/openai-codex-native-tool-calls.spec.ts:47 — The refactor dropped the comment noting that the response.function_call_arguments.delta fixture intentionally omits call_id + name to simulate tool-call-only streams. Without it, a future reader may "fix" the fixture and silently weaken the test; consider restoring the note.

Reviewed 1877e2b

@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@edelauna
edelauna marked this pull request as ready for review August 1, 2026 15:44
@edelauna
edelauna enabled auto-merge August 1, 2026 15:44
@edelauna
edelauna added this pull request to the merge queue Aug 1, 2026
@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Aug 1, 2026
Merged via the queue into main with commit 49c1bec Aug 1, 2026
24 checks passed
@edelauna
edelauna deleted the refactor/openai-family-stream-test-utils-06q4nypl2c73c branch August 1, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR changes are ready and waiting for maintainer re-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants