cynarAI 6c7eed7580 Initial clean evOo-local from f00577b
Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline
(Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/*
packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
2026-09-20 17:15:16 +02:00

17 lines
524 B
TypeScript

import { type ToolCallStreak, trackToolCallStreak } from "@rakazo/core";
// Same tool, same arguments, this many times in a row means the agent is stuck, not paginating.
const MAX_CONSECUTIVE_IDENTICAL_TOOL_CALLS = 6;
export function advanceToolCallLoopGuard(
streak: ToolCallStreak,
name: string,
args: unknown,
): { streak: ToolCallStreak; stuck: boolean } {
const next = trackToolCallStreak(streak, name, args);
return {
streak: next,
stuck: next.count >= MAX_CONSECUTIVE_IDENTICAL_TOOL_CALLS,
};
}