From fba6110cde4cae465c083f816bf1524c869c2a1c Mon Sep 17 00:00:00 2001 From: Konstantin Khlopkov <47825603+kokhlo@users.noreply.github.com> Date: Sun, 30 Aug 2026 12:43:26 +0300 Subject: [PATCH] fix(agent): default relay completions to the progress-hook wrapper --- agent/auxiliary_client.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/agent/auxiliary_client.py b/agent/auxiliary_client.py index 9f77e631a1..fd14e8ef53 100644 --- a/agent/auxiliary_client.py +++ b/agent/auxiliary_client.py @@ -2443,7 +2443,12 @@ def _relay_sync_completion( from agent.auxiliary_wire import prepare_chat_messages kwargs = prepare_chat_messages(client, kwargs) - callback = create or (lambda request: client.chat.completions.create(**request)) + # The progress hook is installed per task, so every attempt for that + # task must go through _create_with_progress — including auxiliary + # retries and provider fallbacks. Defaulting at this seam covers every + # call site that predates the hook or forgets to thread create= through + # (18 of 24 today); call sites that pass their own create= keep it. + callback = create or (lambda request: _create_with_progress(client, request)) route = _relay_auxiliary_metadata(provider=provider, api_mode=api_mode) # Isolate only the provider callback so the owning thread can unwind its lease/DB # transaction on hard cancel without touching the shared client.