feat(FN-1661): merge fusion/fn-1661 (auto-resolved)

- feat(FN-1661): complete Step 4 — document task-worker health fix
- feat(FN-1661): complete Step 3 — verify task-worker agent health fix
This commit is contained in:
gsxdsm
2026-04-13 08:54:19 -07:00
parent c5e8fc7633
commit d4f42787d1
8 changed files with 247 additions and 26 deletions

View File

@@ -2905,6 +2905,26 @@ describe("HeartbeatTriggerScheduler", () => {
expect(callback).not.toHaveBeenCalled();
});
it("skips trigger when agent heartbeat is disabled", async () => {
const agent: import("@fusion/core").Agent = {
id: "agent-test",
name: "executor-FN-1661",
role: "executor",
state: "active",
taskId: "FN-1661",
metadata: {},
runtimeConfig: { enabled: false },
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
};
eventStore.emit("agent:assigned", agent, "FN-1661");
await new Promise((resolve) => setTimeout(resolve, 10));
expect(callback).not.toHaveBeenCalled();
expect(eventStore.getActiveHeartbeatRun).not.toHaveBeenCalled();
});
it("skips trigger when agent has active run", async () => {
(eventStore.getActiveHeartbeatRun as ReturnType<typeof vi.fn>).mockResolvedValue({
id: "run-active",