Skip to content

Commit 1b8a6db

Browse files
author
Anubhav200311
committed
added addToolWarning() for consistent logs
1 parent 17ab201 commit 1b8a6db

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
@@ -248,6 +248,7 @@ func (a *Agent) collectTools(ctx context.Context) ([]tools.Tool, error) {
248248
if _, exists := seen[t.Name]; exists {
249249
slog.Warn("Duplicate tool name; keeping first occurrence",
250250
"agent", a.Name(), "tool", t.Name)
251+
a.addToolWarning(fmt.Sprintf("duplicate tool %q: keeping first occurrence", t.Name))
251252
continue
252253
}
253254
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)