From 98ca0694d6fd7f13adb3a0bc536fe44f0f24272a Mon Sep 17 00:00:00 2001 From: wabrent Date: Thu, 7 May 2026 12:53:59 +0300 Subject: [PATCH] fix(gateway): log agent task failures instead of silently losing usage data --- gateway/platforms/api_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gateway/platforms/api_server.py b/gateway/platforms/api_server.py index 2534cc6bce..3b0375ff03 100644 --- a/gateway/platforms/api_server.py +++ b/gateway/platforms/api_server.py @@ -1326,8 +1326,8 @@ class APIServerAdapter(BasePlatformAdapter): try: result, agent_usage = await agent_task usage = agent_usage or usage - except Exception: - pass + except Exception as exc: + logger.warning("Agent task %s failed, usage data lost: %s", completion_id, exc) # Finish chunk finish_chunk = {