fix(llm): get rid of a lot of log.info() statements that were spammy

This commit is contained in:
perf3ct 2025-06-03 03:00:15 +00:00
parent d2ba270fdf
commit d4d55b20a8
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
4 changed files with 3 additions and 12 deletions

View File

@ -42,7 +42,6 @@ export class AgentToolsManager {
}
try {
log.info("Initializing agent tools");
// Initialize the context service first
try {

View File

@ -559,11 +559,9 @@ export class ToolCallingStage extends BasePipelineStage<ToolExecutionInput, { re
// Get agent tools manager and initialize it
const 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 initialized
await 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, { re
const 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 available
const 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) {

View File

@ -63,11 +63,9 @@ async function getOrCreateVectorSearchTool(): Promise<any> {
// Get agent tools manager and initialize it
const 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 initialized
await 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>))

View File

@ -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}`);
}
/**