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.
This commit is contained in:
@@ -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": "⚠️ Предыдущий запуск был прерван. Поток восстановлен — отправьте запрос ещё раз.",
|
||||
|
||||
Reference in New Issue
Block a user