Repository navigation
fix: inject placeholder message when Responses API input[] is empty - #419
Merged
decolua merged 1 commit intoMar 27, 2026
Merged
Conversation
idbara
pushed a commit
to idbara/9router
that referenced
this pull request
Apr 23, 2026
luckystart79-lang
pushed a commit
to luckystart79-lang/minirouter
that referenced
this pull request
May 2, 2026
caothu159
pushed a commit
to diepxuan/9router
that referenced
this pull request
May 14, 2026
diegosouzapw
added a commit
to diegosouzapw/OmniRoute
that referenced
this pull request
Jun 20, 2026
…] is empty A client (e.g. Fabric-AI) calling POST /v1/responses with `input: []` used to be translated into `messages: []`, which every upstream Chat- Completions provider rejects with `400: at least one message is required` (surfaced to the client as a confusing 406). Mirror the existing empty-string handling: when input[] is empty, inject a single placeholder user message so the request is always valid. Touches `openaiResponsesToOpenAIRequest` only (the same translator that already covers the empty-string case at the top of the function), preserves any caller-supplied `instructions` as a system message, and leaves every non-empty input path byte-identical. Adds a TDD test reproducing the empty input[] case (RED before fix, GREEN after) and updates one pre-existing test that enshrined the broken behavior (`assert.deepEqual(call.body.messages, [])`) to assert the new correct shape. Co-authored-by: anuragg-saxenaa <anuragg.saxenaa@gmail.com> Inspired-by: decolua/9router#419
diegosouzapw
added a commit
to diegosouzapw/OmniRoute
that referenced
this pull request
Jun 20, 2026
…] is empty (#4393) A client (e.g. Fabric-AI) calling POST /v1/responses with `input: []` used to be translated into `messages: []`, which every upstream Chat- Completions provider rejects with `400: at least one message is required` (surfaced to the client as a confusing 406). Mirror the existing empty-string handling: when input[] is empty, inject a single placeholder user message so the request is always valid. Touches `openaiResponsesToOpenAIRequest` only (the same translator that already covers the empty-string case at the top of the function), preserves any caller-supplied `instructions` as a system message, and leaves every non-empty input path byte-identical. Adds a TDD test reproducing the empty input[] case (RED before fix, GREEN after) and updates one pre-existing test that enshrined the broken behavior (`assert.deepEqual(call.body.messages, [])`) to assert the new correct shape. Inspired-by: decolua/9router#419 Co-authored-by: anuragg-saxenaa <anuragg.saxenaa@gmail.com>
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
…] is empty (diegosouzapw#4393) A client (e.g. Fabric-AI) calling POST /v1/responses with `input: []` used to be translated into `messages: []`, which every upstream Chat- Completions provider rejects with `400: at least one message is required` (surfaced to the client as a confusing 406). Mirror the existing empty-string handling: when input[] is empty, inject a single placeholder user message so the request is always valid. Touches `openaiResponsesToOpenAIRequest` only (the same translator that already covers the empty-string case at the top of the function), preserves any caller-supplied `instructions` as a system message, and leaves every non-empty input path byte-identical. Adds a TDD test reproducing the empty input[] case (RED before fix, GREEN after) and updates one pre-existing test that enshrined the broken behavior (`assert.deepEqual(call.body.messages, [])`) to assert the new correct shape. Inspired-by: decolua/9router#419 Co-authored-by: anuragg-saxenaa <anuragg.saxenaa@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.
Closes #389\n\n## Problem\nWhen a client (e.g. Fabric-AI) calls POST /v1/responses with an empty input:[] array, normalizeResponsesInput returned the empty array unchanged. The translator then produced messages:[] which upstream providers reject with:\n400: messages: at least one message is required\n9router surfaced this as a 406.\n\n## Fix\nIn normalizeResponsesInput, treat input:[] the same as input:"" — inject a placeholder user message so the request is always valid.\n\n## Files changed\n- open-sse/translator/helpers/responsesApiHelper.js — 1 guard added