fix: Responses-API ordered blocks + fallback-branch coverage (follow-up to #380) - #382
Merged
Conversation
commit: |
So tool-first streams keep ordered blocks.
contextablemark
marked this pull request as ready for review
August 18, 2026 20:08
jpr5
added a commit
that referenced
this pull request
Aug 19, 2026
Merged
contextablemark
added a commit
that referenced
this pull request
Aug 19, 2026
Release cut for v1.39.0. No source changes. - Bumps root `package.json` version 1.38.0 → 1.39.0. - Converts the merged `[Unreleased]` material into a dated `## [1.39.0] - 2026-08-18` entry and opens a fresh empty `[Unreleased]`. All entries preserved in order (Added / Changed / Deprecated / Fixed), covering #382, #380, #378, #374, and the reset-canonicalization work (#358). Follow-up (not in this PR): `packages/aimock-pytest/src/aimock_pytest/_version.py` still pins `AIMOCK_VERSION = "1.38.0"`; bump it on the aimock-pytest release cadence per the changelog note.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #380: fixes two CR findings on that PR.
A1 (correctness):
collapseOpenAISSE's Responses-APIresponse.output_text.deltahandler only didcontent += parsed.deltaand never pushed a text order-atom, sobuildOrderedBlocksreturned undefined for any Responses stream — a tool-first Responses stream (function_callbeforeoutput_text) collapsed to a fixture with noblocks, silently losing tool-before-text ordering on replay (the Responses replay path consumesblocks). Fix: pushorderAtoms.push({ kind: "text", text: parsed.delta })for non-empty deltas, mirroring the Chat-Completions path. +1 red-green test.A2 (coverage): +8 regression tests for #380's fallback branches (output_item.done backfill/create/adopt, delta-less done, double-append guards, no-call_id case). No source change. Each verified genuine by neutralizing the branch and confirming the test fails.
Net diff vs e152680:
src/stream-collapse.ts+3,src/__tests__/stream-collapse.test.ts+372.Branch
cr/pr-380-fixeswas pushed directly (no separate local patch series); this PR opens it againstmainfor CI + review.Outstanding: per the CR ledger this escalated Tier1→Tier2 on the A1 correctness finding; a full confirmation round against this post-fix diff is still required before merge — convergence is NOT yet declared.