From 1cf1a97b731f99b9276d299bf5c7fc0487802b52 Mon Sep 17 00:00:00 2001 From: shivam Date: Thu, 27 Aug 2026 22:37:08 +0000 Subject: [PATCH] chore: annotate headroom pre-call hook dict for the type-discipline budget Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../proxy/guardrails/guardrail_hooks/headroom/headroom.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/headroom/headroom.py b/litellm/proxy/guardrails/guardrail_hooks/headroom/headroom.py index e4fe392b97f..2b34c0eeccb 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/headroom/headroom.py +++ b/litellm/proxy/guardrails/guardrail_hooks/headroom/headroom.py @@ -728,7 +728,11 @@ class HeadroomGuardrail(CustomGuardrail): return None if not has_headroom_retrieve_tool(kwargs.get("tools")): return None - return {**kwargs, "stream": False, HEADROOM_CONVERTED_STREAM_KEY: True} + return { # mutable-ok: the hook contract is a plain dict the router merges into the request kwargs + **kwargs, + "stream": False, + HEADROOM_CONVERTED_STREAM_KEY: True, + } async def async_should_run_agentic_loop( self,