diff --git a/server/src/services/heartbeat.ts b/server/src/services/heartbeat.ts index b70e34e6a61..66ec5d28d70 100644 --- a/server/src/services/heartbeat.ts +++ b/server/src/services/heartbeat.ts @@ -358,6 +358,7 @@ import { startAdapterExecutionTargetPaperclipBridge, } from "@paperclipai/adapter-utils/execution-target"; import { agentInstructionWorkingCopyService, collectStoppedInstructionCopyWithRetries, instructionWorkingCopyGuidance } from "./agent-instruction-working-copies.js"; +import { preparePersistentAgentExecutionHome } from "./agent-file-store.js"; import { resolveManagedOpenAiBilling, } from "@paperclipai/adapter-utils"; @@ -4830,6 +4831,11 @@ export function heartbeatService( } else { delete context.paperclipScratch; } + await preparePersistentAgentExecutionHome(db, { + companyId: agent.companyId, + agentId: agent.id, + target: executionTarget, + }); const gitExecutionEnv = await prepareGitHubExecutionEnvironment({ target: executionTarget, cwd: executionWorkspace.cwd,