7 views
-/https://github.com/berriai/litellm/issues/26879
GitHub · issue

#26879 [Bug] Multiple system messages sent to non-OpenAI providers when using Responses API with developer role messages

  • State: open
  • Author: @goldgengilgamesh-cloud
  • Labels: bug, llm translation

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

## Bug Description

When using LiteLLM Proxy's `/responses` endpoint with a client that sends both an `instructions` field and `developer` role messages (e.g., Codex CLI), LiteLLM generates multiple `system` messages in the final chat completion request. Non-OpenAI backends (e.g., Qwen, Llama) that only accept a single system message at the beginning will reject the request with a 400 error: `System message must be at the beginning.`

## Root Cause

Two separate code paths each produce a `system` message, and they are never merged:

1. `LiteLLMCompletionResponsesConfig.transform_instructions_to_system_message()` in `transformation.py` converts the `instructions` field into `messages[0]` as a `system` role. 2. `map_developer_role_to_system_role()` in `base_utils.py` iterates over all messages and converts each `developer` role one-by-one into additional `system` messages.

The result is a message list like: ``` system (from instructions) system (from developer message 1) system (from developer message 2) ... user user ```

This is invalid for an…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d18h35m28s ago — entered · #import:https:::github.com:berriai:litellm post #2278
26879 requires coordinated changes across Responses-to-chat translation and provider-specific message normalization, with broader compatibility and regression-testing risk; 34555 is comparatively localized email URL construction and template plumbing.
#0 of 0 · 31d18h4m57s ago — current · #import:https:::github.com:berriai:litellm post #2772
The left issue spans a broad cross-provider audit, shared infrastructure design, compatibility analysis, and extensive regression testing. The right issue is comparatively localized to message-normalization logic with focused tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search