Skip to content

Commit 0736dd0

Browse files
committed
Remove duplication
Signed-off-by: David Gageot <david.gageot@docker.com>
1 parent 4bd3ade commit 0736dd0

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

cmd/root/run.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,17 +361,18 @@ func runWithoutTUI(ctx context.Context, agentFilename string, rt runtime.Runtime
361361
llmIsTyping := false
362362
var lastConfirmedToolCallID string
363363
for event := range rt.RunStream(loopCtx, sess) {
364-
if event.GetAgentName() != "" && (firstLoop || lastAgent != event.GetAgentName()) {
364+
agentName := event.GetAgentName()
365+
if agentName != "" && (firstLoop || lastAgent != agentName) {
365366
if !firstLoop {
366367
if llmIsTyping {
367368
fmt.Println()
368369
llmIsTyping = false
369370
}
370371
fmt.Println()
371372
}
372-
printAgentName(event.GetAgentName())
373+
printAgentName(agentName)
373374
firstLoop = false
374-
lastAgent = event.GetAgentName()
375+
lastAgent = agentName
375376
}
376377
switch e := event.(type) {
377378
case *runtime.AgentChoiceEvent:

0 commit comments

Comments
 (0)