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:
@@ -182,7 +182,6 @@ func (e *AgentEngine) executeLoop(
|
|||||||
Done: true,
|
Done: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
step.Duration = time.Since(roundStart).Milliseconds()
|
|
||||||
logger.Infof(ctx, "[Agent][Round-%d] Duration: %dms", state.CurrentRound+1, time.Since(roundStart).Milliseconds())
|
logger.Infof(ctx, "[Agent][Round-%d] Duration: %dms", state.CurrentRound+1, time.Since(roundStart).Milliseconds())
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -333,7 +332,6 @@ func (e *AgentEngine) executeLoop(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
step.Duration = time.Since(roundStart).Milliseconds()
|
|
||||||
state.RoundSteps = append(state.RoundSteps, step)
|
state.RoundSteps = append(state.RoundSteps, step)
|
||||||
// 4. Observe: Add tool results to messages and write to context
|
// 4. Observe: Add tool results to messages and write to context
|
||||||
messages = e.appendToolResults(ctx, messages, step)
|
messages = e.appendToolResults(ctx, messages, step)
|
||||||
|
|||||||
Reference in New Issue
Block a user