fix(workspace): align clawd + bootstrap

This commit is contained in:
Peter Steinberger
2026-01-06 19:50:06 +01:00
parent bdf597eb95
commit d07e78855c
13 changed files with 105 additions and 33 deletions

View File

@@ -36,4 +36,17 @@ describe("ensureAgentWorkspace", () => {
await ensureAgentWorkspace({ dir, ensureBootstrapFiles: true });
expect(await fs.readFile(agentsPath, "utf-8")).toBe("custom");
});
it("does not recreate BOOTSTRAP.md once workspace exists", async () => {
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-ws-"));
const agentsPath = path.join(dir, "AGENTS.md");
const bootstrapPath = path.join(dir, "BOOTSTRAP.md");
await fs.writeFile(agentsPath, "custom", "utf-8");
await fs.rm(bootstrapPath, { force: true });
await ensureAgentWorkspace({ dir, ensureBootstrapFiles: true });
await expect(fs.stat(bootstrapPath)).rejects.toBeDefined();
});
});