




















@@ -200,6 +200,14 @@ function createMockNarrativeSubagent(response = "The archive hummed softly.") {
200200};
201201}
202202203+function firstNarrativeRun(subagent: ReturnType<typeof createMockNarrativeSubagent>) {
204+const firstRun = subagent.run.mock.calls[0]?.[0];
205+if (!firstRun) {
206+throw new Error("expected narrative subagent run");
207+}
208+return firstRun;
209+}
210+203211function setDreamingTestTime(offsetMinutes = 0) {
204212vi.setSystemTime(new Date(DREAMING_TEST_BASE_TIME.getTime() + offsetMinutes * 60_000));
205213}
@@ -2494,10 +2502,10 @@ describe("memory-core dreaming phases", () => {
24942502});
2495250324962504expect(subagent.run).toHaveBeenCalledTimes(1);
2497-const firstRun = subagent.run.mock.calls.at(0)?.[0];
2498-expect(firstRun?.message).toContain("Move backups to S3 Glacier.");
2499-expect(firstRun?.message).toContain("Keep retention at 365 days.");
2500-expect(firstRun?.model).toBe("anthropic/claude-sonnet-4-6");
2505+const firstRun = firstNarrativeRun(subagent);
2506+expect(firstRun.message).toContain("Move backups to S3 Glacier.");
2507+expect(firstRun.message).toContain("Keep retention at 365 days.");
2508+expect(firstRun.model).toBe("anthropic/claude-sonnet-4-6");
25012509await expect(fs.readFile(path.join(workspaceDir, "DREAMS.md"), "utf-8")).resolves.toContain(
25022510"The backup plan glowed like cold storage.",
25032511);
@@ -2557,10 +2565,10 @@ describe("memory-core dreaming phases", () => {
25572565});
2558256625592567expect(subagent.run).toHaveBeenCalledTimes(1);
2560-const firstRun = subagent.run.mock.calls.at(0)?.[0];
2561-expect(firstRun?.message).toContain("Move backups to S3 Glacier.");
2562-expect(firstRun?.message).toContain("Keep retention at 365 days.");
2563-expect(firstRun?.model).toBe("xai/grok-4.1-fast");
2568+const firstRun = firstNarrativeRun(subagent);
2569+expect(firstRun.message).toContain("Move backups to S3 Glacier.");
2570+expect(firstRun.message).toContain("Keep retention at 365 days.");
2571+expect(firstRun.model).toBe("xai/grok-4.1-fast");
25642572await expect(fs.readFile(path.join(workspaceDir, "DREAMS.md"), "utf-8")).resolves.toContain(
25652573"The traces braided themselves into a map.",
25662574);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。