Files
letta-code/src/tests/cli/reflection-auto-launch-wiring.test.ts
2026-02-18 15:44:59 -08:00

29 lines
1.1 KiB
TypeScript

import { describe, expect, test } from "bun:test";
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
describe("reflection auto-launch wiring", () => {
test("routes step-count and compaction-event auto-launch through shared reminder engine", () => {
const appPath = fileURLToPath(
new URL("../../cli/App.tsx", import.meta.url),
);
const enginePath = fileURLToPath(
new URL("../../reminders/engine.ts", import.meta.url),
);
const appSource = readFileSync(appPath, "utf-8");
const engineSource = readFileSync(enginePath, "utf-8");
expect(appSource).toContain("const maybeLaunchReflectionSubagent = async");
expect(appSource).toContain("hasActiveReflectionSubagent()");
expect(appSource).toContain("spawnBackgroundSubagentTask({");
expect(appSource).toContain("maybeLaunchReflectionSubagent,");
expect(engineSource).toContain(
'await context.maybeLaunchReflectionSubagent("step-count")',
);
expect(engineSource).toContain(
'await context.maybeLaunchReflectionSubagent("compaction-event")',
);
});
});