Repository navigation
Conversation
…lect (Effect-TS#8181) Co-authored-by: Tim Smart <hello@timsmart.co>
Co-authored-by: Xia Chao <236466140+bun-unsafe@users.noreply.github.com> Co-authored-by: Tim Smart <hello@timsmart.co>
Co-authored-by: Sam Goodwin <sam@alchemy.run>
Co-authored-by: Tim Smart <hello@timsmart.co> Co-authored-by: Maxwell Brown <maxwellbrown1990@gmail.com>
Co-authored-by: Xia Chao <236466140+bun-unsafe@users.noreply.github.com> Co-authored-by: Tim Smart <hello@timsmart.co>
…S#8215) Co-authored-by: Tim Smart <hello@timsmart.co>
Co-authored-by: Tim Smart <hello@timsmart.co>
…ffect-TS#8208) Co-authored-by: xia-chao <xia-chao@users.noreply.github.com> Co-authored-by: Tim Smart <hello@timsmart.co> Co-authored-by: Tim Smart <tim.smart@effectful.co>
…nd prompt titles (Effect-TS#8228) Co-authored-by: Tim Smart <hello@timsmart.co>
fix(bedrock): support text history
fix(bedrock): classify provider failures
fix(openai-compat): accept nullable stream fields
fix(bedrock): map tool names
…at the output limit Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Collaborator
|
Superseded by #1, now merged. That PR includes the fix and regression coverage for complete and partial tool calls at the output limit. |
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.
This PR only adds a failing test. It describes the behavior we want and is expected to stay red until a fix lands. The fix is the maintainer's call.
Behavior
A streamed Chat Completions response can end with
finish_reason: "length"after emitting several tool calls. When that happens, some of those calls may already have complete, valid JSON arguments. Only the last one may be cut off.Currently,
makeStreamResponseskips every tool call when the finish reason islength. It emitstool-params-endfor each call but notool-callpart, so the complete calls are lost along with the cut-off one.The new test streams one complete call and one cut-off call, then ends with
length. It expects:tool-callpart for the complete call, with its decoded paramstool-callpart for the cut-off calllengthThe same situation comes up with any OpenAI-compatible endpoint that streams parallel tool calls, including OpenRouter, Vercel AI Gateway and direct vendor APIs.
Current result
For comparison, the Responses adapter in
@tardie/ai-openaialready tolerates a parse error on a length finish (OpenAiLanguageModel.ts, thetoolParseErrorreset).🤖 Generated with Claude Code