





























@@ -4,7 +4,10 @@ import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi }
44import { resolveEmbeddedRunSkillEntries } from "../../agents/pi-embedded-runner/skills-runtime.js";
55import { createCanonicalFixtureSkill } from "../../agents/skills.test-helpers.js";
66import type { Skill } from "../../agents/skills/skill-contract.js";
7-import { hydrateResolvedSkills } from "../../auto-reply/reply/session-updates.js";
7+import {
8+hydrateResolvedSkills,
9+hydrateResolvedSkillsAsync,
10+} from "../../agents/skills/snapshot-hydration.js";
811import { createSuiteTempRootTracker } from "../../test-helpers/temp-dir.js";
912import type { SessionEntry, SessionSkillSnapshot } from "./types.js";
1013@@ -269,4 +272,23 @@ describe("hydrateResolvedSkills", () => {
269272expect(result).toBe(snapshot);
270273expect(buildCalls).toBe(0);
271274});
275+276+it("supports async runtime hydration for CLI resume paths", async () => {
277+const stripped: SessionSkillSnapshot = {
278+prompt: "cached-prompt",
279+skills: [{ name: "x" }],
280+version: 2,
281+};
282+const rebuiltSkills = [makeFixtureSkill("x", 120)];
283+const result = await hydrateResolvedSkillsAsync(stripped, async () => ({
284+prompt: "fresh-prompt",
285+skills: [{ name: "y" }],
286+resolvedSkills: rebuiltSkills,
287+version: 3,
288+}));
289+expect(result.prompt).toBe("cached-prompt");
290+expect(result.skills).toEqual([{ name: "x" }]);
291+expect(result.version).toBe(2);
292+expect(result.resolvedSkills).toBe(rebuiltSkills);
293+});
272294});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。