Repository navigation
fix(stream): accept text-only clean EOF - #165
Open
honglihuang wants to merge 1 commit into
Open
honglihuang wants to merge 1 commit into
honglihuang wants to merge 1 commit into
Conversation
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.
Summary
Accept successful Kiro streams that end at a clean AWS EventStream frame boundary after assistant text, even when the upstream omits
metadataEvent.stopReason.Without this change, Kiro-Go emits
response.failedafter already streaming the full answer. Codex then replays the same request up to five times, producing duplicate full answers before ending with:Root cause
Some healthy Kiro IDC/CLI paths finish with complete assistant frames and a clean HTTP EOF but no explicit stop reason.
classifyStreamIntegritytreated every such text response as truncated, even though malformed or actually partial frames are already detected earlier by the EventStream parser.Changes
end_turnonly after parsing reaches clean EOF successfully.stopReason,stop_reason,finishReason, andfinish_reasonfields.Live reproduction and verification
Verified against an affected local Codex setup using
wire_api = "responses", modelgpt-5.6-terra, Kiro-Go/v1/responses, and an IDC account.Before:
After:
The repeated Codex reconnects stopped in normal use.
Validation:
All passed. The explicit package list avoids descending into a locally installed
go/toolchain directory; that directory is not part of the patch.Relationship to existing work
This overlaps #161. The implementation keeps the original author attribution from that PR and this submission adds independent live validation from an affected Codex + Kiro environment. If maintainers prefer, this report can be treated as confirmation for #161 and one of the duplicate PRs can be closed.