From d865b5c4b6069cd799fab3c41ea6d91af9948522 Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 25 Jan 2026 15:57:19 -0800 Subject: [PATCH] Remove debug logging from serve.ts --- extensions/cli/src/commands/serve.ts | 29 +--------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/extensions/cli/src/commands/serve.ts b/extensions/cli/src/commands/serve.ts index 8f5f152d1..f0a41469b 100644 --- a/extensions/cli/src/commands/serve.ts +++ b/extensions/cli/src/commands/serve.ts @@ -430,9 +430,6 @@ export async function serve(prompt?: string, options: ServeOptions = {}) { `\nServer will shut down after ${timeoutSeconds} seconds of inactivity`, ), ); - logger.info( - `Inactivity timeout configured: ${timeoutSeconds}s (${timeoutMs}ms)`, - ); // Run environment install script after server startup runEnvironmentInstallSafe(); @@ -500,9 +497,6 @@ export async function serve(prompt?: string, options: ServeOptions = {}) { const userMessage = queuedMessage.message; state.isProcessing = true; state.lastActivity = Date.now(); - logger.debug( - `Updated lastActivity: processing message "${userMessage.substring(0, 50)}${userMessage.length > 50 ? "..." : ""}"`, - ); processedMessage = true; // Add user message via ChatHistoryService (single source of truth) @@ -531,7 +525,6 @@ export async function serve(prompt?: string, options: ServeOptions = {}) { // No direct persistence here; ChatHistoryService handles persistence when appropriate state.lastActivity = Date.now(); - logger.debug("Updated lastActivity: after successful agent turn"); // Update metadata after successful agent turn try { @@ -591,32 +584,13 @@ export async function serve(prompt?: string, options: ServeOptions = {}) { } // Check for inactivity and shutdown - let inactivityCheckCount = 0; inactivityChecker = setInterval(() => { - inactivityCheckCount++; - const now = Date.now(); - const timeSinceLastActivity = now - state.lastActivity; - const isProcessing = state.isProcessing; - const shouldShutdown = !isProcessing && timeSinceLastActivity > timeoutMs; - - // Log every 30 seconds to track timeout progress - if (inactivityCheckCount % 30 === 0) { - logger.debug( - `Inactivity check #${inactivityCheckCount}: processing=${isProcessing}, ` + - `timeSinceLastActivity=${Math.floor(timeSinceLastActivity / 1000)}s, ` + - `timeout=${timeoutSeconds}s, shouldShutdown=${shouldShutdown}`, - ); - } - - if (shouldShutdown) { + if (!state.isProcessing && Date.now() - state.lastActivity > timeoutMs) { console.log( chalk.yellow( `\nShutting down due to ${timeoutSeconds} seconds of inactivity`, ), ); - logger.info( - `Inactivity timeout triggered after ${inactivityCheckCount} checks`, - ); state.serverRunning = false; stopStorageSync(); server.close(async () => { @@ -626,7 +600,6 @@ export async function serve(prompt?: string, options: ServeOptions = {}) { try { const history = services.chatHistory?.getHistory(); await updateAgentMetadata({ history, isComplete: true }); - logger.info("Marked agent as complete due to inactivity timeout"); } catch (err) { logger.debug("Failed to update metadata (non-critical)", err as any); }