From 6fa6eb7f32008de2241d63edd061491af18043ed Mon Sep 17 00:00:00 2001 From: indifferentketchup Date: Sat, 16 May 2026 06:37:27 +0000 Subject: [PATCH] feat(inference): raise MAX_TOOL_LOOP_DEPTH from 5 to 15 Allows assistant turns up to 15 tool calls in a single chain before the loop-depth guard trips. Real chats commonly need 6-10 tool calls (grep -> view_file -> view_file -> grep -> view_file -> answer); the old cap of 5 was firing on legitimate investigation patterns. Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/server/src/services/inference.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/src/services/inference.ts b/apps/server/src/services/inference.ts index cdc652f..5920760 100644 --- a/apps/server/src/services/inference.ts +++ b/apps/server/src/services/inference.ts @@ -10,7 +10,7 @@ const BASE_SYSTEM_PROMPT = (projectPath: string) => `You are BooCode Chat, a code investigation assistant. The user is working on a project located at ${projectPath}. Use the file-read tools (view_file, list_dir, grep, find_files) to investigate code when needed. Be concise. Cite file paths and line numbers when discussing code. Do not hallucinate file contents — read the file first. Tool results may be truncated; if so, narrow your query rather than guessing.`; const DB_FLUSH_INTERVAL_MS = 500; -const MAX_TOOL_LOOP_DEPTH = 5; +const MAX_TOOL_LOOP_DEPTH = 15; export interface InferenceFrame { type: