🔴 Required Information
Describe the Bug:
In the LiteLLM adapter model, reasoning parts are combined with a newline injection (_NEW_LINE.join(text for text in reasoning_texts if text)). When using models/providers that stream reasoning in delta fragments (such as vLLM-style reasoning chunks), this mutates the original stream by inserting extra newline separators between the chunks. Consequently, the reconstructed reasoning differs from the exact output returned by the provider.
Steps to Reproduce:
Please provide a numbered list of steps to reproduce the behavior:
- Initialize an ADK Agent using the
LiteLlm adapter.
- Connect to a model that generates streamed reasoning in delta fragments (eg. vllm deployed model with qwen).
- Execute a turn and inspect the streamed reasoning chunks and the final generated reasoning message.
- Observe that the reasoning string contains unexpected extra newlines that were not present in the native chunks.
Expected Behavior:
The reasoning text should be preserved exactly as streamed by concatenating fragments directly (i.e. "".join(...)), without artificially adding newlines, so that the stream represents the provider's native output precisely.
Observed Behavior:
Refer to PR #4952 implementation and the proposed fix addressing this issue.
Environment Details:
- ADK Library Version (pip show google-adk): latest
- Desktop OS: macOS
- Python Version (python -V): Python 3.11+
Model Information:
- Are you using LiteLLM: Yes
- Which model is being used: Any model streaming reasoning with vllm (e.g. qwen3.5)
🔴 Required Information
Describe the Bug:
In the LiteLLM adapter model, reasoning parts are combined with a newline injection (
_NEW_LINE.join(text for text in reasoning_texts if text)). When using models/providers that stream reasoning in delta fragments (such as vLLM-style reasoning chunks), this mutates the original stream by inserting extra newline separators between the chunks. Consequently, the reconstructed reasoning differs from the exact output returned by the provider.Steps to Reproduce:
Please provide a numbered list of steps to reproduce the behavior:
LiteLlmadapter.Expected Behavior:
The reasoning text should be preserved exactly as streamed by concatenating fragments directly (i.e.
"".join(...)), without artificially adding newlines, so that the stream represents the provider's native output precisely.Observed Behavior:
Refer to PR #4952 implementation and the proposed fix addressing this issue.
Environment Details:
Model Information: