fix(FN-2098): align no-task heartbeat guidance and stabilize flaky tests

- Update HEARTBEAT_NO_TASK_SYSTEM_PROMPT copy to emphasize inbox, memory, delegation, and heartbeat_done usage
- Expand heartbeat monitor tests to assert no-task prompt/tool alignment and preserve task-scoped prompt behavior
- Harden first-run and App view tests by using a safe cwd fallback and more robust async UI waits
- Add best-effort dashboard performance reporting hooks in App and useProjects via a new reportDashboardPerf API helper
This commit is contained in:
Fusion
2026-04-19 01:30:33 -07:00
committed by gsxdsm
parent d9a806f61a
commit ca6fefd6ca
7 changed files with 115 additions and 23 deletions

View File

@@ -1,7 +1,8 @@
import { describe, it, expect, beforeEach, afterEach } from "vitest";
import { mkdirSync, writeFileSync } from "node:fs";
import { realpath } from "node:fs/promises";
import { join } from "node:path";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { tempWorkspace } from "@fusion/test-utils";
import { FirstRunExperience, createFirstRunExperience } from "../first-run.js";
import { CentralCore } from "../central-core.js";
@@ -12,6 +13,17 @@ function createFakeKbProject(dir: string): void {
writeFileSync(join(dir, ".fusion", "fusion.db"), "");
}
const TEST_FILE_DIR = dirname(fileURLToPath(import.meta.url));
function getSafeCwd(): string {
try {
return process.cwd();
} catch {
process.chdir(TEST_FILE_DIR);
return process.cwd();
}
}
describe("FirstRunExperience", () => {
let tempDir: string;
let centralCore: CentralCore;
@@ -27,7 +39,7 @@ describe("FirstRunExperience", () => {
const globalSettingsStore = new GlobalSettingsStore(tempDir);
await globalSettingsStore.init();
firstRun = new FirstRunExperience(centralCore, globalSettingsStore);
originalCwd = process.cwd();
originalCwd = getSafeCwd();
});
afterEach(() => {