Repository navigation
fix(llm): treat early stream close as a drop in codex and codeassist; no Map-index panic - #496
Merged
Merged
Conversation
… no Map-index panic - codex and codeassist took a stream that closed before its finish (`response.completed` / a `finishReason`) as a whole answer: a reply cut short was kept, and a function call still in flight (codex only emits it on `output_item.done`) was dropped without a word. Both now raise the retryable "unexpected EOF" the anthropic and chat parsers already raise. Code Assist still accepts a finishReason without the usage chunk. - anthropic indexed a serde_json::Map for `usage` and `stop_reason`, which panics on a missing key, inside stream polling. A proxy that leaves them out now reads as zero / no stop reason. Co-Authored-By: Claude Opus 5.5 <[email protected]>
mrnasil
enabled auto-merge (squash)
November 25, 2026 15:32
Merged
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.
Early EOF. codex and codeassist treated a stream that closed before its finish event (
response.completed, or afinishReason) as a complete answer. A reply cut short was kept, and a function call still in flight was dropped silently; codex only emits a call onoutput_item.done. Both now raise the retryableunexpected EOFerror that the anthropic and chat-completions parsers already raise (#393). Code Assist still accepts a stream that has afinishReasonbut no usage chunk.Panic. anthropic indexed a
serde_json::Mapforusageandstop_reason.Mapindexing panics on a missing key, and this ran inside stream polling. An Anthropic-compatible proxy that omits those keys now reads as zero usage and no stop reason. Indexing goes throughValue, as in the rest of the parser.Tests:
completewithoutresponse.completederrors, and with it assembles the text and the tool call;message_startwithoutusageand an emptydeltaparse without panicking.Three lines that were uncovered on main in these files are now covered.
🤖 Generated with Claude Code