Ensure agent home directories exist before use
mkdir -p the CODEX_HOME directory in codex-local adapter and the agentHome directory in the heartbeat service before passing them to adapters. This prevents CLI tools from erroring when their home directory hasn't been created yet. Covers all local adapters that set AGENT_HOME. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -272,6 +272,7 @@ export async function execute(ctx: AdapterExecutionContext): Promise<AdapterExec
|
||||
configuredCodexHome ? null : await prepareWorktreeCodexHome(process.env, onLog, agent.companyId);
|
||||
const defaultCodexHome = resolveCodexHomeDir(process.env, agent.companyId);
|
||||
const effectiveCodexHome = configuredCodexHome ?? preparedWorktreeCodexHome ?? defaultCodexHome;
|
||||
await fs.mkdir(effectiveCodexHome, { recursive: true });
|
||||
const codexWorkspaceSkillsDir = resolveCodexWorkspaceSkillsDir(cwd);
|
||||
await ensureCodexSkillsInjected(
|
||||
onLog,
|
||||
|
||||
@@ -2146,7 +2146,11 @@ export function heartbeatService(db: Db) {
|
||||
repoRef: executionWorkspace.repoRef,
|
||||
branchName: executionWorkspace.branchName,
|
||||
worktreePath: executionWorkspace.worktreePath,
|
||||
agentHome: resolveDefaultAgentWorkspaceDir(agent.id),
|
||||
agentHome: await (async () => {
|
||||
const home = resolveDefaultAgentWorkspaceDir(agent.id);
|
||||
await fs.mkdir(home, { recursive: true });
|
||||
return home;
|
||||
})(),
|
||||
};
|
||||
context.paperclipWorkspaces = resolvedWorkspace.workspaceHints;
|
||||
const runtimeServiceIntents = (() => {
|
||||
|
||||
Reference in New Issue
Block a user