refactor(workspace): lazy-load bootstrap template when seeding

This commit is contained in:
Gustavo Madeira Santana
2026-02-14 18:38:42 -05:00
parent 25fbaafb09
commit a57718c09e

View File

@@ -215,8 +215,6 @@ export async function ensureAgentWorkspace(params?: {
const identityTemplate = await loadTemplate(DEFAULT_IDENTITY_FILENAME);
const userTemplate = await loadTemplate(DEFAULT_USER_FILENAME);
const heartbeatTemplate = await loadTemplate(DEFAULT_HEARTBEAT_FILENAME);
const bootstrapTemplate = await loadTemplate(DEFAULT_BOOTSTRAP_FILENAME);
const wroteAgents = await writeFileIfMissing(agentsPath, agentsTemplate);
const wroteSoul = await writeFileIfMissing(soulPath, soulTemplate);
const wroteTools = await writeFileIfMissing(toolsPath, toolsTemplate);
@@ -226,6 +224,7 @@ export async function ensureAgentWorkspace(params?: {
const wroteAnyCoreBootstrapFile =
wroteAgents || wroteSoul || wroteTools || wroteIdentity || wroteUser || wroteHeartbeat;
if (isBrandNewWorkspace || wroteAnyCoreBootstrapFile) {
const bootstrapTemplate = await loadTemplate(DEFAULT_BOOTSTRAP_FILENAME);
await writeFileIfMissing(bootstrapPath, bootstrapTemplate);
}
await ensureGitRepo(dir, isBrandNewWorkspace);