fix: drop redundant None-guard on agent_result in agent:end payload

agent_result is guaranteed non-None at this point — line 17926 calls
.get() on it unconditionally, and line 18099 in the same block does
the same without the guard. The if/else was dead defensive code
inconsistent with surrounding access patterns.
This commit is contained in:
kshitij
2026-08-08 14:01:18 +05:30
parent ff7af1cbaf
commit 063f6941e5
+2 -2
View File
@@ -18112,8 +18112,8 @@ class GatewayRunner(GatewayAuthorizationMixin, GatewayKanbanWatchersMixin, Gatew
await self.hooks.emit("agent:end", {
**hook_ctx,
"response": (response or "")[:500],
"model": agent_result.get("model", "") if agent_result else "",
"provider": agent_result.get("provider", "") if agent_result else "",
"model": agent_result.get("model", ""),
"provider": agent_result.get("provider", ""),
})
# Check for pending process watchers (check_interval on background processes)