fix(translator): strip Responses-only truncation field before Chat Completions forwarding - #6109
Merged
diegosouzapw merged 3 commits intoJul 4, 2026
Merged
Conversation
…ons (port from 9router#2311)
The Responses→Chat-Completions converter spreads the request body and deletes
known Responses-API-only fields (client_metadata, background, safety_identifier),
but `truncation` ("auto"/"disabled") slipped through. Strict non-OpenAI upstreams
(e.g. NVIDIA NIM) reject it with HTTP 400 "Unsupported parameter(s): truncation",
breaking Codex-style clients routed to those providers.
Reported-by: TuanNguyen0708 (decolua/9router#2311)
Co-authored-by: Rex <177378174+anki1kr@users.noreply.github.com>
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…ssue-2311-strip-truncation
… keep only the truncation entry
4 tasks done
Merged
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
…mpletions forwarding (diegosouzapw#6109) Strip Responses-only truncation field before Chat Completions forwarding (diegosouzapw#2311). Integrated into release/v3.8.44.
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
open-sse/translator/request/openai-responses.ts) now strips the Responses-API-onlytruncationfield before forwarding.client_metadata,background, andsafety_identifierwere already stripped;truncation("auto"/"disabled") was the remaining gap.Root cause
openaiResponsesToOpenAIRequestbuildsresult = { ...body }, then deletes known Responses-only fields.truncationwas never deleted, so it survived into the outgoing Chat Completions payload. Strict non-OpenAI upstreams (e.g. NVIDIA NIM) reject unknown params:{ "message": "Validation: Unsupported parameter(s): `truncation`", "type": "Bad Request", "code": 400 }This broke Codex-style clients (which send
truncation) routed through a combo to such providers.Fix
Add
delete result.truncation;alongside the existing Responses-only field cleanup, with a comment documenting why.Attribution
Thanks to @TuanNguyen0708 for the original report.
Test plan
tests/unit/responses-strip-truncation-2311.test.ts(red before the fix, green after): assertstruncation— and the full Responses-only set — is stripped.node --teston the translator suites: 43/43 green (no regression).npm run lint(touched files): 0 errors.npm run typecheck:core: clean.npm run check:cycles: no cycles.