8 views
-/https://github.com/berriai/litellm/issues/23757
GitHub · issue

#23757 [Bug]: TypeError: can only concatenate list (not "str") to list in map_system_message_pt when routing Anthropic-format messages to ChatGPT provider

  • State: open
  • Author: @iamjjanga-ouo
  • Labels: bug, proxy, llm translation, claude code

### 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 the Anthropic pass-through endpoint (/v1/messages) to route requests to a chatgpt/* model with supports_system_message: false, map_system_message_pt crashes with a TypeError because it assumes message content is always a str, but the Anthropic adapter passes content as a list of content blocks.

## Environment

- LiteLLM version: v1.82.0 - Docker image tag: main-v1.82.0-stable.patch5 (litellm-database, deployed via Helm) - Python: 3.13 - Client: Claude Code (sends requests via Anthropic /v1/messages format) - Provider: chatgpt/gpt-5.4

## Error ``` File "/usr/lib/python3.13/site-packages/litellm/litellm_core_utils/prompt_templates/factory.py", line 110, in map_system_message_pt next_m["content"] = m["content"] + " " + next_m["content"] ~~~~~~~~~~~~~^~~~~ TypeError: can only concatenate list (not "str") to list ``` ## Root Cause

In litellm/litellm_core_utils/prompt_templates/factory.py line 110:

next_m["content"] = m["content"] + " " + next_m["content"]

This line assu…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d17h53m31s ago — entered · #import:https:::github.com:berriai:litellm post #3076
Issue #30081 is harder because it spans shared pricing-state ownership, reload behavior, deployment registration, request-time cost resolution, and administrative flows, with higher regression and compatibility risk. Issue #23757 is comparatively localized to robust content-shape handling in a prompt transformation path plus focused regression tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search