From a342a0aa14d81ac5c4335f2d13b9b94c1c365b80 Mon Sep 17 00:00:00 2001 From: wizardchen Date: Wed, 12 Nov 2025 14:27:48 +0800 Subject: [PATCH] fix: Remove redundant duration assignment in agent execution loop - Eliminated duplicate assignment of step.Duration in the executeLoop method to streamline duration tracking. - Ensured accurate logging of round duration without affecting overall functionality. --- internal/agent/engine.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/agent/engine.go b/internal/agent/engine.go index c9eb61fe..5969917c 100644 --- a/internal/agent/engine.go +++ b/internal/agent/engine.go @@ -182,7 +182,6 @@ func (e *AgentEngine) executeLoop( Done: true, }, }) - step.Duration = time.Since(roundStart).Milliseconds() logger.Infof(ctx, "[Agent][Round-%d] Duration: %dms", state.CurrentRound+1, time.Since(roundStart).Milliseconds()) break } @@ -333,7 +332,6 @@ func (e *AgentEngine) executeLoop( } } - step.Duration = time.Since(roundStart).Milliseconds() state.RoundSteps = append(state.RoundSteps, step) // 4. Observe: Add tool results to messages and write to context messages = e.appendToolResults(ctx, messages, step)