mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-27 18:01:46 +00:00
Merged via squash.
Prepared head SHA: 7d167dff54
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
19 lines
670 B
TypeScript
19 lines
670 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { extractToolCallLocations } from "./event-mapper.js";
|
|
|
|
describe("extractToolCallLocations", () => {
|
|
it("enforces the global node visit cap across nested structures", () => {
|
|
const nested = Array.from({ length: 20 }, (_, outer) =>
|
|
Array.from({ length: 20 }, (_, inner) =>
|
|
inner === 19 ? { path: `/tmp/file-${outer}.txt` } : { note: `${outer}-${inner}` },
|
|
),
|
|
);
|
|
|
|
const locations = extractToolCallLocations(nested);
|
|
|
|
expect(locations).toBeDefined();
|
|
expect(locations?.length).toBeLessThan(20);
|
|
expect(locations).not.toContainEqual({ path: "/tmp/file-19.txt" });
|
|
});
|
|
});
|