feat(FN-3612): preserve fusion context in hermes runtime skill forwarding

Merges five commits implementing centralized runtime skill forwarding that preserves Fusion context across the Hermes runtime layer. The engine's `agent-runtime` and `agent-session-helpers` were updated to forward skills at runtime, with `runtime-adapter.ts` and its types extended to carry context.

Fusion-Task-Id: FN-3612
This commit is contained in:
Fusion
2026-05-06 12:57:21 -07:00
committed by gsxdsm
parent 884b91dfc2
commit 2ca67c02f2
9 changed files with 121 additions and 7 deletions

View File

@@ -165,6 +165,41 @@ describe("Hermes runtime integration via engine resolution pipeline", () => {
});
});
it("forwards skillSelection.requestedSkillNames as runtime skills for plugin runtimes", async () => {
const hermesCreateSession = vi.fn().mockResolvedValue({
session: { runtime: "hermes", prompt: vi.fn() },
sessionFile: "/tmp/hermes.session.json",
});
const hermesRegistration = createHermesRegistration(() => ({
id: "hermes",
name: "Hermes Runtime",
createSession: hermesCreateSession,
promptWithFallback: vi.fn().mockResolvedValue(undefined),
describeModel: vi.fn().mockReturnValue("anthropic/claude-sonnet-4-5"),
}));
const pluginRunner = createMockPluginRunner({
getRuntimeById: vi.fn().mockReturnValue(hermesRegistration),
});
await createResolvedAgentSession({
sessionPurpose: "executor",
runtimeHint: "hermes",
pluginRunner,
cwd: "/tmp/project",
systemPrompt: "You are helpful",
skillSelection: {
projectRootDir: "/tmp/project",
requestedSkillNames: ["fusion"],
sessionPurpose: "executor",
},
});
expect(hermesCreateSession).toHaveBeenCalledWith(expect.objectContaining({
skills: ["fusion"],
}));
});
it("falls back to default pi runtime when Hermes factory throws", async () => {
const hermesRegistration = createHermesRegistration(() => {
throw new Error("factory exploded");