fix(ai): bump loop-breaker limits from 16 to 30 to permit long autonomous workflows
This commit is contained in:
@@ -33,9 +33,9 @@ import { buildCodebaseSummary } from "@/lib/ai/codebase-summary";
|
|||||||
import type { ChatMessage, ToolCall } from "@/lib/ai/gemini-chat";
|
import type { ChatMessage, ToolCall } from "@/lib/ai/gemini-chat";
|
||||||
|
|
||||||
// C-01: Lowered from 15 → 8. Real workflows (scaffold → install →
|
// 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.
|
// 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;
|
let chatTablesReady = false;
|
||||||
async function ensureChatTables() {
|
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
|
// 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
|
// 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.
|
// 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
|
let extraSystem = isSilent
|
||||||
? "\n\n[STATUS NUDGE] You have run " +
|
? "\n\n[STATUS NUDGE] You have run " +
|
||||||
`${toolCallsSinceText} tool call(s) over ${roundsSinceText} round(s) ` +
|
`${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)}`;
|
return `${m.role.toUpperCase()}: ${text.slice(0, 1200)}`;
|
||||||
})
|
})
|
||||||
.join("\n\n");
|
.join("\n\n");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn("[chat] plan-extract failed (non-fatal):", err);
|
console.warn("[chat] plan-extract failed (non-fatal):", err);
|
||||||
}
|
}
|
||||||
})().catch(() => {});
|
})().catch(() => {});
|
||||||
|
|||||||
Reference in New Issue
Block a user