feat(FN-4074): add priority option to task creation in engine and extension

Adds task priority support to the task creation flow, spanning the engine runtime (`agent-tools.ts`, `triage.ts`), the CLI extension interface (`extension.ts`), and corresponding documentation and tests. The changeset bumps `@runfusion/fusion` as a minor version.

Fusion-Task-Id: FN-4074

Fusion-Task-Lineage: 726c0ae6-90fb-4c13-ace1-215a2becb2a9
This commit is contained in:
Fusion
2026-05-11 23:31:19 -07:00
committed by gsxdsm
parent 9d52cc4163
commit e9b8ba5c54
15 changed files with 126 additions and 5 deletions

View File

@@ -2603,6 +2603,7 @@ describe("executeHeartbeat", () => {
description: "Follow-up task",
dependencies: undefined,
column: "triage",
priority: undefined,
source: {
sourceType: "agent_heartbeat",
sourceAgentId: "agent-001",
@@ -2610,6 +2611,27 @@ describe("executeHeartbeat", () => {
},
}, expect.objectContaining({ settings: { autoSummarizeTitles: false } }));
});
it("forwards explicit priority when fn_task_create tool is called", async () => {
const store = createStoreWithAgentForExec();
let capturedCreateTool: any;
const mockSession = createMockAgentSession();
mockedCreateFnAgent.mockImplementation(async (opts: any) => {
capturedCreateTool = opts.customTools[0];
return { session: mockSession as any };
});
mockSession.prompt = vi.fn().mockImplementation(async () => {
await capturedCreateTool.execute("call-1", { description: "Follow-up task", priority: "high" });
});
const monitor = new HeartbeatMonitor({ store, taskStore: mockTaskStore, rootDir: "/tmp" });
await monitor.executeHeartbeat({ agentId: "agent-001", source: "on_demand" });
expect(mockTaskStore.createTask).toHaveBeenCalledWith(expect.objectContaining({
priority: "high",
}), expect.any(Object));
});
});
describe("error handling", () => {