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:
@@ -3,6 +3,7 @@ import type { ProjectInfo } from "../api";
|
||||
import {
|
||||
fetchProjectsAcrossNodes,
|
||||
registerProject,
|
||||
reportDashboardPerf,
|
||||
unregisterProject,
|
||||
updateProject,
|
||||
type ProjectCreateInput,
|
||||
@@ -59,13 +60,22 @@ export function useProjects(): UseProjectsResult {
|
||||
|
||||
async function load() {
|
||||
setLoading(true);
|
||||
const t0 = performance.now();
|
||||
try {
|
||||
const data = await fetchProjectsAcrossNodes();
|
||||
const elapsed = Math.round(performance.now() - t0);
|
||||
const msg = `initial fetchProjectsAcrossNodes took ${elapsed}ms (${data.length} projects)`;
|
||||
console.log(`[useProjects] ${msg}`);
|
||||
reportDashboardPerf("[useProjects]", msg);
|
||||
if (!cancelled) {
|
||||
setProjects(data);
|
||||
setError(null);
|
||||
}
|
||||
} catch (err) {
|
||||
const elapsed = Math.round(performance.now() - t0);
|
||||
const msg = `initial fetch failed after ${elapsed}ms: ${err instanceof Error ? err.message : String(err)}`;
|
||||
console.warn(`[useProjects] ${msg}`);
|
||||
reportDashboardPerf("[useProjects]", msg);
|
||||
if (!cancelled) {
|
||||
setError(err instanceof Error ? err.message : "Failed to fetch projects");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user