Repository navigation
Reject model streams that end before completing their turn - #785
Merged
Merged
Conversation
Signed-off-by: dada-yan <BinjunYann@gmail.com>
Signed-off-by: dada-yan <BinjunYann@gmail.com>
WaylandYang
force-pushed
the
land/truncated-model-stream
branch
from
September 19, 2026 07:55
02a73fc to
f01b6c8
Compare
This was referenced Sep 19, 2026
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.
Maya-Kid's #768, rebased onto
devafter #764 turned the streaming buffer into bytes. The conflict was mechanical: keep theVec<u8>buffer, add theirendedandgot.What it does.
chat_tools_stream_withandchat_stream_rawget the completion check that #757 gave only tochat_at_streaming: a frame carryingfinish_reason, ordata: [DONE], marks the turn finished, and reaching EOF without either yieldsInterrupted { got }instead of aTurnor a silent end.Interruptedis already retryable intransient().Reverting their source and keeping their tests shows what the check is for:
Without it the agent receives a tool call whose arguments are the fragment
{"name":and has to work out for itself that the JSON never finished.One consequence worth stating, since the description did not.
api/chat.rsstreamschat_stream_rawand on an error yields an error event and returns beforeconversations::append_message. So a cut stream now shows the reader the partial text followed by an error, and the assistant turn is not saved at all; before, a short turn was saved with a cleandone. Losing half an answer is the right call — half a thing is not a thing anywhere else in this ledger — but it is a decision, not an inheritance.Their branch could not be rebased from here, so this carries their commit with authorship intact and #768 closes with it.
30
utopia-llmtests pass, clippy acrossutopia-llmandutopia-serveris clean, fmt clean.🤖 Generated with Claude Code