From 8dbba3c0badbb4af71e2a24b1cc148abf4b57c12 Mon Sep 17 00:00:00 2001 From: JingHao-Leon <102573344+JingHao-Leon@users.noreply.github.com> Date: Sun, 11 Oct 2026 18:52:28 +0800 Subject: [PATCH] Document why reasoning_content keeps its existing meaning The reasoning_items accumulator now carries every item, while reasoning_content still holds the summary text of the most recent one. That is intentional: widening reasoning_content would change what every existing consumer of that field sees, which is a separate change from the reported bug (#43620, items being overwritten). Recorded at the accumulation site so the asymmetry reads as a decision rather than an oversight. --- .../litellm_responses_transformation/transformation.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/litellm/completion_extras/litellm_responses_transformation/transformation.py b/litellm/completion_extras/litellm_responses_transformation/transformation.py index ca224735b59..6938a8ddde0 100644 --- a/litellm/completion_extras/litellm_responses_transformation/transformation.py +++ b/litellm/completion_extras/litellm_responses_transformation/transformation.py @@ -883,6 +883,12 @@ class LiteLLMResponsesTransformationHandler(CompletionTransformationBridge): summary_raw=item.summary, ) pending_reasoning_items = (*pending_reasoning_items, built_reasoning_item) + # ``reasoning_content`` deliberately keeps its pre-existing meaning — + # the summary text of the most recent reasoning item — even though + # ``reasoning_items`` now carries all of them. Widening it to join + # every item's summary would change what every existing consumer of + # ``reasoning_content`` sees, which is a different fix from "stop + # dropping reasoning items" and belongs in its own change. reasoning_content = " ".join(s["text"] for s in built_reasoning_item["summary"] if s.get("text")) elif isinstance(item, ResponseOutputMessage):