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.
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { advanceToolCallLoopGuard } from "./tool-loop.js";
|
|
|
|
describe("advanceToolCallLoopGuard", () => {
|
|
it("allows a parallel Open Connector batch with distinct action inputs", () => {
|
|
let streak = { key: undefined as string | undefined, count: 0 };
|
|
|
|
for (let index = 0; index < 20; index += 1) {
|
|
const result = advanceToolCallLoopGuard(streak, "mcp__open-connector__execute_action", {
|
|
actionId: "records.get",
|
|
input: { recordId: index + 1 },
|
|
});
|
|
streak = result.streak;
|
|
expect(result.stuck).toBe(false);
|
|
}
|
|
});
|
|
|
|
it("stops six consecutive calls with identical inputs", () => {
|
|
let streak = { key: undefined as string | undefined, count: 0 };
|
|
let stuck = false;
|
|
|
|
for (let index = 0; index < 6; index += 1) {
|
|
const result = advanceToolCallLoopGuard(streak, "shell", { command: "npm test" });
|
|
streak = result.streak;
|
|
stuck = result.stuck;
|
|
}
|
|
|
|
expect(stuck).toBe(true);
|
|
expect(streak.count).toBe(6);
|
|
});
|
|
});
|