Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(llm): get rid of a lot of log.info() statements that were spammy
perf3ctd4d55b20a8ce
diff --git a/apps/server/src/services/llm/context_extractors/index.ts b/apps/server/src/services/llm/context_extractors/index.tsindex f6cd07b28f..9b97f38a3c 100644--- a/apps/server/src/services/llm/context_extractors/index.ts+++ b/apps/server/src/services/llm/context_extractors/index.ts@@ -42,7 +42,6 @@ export class AgentToolsManager {}try {- log.info("Initializing agent tools");// Initialize the context service firsttry {diff --git a/apps/server/src/services/llm/pipeline/stages/tool_calling_stage.ts b/apps/server/src/services/llm/pipeline/stages/tool_calling_stage.tsindex 1dd6ff5500..f988a63949 100644--- a/apps/server/src/services/llm/pipeline/stages/tool_calling_stage.ts+++ b/apps/server/src/services/llm/pipeline/stages/tool_calling_stage.ts@@ -559,11 +559,9 @@ export class ToolCallingStage extends BasePipelineStage<ToolExecutionInput, { re// Get agent tools manager and initialize itconst agentTools = aiServiceManager.getAgentTools();if (agentTools && typeof agentTools.initialize === 'function') {- log.info('Initializing agent tools to create vectorSearchTool');try {// Force initialization to ensure it runs even if previously marked as initializedawait agentTools.initialize(true);- log.info('Agent tools initialized successfully');} catch (initError: unknown) {const errorMessage = initError instanceof Error ? initError.message : String(initError);log.error(`Failed to initialize agent tools: ${errorMessage}`);@@ -812,14 +810,11 @@ export class ToolCallingStage extends BasePipelineStage<ToolExecutionInput, { reconst agentTools = aiServiceManager.getAgentTools();if (agentTools && typeof agentTools.initialize === 'function') {await agentTools.initialize(true);- log.info(`Agent tools initialized during preloading`);}// Check if the vector search tool is availableconst vectorSearchTool = aiServiceManager.getVectorSearchTool();- if (vectorSearchTool && typeof vectorSearchTool.searchNotes === 'function') {- log.info(`Vector search tool successfully preloaded`);- } else {+ if (!(vectorSearchTool && typeof vectorSearchTool.searchNotes === 'function')) {log.error(`Vector search tool not available after initialization`);}} catch (error: unknown) {diff --git a/apps/server/src/services/llm/tools/search_notes_tool.ts b/apps/server/src/services/llm/tools/search_notes_tool.tsindex 46c273032f..09b3fc645e 100644--- a/apps/server/src/services/llm/tools/search_notes_tool.ts+++ b/apps/server/src/services/llm/tools/search_notes_tool.ts@@ -63,11 +63,9 @@ async function getOrCreateVectorSearchTool(): Promise<any> {// Get agent tools manager and initialize itconst agentTools = aiServiceManager.getAgentTools();if (agentTools && typeof agentTools.initialize === 'function') {- log.info('Initializing agent tools to create vectorSearchTool');try {// Force initialization to ensure it runs even if previously marked as initializedawait agentTools.initialize(true);- log.info('Agent tools initialized successfully');} catch (initError: any) {log.error(`Failed to initialize agent tools: ${initError.message}`);return null;@@ -143,7 +141,7 @@ export class SearchNotesTool implements ToolHandler {temperature: 0.3,maxTokens: 200,// Type assertion to bypass type checking for special internal parameters- ...(({+ ...(({bypassFormatter: true,bypassContextProcessing: true} as Record<string, boolean>))diff --git a/apps/server/src/services/llm/tools/tool_registry.ts b/apps/server/src/services/llm/tools/tool_registry.tsindex 9ad41fdce8..6d6dd417f6 100644--- a/apps/server/src/services/llm/tools/tool_registry.ts+++ b/apps/server/src/services/llm/tools/tool_registry.ts@@ -13,7 +13,7 @@ import log from '../../log.js';export class ToolRegistry {private static instance: ToolRegistry;private tools: Map<string, ToolHandler> = new Map();- private initializationAttempted: boolean = false;+ private initializationAttempted = false;private constructor() {}@@ -106,7 +106,6 @@ export class ToolRegistry {}this.tools.set(name, handler);- log.info(`Registered tool: ${name}`);}/**