Skip to content

fix(translator): a truncated non-streaming Responses turn finishes with length for Chat clients - #16507

Merged
diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.52from
pacocartones:fix/responses-incomplete-chat
Oct 15, 2026
Merged

diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.52from
pacocartones:fix/responses-incomplete-chat

Conversation

@pacocartones

Copy link
Copy Markdown
Contributor

Summary

Related Issues

Target Branch

  • Base is the active release/v3.8.x branch (the highest open release/v*), not main
  • New feature? From 3.8.55 on it is held with the v4-feature label for the v4 channel

Validation

  • Change type: other (translator)
  • Focused tests and category gates from the golden path
  • npm run lint (eslint on the changed files: only the toNumber error already on the base, responseTranslator.ts:39)
  • Reconciled with the current active release base; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR

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 gives stop and a function call still gives tool_calls.

Coverage Notes

  • responseTranslator.ts, OPENAI_RESPONSES → OPENAI branch, through translateNonStreamingResponse.

Reviewer Notes

…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.
@diegosouzapw
diegosouzapw merged commit 4d0e879 into cheaper-inference:release/v3.8.52 Oct 15, 2026
29 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants