Repository navigation
fix(translator): a truncated non-streaming Responses turn finishes with length for Chat clients - #16507
Merged
diegosouzapw merged 2 commits intoOct 15, 2026
Conversation
…th length for Chat clients The non-streaming Responses to Chat translation only knew tool_calls and stop, so a response that ended incomplete on max_output_tokens or on the content filter reached a Chat client as a clean stop. Use the streaming path's rule (cheaper-inference#15867) so both give length or content_filter.
Merged
6 of 7 tasks
diegosouzapw
merged commit Oct 15, 2026
4d0e879
into
cheaper-inference:release/v3.8.52
29 of 51 checks passed
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
finish_reasonwas only evertool_callsorstop. A response that endedincompleteonmax_output_tokensorcontent_filterreached the client as a cleanstop.computeFinishReason, the rule the streaming path got in fix(sse): map Responses response.incomplete to length/content_filter finish reasons (#15489) #15867, so it giveslengthorcontent_filter.Related Issues
Target Branch
release/v3.8.xbranch (the highest openrelease/v*), notmainv4-featurelabel for the v4 channelValidation
npm run lint(eslint on the changed files: only thetoNumbererror already on the base, responseTranslator.ts:39)Tests Added Or Updated
tests/unit/responses-incomplete-nonstreaming-chat.test.ts(new): 4 tests. 2 fail on the base and all 4 pass with the fix. The two that already pass check that a completed response still givesstopand a function call still givestool_calls.Coverage Notes
responseTranslator.ts, OPENAI_RESPONSES → OPENAI branch, throughtranslateNonStreamingResponse.Reviewer Notes