fix: reject incomplete Messages tool-loop streams - #345
Draft
franciscojavierarceo wants to merge 1 commit into
Draft
franciscojavierarceo wants to merge 1 commit into
franciscojavierarceo wants to merge 1 commit into
Conversation
Signed-off-by: Francisco Javier Arceo <arceofrancisco@gmail.com>
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
Require an upstream
message_stopbefore a Messages built-in tool round can dispatch calls or finish successfully. Previously, EOF afterstop_reason: tool_usecould execute a tool, and truncated text rounds received a synthetic successful completion. The existing accumulator now emits an Anthropic SSEapi_errorwithout terminalmessage_deltaormessage_stopwhen the upstream ends early, including via[DONE].Part of #313 and Enterprise Readiness #316. This is the completion gate only: full content-block lifecycle validation, aggregate retained-data budgets, and bounded tool scheduling remain open. Valid
message_stopstill ends a round without waiting for HTTP EOF; named-tool compatibility, pass-through requests, and upstream error forwarding retain their behavior.Test Plan
[DONE], empty bodies, and an incomplete round after successful tool execution. Assertions count actual search calls and upstream requests.