diff --git a/vibn-frontend/app/api/chat/route.ts b/vibn-frontend/app/api/chat/route.ts index f4322460..2ca45deb 100644 --- a/vibn-frontend/app/api/chat/route.ts +++ b/vibn-frontend/app/api/chat/route.ts @@ -33,9 +33,9 @@ import { buildCodebaseSummary } from "@/lib/ai/codebase-summary"; import type { ChatMessage, ToolCall } from "@/lib/ai/gemini-chat"; // C-01: Lowered from 15 → 8. Real workflows (scaffold → install → -// configure → start) rarely need more than 8 rounds when done correctly. +// configure → start) rarely need more than 16 rounds when done correctly. // If the cap IS hit the model gets a recovery summary, not silence. -const MAX_TOOL_ROUNDS = 8; +const MAX_TOOL_ROUNDS = 30; let chatTablesReady = false; async function ensureChatTables() { @@ -683,7 +683,7 @@ export async function POST(request: Request) { // Every 8 silent rounds or 12 tool calls, gently nudge the model to surface a one-liner // status before continuing. This is the user's only signal of // life when a tool chain runs long, but we keep the threshold high so it doesn't distract. - const isSilent = roundsSinceText >= 8 || toolCallsSinceText >= 12; + const isSilent = roundsSinceText >= 30 || toolCallsSinceText >= 12; let extraSystem = isSilent ? "\n\n[STATUS NUDGE] You have run " + `${toolCallsSinceText} tool call(s) over ${roundsSinceText} round(s) ` + @@ -1138,7 +1138,7 @@ export async function POST(request: Request) { return `${m.role.toUpperCase()}: ${text.slice(0, 1200)}`; }) .join("\n\n"); - } catch (err) { + } catch (err) { console.warn("[chat] plan-extract failed (non-fatal):", err); } })().catch(() => {});