Skip to content

Commit 64892a8

Browse files
author
Anubhav200311
committed
added addToolWarning() for consistent logs
1 parent 5095820 commit 64892a8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pkg/agent/agent.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ func (a *Agent) Tools(ctx context.Context) ([]tools.Tool, error) {
236236
if _, exists := seen[t.Name]; exists {
237237
slog.Warn("Duplicate tool name; keeping first occurrence",
238238
"agent", a.Name(), "tool", t.Name)
239+
a.addToolWarning(fmt.Sprintf("duplicate tool %q: keeping first occurrence", t.Name))
239240
continue
240241
}
241242
seen[t.Name] = struct{}{}

pkg/agent/agent_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func TestAgentTools(t *testing.T) {
8888
}, nil),
8989
},
9090
wantToolCount: 3,
91-
wantWarnings: 0,
91+
wantWarnings: 1,
9292
},
9393
}
9494

0 commit comments

Comments
 (0)