Skip to content

fix: Responses-API ordered blocks + fallback-branch coverage (follow-up to #380) - #382

Merged
jpr5 merged 2 commits into
mainfrom
cr/pr-380-fixes
Aug 19, 2026
Merged

fix: Responses-API ordered blocks + fallback-branch coverage (follow-up to #380)#382
jpr5 merged 2 commits into
mainfrom
cr/pr-380-fixes

Conversation

@jpr5

@jpr5 jpr5 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #380: fixes two CR findings on that PR.

A1 (correctness): collapseOpenAISSE's Responses-API response.output_text.delta handler only did content += parsed.delta and never pushed a text order-atom, so buildOrderedBlocks returned undefined for any Responses stream — a tool-first Responses stream (function_call before output_text) collapsed to a fixture with no blocks, silently losing tool-before-text ordering on replay (the Responses replay path consumes blocks). Fix: push orderAtoms.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-fixes was pushed directly (no separate local patch series); this PR opens it against main for 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.

@pkg-pr-new

pkg-pr-new Bot commented Aug 18, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@copilotkit/aimock@382

commit: 851241a

@jpr5
jpr5 force-pushed the cr/pr-380-fixes branch from ef19e49 to 851241a Compare August 18, 2026 19:45
@contextablemark
contextablemark marked this pull request as ready for review August 18, 2026 20:08

@contextablemark contextablemark 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.

approved

@contextablemark contextablemark 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.

Approved

@contextablemark contextablemark 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.

Approved

@jpr5
jpr5 merged commit ecb6efa into main Aug 19, 2026
23 checks passed
@jpr5
jpr5 deleted the cr/pr-380-fixes branch August 19, 2026 02:26
@jpr5 jpr5 mentioned this pull request Aug 19, 2026
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.
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.

2 participants