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.
This commit is contained in:
wizardchen
2025-11-12 14:27:48 +08:00
parent 38beca1146
commit a342a0aa14
-2
View File
@@ -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)