fix(FN-2116): restore agent run logs
This commit is contained in:
@@ -147,13 +147,17 @@ export function NodeDetailModal({
|
||||
setIsPulling(true);
|
||||
try {
|
||||
await onPullSettings(node.id);
|
||||
if (!isMountedRef.current) return;
|
||||
addToast("Settings pulled successfully", "success");
|
||||
} catch (error) {
|
||||
if (!isMountedRef.current) return;
|
||||
const message = error instanceof Error ? error.message : "Pull settings failed";
|
||||
setSyncError(message);
|
||||
addToast(message, "error");
|
||||
} finally {
|
||||
setIsPulling(false);
|
||||
if (isMountedRef.current) {
|
||||
setIsPulling(false);
|
||||
}
|
||||
}
|
||||
}, [addToast, node, onPullSettings]);
|
||||
|
||||
@@ -163,13 +167,17 @@ export function NodeDetailModal({
|
||||
setIsSyncingAuth(true);
|
||||
try {
|
||||
await onSyncAuth(node.id);
|
||||
if (!isMountedRef.current) return;
|
||||
addToast("Auth credentials synced successfully", "success");
|
||||
} catch (error) {
|
||||
if (!isMountedRef.current) return;
|
||||
const message = error instanceof Error ? error.message : "Auth sync failed";
|
||||
setSyncError(message);
|
||||
addToast(message, "error");
|
||||
} finally {
|
||||
setIsSyncingAuth(false);
|
||||
if (isMountedRef.current) {
|
||||
setIsSyncingAuth(false);
|
||||
}
|
||||
}
|
||||
}, [addToast, node, onSyncAuth]);
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ vi.mock("@fusion/core", async () => {
|
||||
return {
|
||||
...actual,
|
||||
isGhAuthenticated: vi.fn(),
|
||||
isQmdAvailable: vi.fn().mockResolvedValue(false),
|
||||
CentralCore: vi.fn().mockImplementation(() => ({
|
||||
init: mockCentralInit,
|
||||
close: mockCentralClose,
|
||||
|
||||
@@ -12941,6 +12941,11 @@ export function createApiRoutes(store: TaskStore, options?: ServerOptions): Rout
|
||||
const agentStore = new AgentStoreClass({ rootDir: scopedStore.getFusionDir() });
|
||||
await agentStore.init();
|
||||
|
||||
const agent = await agentStore.getAgent(req.params.id);
|
||||
if (!agent) {
|
||||
throw notFound(`Agent ${req.params.id} not found`);
|
||||
}
|
||||
|
||||
const activeRun = await agentStore.getActiveHeartbeatRun(req.params.id);
|
||||
if (activeRun) {
|
||||
throw new ApiError(409, "Agent already has an active run", { runId: activeRun.id });
|
||||
@@ -12965,6 +12970,11 @@ export function createApiRoutes(store: TaskStore, options?: ServerOptions): Rout
|
||||
const agentStore = new AgentStore({ rootDir: scopedStore.getFusionDir() });
|
||||
await agentStore.init();
|
||||
|
||||
const agent = await agentStore.getAgent(req.params.id);
|
||||
if (!agent) {
|
||||
throw notFound(`Agent ${req.params.id} not found`);
|
||||
}
|
||||
|
||||
// Check for existing active run
|
||||
const activeRun = await agentStore.getActiveHeartbeatRun(req.params.id);
|
||||
if (activeRun) {
|
||||
|
||||
Reference in New Issue
Block a user