From 12f0c4a6cf84b110f3bffe67a31302250d5618ed Mon Sep 17 00:00:00 2001 From: tpkeeper Date: Thu, 19 Feb 2026 19:06:09 +0800 Subject: [PATCH] fix: ensure tool name is correctly assigned in LLM iteration(missing tool call name in debug mode logs) (#454) * fix: ensure tool name is correctly assigned in LLM iteration * fix: ensure tool name is correctly included in assistant message --- pkg/agent/loop.go | 1 + pkg/tools/toolloop.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/agent/loop.go b/pkg/agent/loop.go index ed69712ff..6d0a61375 100644 --- a/pkg/agent/loop.go +++ b/pkg/agent/loop.go @@ -602,6 +602,7 @@ func (al *AgentLoop) runLLMIteration(ctx context.Context, agent *AgentInstance, Name: tc.Name, Arguments: string(argumentsJSON), }, + Name: tc.Name, }) } messages = append(messages, assistantMsg) diff --git a/pkg/tools/toolloop.go b/pkg/tools/toolloop.go index 1302079b4..b07b14adb 100644 --- a/pkg/tools/toolloop.go +++ b/pkg/tools/toolloop.go @@ -109,6 +109,7 @@ func RunToolLoop(ctx context.Context, config ToolLoopConfig, messages []provider Name: tc.Name, Arguments: string(argumentsJSON), }, + Name: tc.Name, }) } messages = append(messages, assistantMsg)