

















@@ -282,6 +282,62 @@ describe("resolveBootstrapFilesForRun", () => {
282282);
283283expect(files.map((file) => file.path)).not.toContain(path.join(workspaceDir, "BOOTSTRAP.md"));
284284});
285+286+it("keeps subagent sessions to project and tool bootstrap files", async () => {
287+const workspaceDir = await makeTempWorkspace("openclaw-bootstrap-subagent-");
288+await Promise.all(
289+[
290+["AGENTS.md", "project rules"],
291+["TOOLS.md", "tool rules"],
292+["SOUL.md", "persona"],
293+["IDENTITY.md", "identity"],
294+["USER.md", "user profile"],
295+["MEMORY.md", "memory"],
296+["HEARTBEAT.md", "heartbeat"],
297+["BOOTSTRAP.md", "setup"],
298+].map(([fileName, content]) =>
299+fs.writeFile(path.join(workspaceDir, fileName), content, "utf8"),
300+),
301+);
302+303+const files = await resolveBootstrapFilesForRun({
304+ workspaceDir,
305+sessionKey: "agent:main:subagent:worker",
306+});
307+308+expect(files.map((file) => file.name)).toStrictEqual(["AGENTS.md", "TOOLS.md"]);
309+});
310+311+it("keeps cron sessions on their existing minimal bootstrap files", async () => {
312+const workspaceDir = await makeTempWorkspace("openclaw-bootstrap-cron-");
313+await Promise.all(
314+[
315+["AGENTS.md", "project rules"],
316+["TOOLS.md", "tool rules"],
317+["SOUL.md", "persona"],
318+["IDENTITY.md", "identity"],
319+["USER.md", "user profile"],
320+["MEMORY.md", "memory"],
321+["HEARTBEAT.md", "heartbeat"],
322+["BOOTSTRAP.md", "setup"],
323+].map(([fileName, content]) =>
324+fs.writeFile(path.join(workspaceDir, fileName), content, "utf8"),
325+),
326+);
327+328+const files = await resolveBootstrapFilesForRun({
329+ workspaceDir,
330+sessionKey: "agent:main:cron:daily:run:run-1",
331+});
332+333+expect(files.map((file) => file.name)).toStrictEqual([
334+"AGENTS.md",
335+"SOUL.md",
336+"TOOLS.md",
337+"IDENTITY.md",
338+"USER.md",
339+]);
340+});
285341});
286342287343describe("resolveBootstrapContextForRun", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。