From 635bec06cbb22cae75fb5fffbe7729861dd0e719 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Mon, 16 Feb 2026 00:55:18 -0800 Subject: [PATCH] Update tool definitions handling in GatewayRunner - Modified the retrieval of tool definitions to use the agent result's "tools" key, ensuring accurate logging in the transcript. - Enhanced the response structure to include tools in the final output, improving the clarity of tool usage in session interactions. --- gateway/run.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gateway/run.py b/gateway/run.py index 10f54cd7..15daca26 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -450,7 +450,7 @@ class GatewayRunner: # definitions as the first entry so the transcript is self-describing # -- the same list of dicts sent as tools=[...] in the API request. if not history: - tool_defs = tools_holder[0] + tool_defs = agent_result.get("tools", []) self.session_store.append_to_transcript( session_entry.session_id, { @@ -896,6 +896,7 @@ class GatewayRunner: "final_response": error_msg, "messages": result.get("messages", []), "api_calls": result.get("api_calls", 0), + "tools": tools_holder[0] or [], } # Scan tool results for MEDIA: tags that need to be delivered @@ -934,6 +935,7 @@ class GatewayRunner: "final_response": final_response, "messages": result_holder[0].get("messages", []) if result_holder[0] else [], "api_calls": result_holder[0].get("api_calls", 0) if result_holder[0] else 0, + "tools": tools_holder[0] or [], } # Start progress message sender if enabled