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:
+2
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user