From 406ccf9b878d1d9bd0c9bf8ed3432fe6f156fee3 Mon Sep 17 00:00:00 2001 From: adamdottv <2363879+adamdottv@users.noreply.github.com> Date: Fri, 2 May 2025 13:59:25 -0500 Subject: fix: diagnostics tool init --- internal/llm/agent/tools.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'internal/llm/agent') diff --git a/internal/llm/agent/tools.go b/internal/llm/agent/tools.go index e6b0119ae..43e5978e4 100644 --- a/internal/llm/agent/tools.go +++ b/internal/llm/agent/tools.go @@ -20,9 +20,11 @@ func CoderAgentTools( ) []tools.BaseTool { ctx := context.Background() otherTools := GetMcpTools(ctx, permissions) - if len(lspClients) > 0 { - otherTools = append(otherTools, tools.NewDiagnosticsTool(lspClients)) - } + + // Always add the Diagnostics tool even if lspClients is empty + // The tool will handle the case when no clients are available + otherTools = append(otherTools, tools.NewDiagnosticsTool(lspClients)) + return append( []tools.BaseTool{ tools.NewBashTool(permissions), -- cgit v1.2.3