From 699bfcd026d2e80afa55bba51469b4be02404593 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Fri, 28 Aug 2026 12:24:21 +0530 Subject: [PATCH] perf: skip dict copy for non-compression auxiliary calls _compression_fast_lane_controls unconditionally did body = dict(extra_body) before the early-return guard. Move the copy below the guard so non- compression auxiliary calls (vision, title_generation, etc.) return the original extra_body reference without a shallow copy. --- agent/auxiliary_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/auxiliary_client.py b/agent/auxiliary_client.py index 3db92095cb..9c0eedcad5 100644 --- a/agent/auxiliary_client.py +++ b/agent/auxiliary_client.py @@ -8531,9 +8531,9 @@ def _compression_fast_lane_controls( extra_body: Dict[str, Any], ) -> tuple[int | None, Dict[str, Any]]: """Apply the certified compression controls to one resolved route.""" - body = dict(extra_body) if task != "compression" or max_tokens is not None: - return max_tokens, body + return max_tokens, extra_body + body = dict(extra_body) lane = resolve_compression_fast_lane( actual_provider, actual_model,