fix(headroom): check the responses converted-stream flag on the agentic kwargs dict

This commit is contained in:
mateo-berri 2026-08-29 14:41:08 -07:00
parent ef96af5121
commit 201ada9982

View file

@ -2921,6 +2921,7 @@ class BaseLLMHTTPHandler:
logging_obj=logging_obj,
)
agentic_kwargs: Final = dict(litellm_params)
final_response: Final = await self._call_agentic_completion_hooks(
response=initial_response,
model=model,
@ -2930,12 +2931,12 @@ class BaseLLMHTTPHandler:
logging_obj=logging_obj,
stream=False,
custom_llm_provider=custom_llm_provider,
kwargs=dict(litellm_params),
kwargs=agentic_kwargs,
api_surface="responses",
)
result: Final = final_response if final_response is not None else initial_response
if converted_stream_requested(litellm_params) and not litellm_params.get("_agentic_loop_depth"):
if converted_stream_requested(agentic_kwargs) and not agentic_kwargs.get("_agentic_loop_depth"):
return self._wrap_responses_response_as_fake_stream(
result=result,
model=model,