Repository navigation
Conversation
Set content_index=0 on the single-part text and marker lifecycles and legacy stream-error completions. Retain the source content index when proxy and plugin filters flush pending text, including plugin retry reframing. This prevents official SDK consumers from rejecting valid answers such as text ending in a buffered "m" as a missing content part. Record WC-026, enforce it in the matching fake and exercise actual OpenAI SDK consumption. The unchanged production fails ten focused regressions with ten controls passing; the fixed relevant suites pass all 193 tests. Typecheck, build, unused-export and test-import-graph gates also pass.
This was referenced Nov 21, 2026
Owner
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.
Fixes #7401
Problem
Responses text events are addressed by both
output_indexandcontent_index. Several synthesized frames retain the item address but omit the part address, causing the official OpenAI Node SDK to throwmissing content at index undefined.This affects generated text/ACP markers, legacy stream-error completions, and filtered text tails in both proxy and plugin modes. An ordinary answer ending in
Length: 10 mreproduces it: the finalmis buffered, then flushed in a newly constructed delta that loses its content index.Change
content_index: 0on the four content/text lifecycle frames for messages containing one generated text part.The fix retains the existing text/filtering policy, item/output remapping and protocol-native error default. Source part indices are preserved without guessing a replacement for malformed upstream frames.
Validation
Tested base:
1e357bf2d6632bfbd2a74ffb70ecee1af1ec7cc3.responses-content-index,proxy-stream-error,wire-contract,loop-adapters,tag-echo,plugin-passthrough-tag-strip, andplugin-empty-turn-retry.npm run typecheck,npm run build,npm run check:unused-exports,npm run check:test-import-graph, andgit diff --checkpass.The consumer contract is visible in OpenAI's ResponseStream v6.26.0. No dependency or golden snapshot changes are needed.
Related history
All-author/all-state duplicate screening found no equivalent change. #2691 repaired the Anthropic legacy lifecycle, #1464 introduced the native error policy, and #5057 handles a different preflight failure body.