From 455a56856feea2b6cc1e9dc0e7caf0f922d0e94f Mon Sep 17 00:00:00 2001 From: busya Date: Wed, 19 Aug 2026 20:14:50 +0300 Subject: [PATCH] fix(agent): report THREAD_REPAIRED as lifecycle error code The send-path repair branch set _request_result but not _request_error_code, so the AGENT_REQUEST_FAILED lifecycle event fell back to the misleading 'agent lifecycle failure'. Set THREAD_REPAIRED so logs and middleware show the real outcome. --- agent/src/ss_tools/agent/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/agent/src/ss_tools/agent/app.py b/agent/src/ss_tools/agent/app.py index d0c035c7d..e499bff10 100644 --- a/agent/src/ss_tools/agent/app.py +++ b/agent/src/ss_tools/agent/app.py @@ -1081,6 +1081,7 @@ async def agent_handler( # noqa: C901 — intentionally complex C4 orchestratio extra={"src": "AgentChat.GradioApp.Handler"}, ) _request_result = "failed" + _request_error_code = "THREAD_REPAIRED" yield json.dumps( { "content": "⚠️ Предыдущий запуск был прерван. Поток восстановлен — отправьте запрос ещё раз.",