@@ -44,26 +44,14 @@ describe("loadLocalContextFile", () => {
4444
4545 describe("buildSystemPrompt", () => {
4646 it("includes base guidelines without context files", () => {
47- const prompt = buildSystemPrompt(
48- tmpDir,
49- undefined,
50- undefined,
51- undefined,
52- fakeHome,
53- );
47+ const prompt = buildSystemPrompt(tmpDir, undefined, undefined, fakeHome);
5448 expect(prompt).toContain("You are mini-coder");
5549 expect(prompt).toContain("Guidelines:");
5650 expect(prompt).not.toContain("# Project context");
5751 });
5852
5953 it("includes delegation guideline in main mode", () => {
60- const prompt = buildSystemPrompt(
61- tmpDir,
62- undefined,
63- undefined,
64- undefined,
65- fakeHome,
66- );
54+ const prompt = buildSystemPrompt(tmpDir, undefined, undefined, fakeHome);
6755 expect(prompt).toContain(
6856 "Use the `subagent` tool sparingly — only for clearly separable",
6957 );
@@ -72,38 +60,20 @@ describe("buildSystemPrompt", () => {
7260
7361 it("includes local context under # Project context", () => {
7462 writeFileSync(join(tmpDir, "AGENTS.md"), "local project info");
75- const prompt = buildSystemPrompt(
76- tmpDir,
77- undefined,
78- undefined,
79- undefined,
80- fakeHome,
81- );
63+ const prompt = buildSystemPrompt(tmpDir, undefined, undefined, fakeHome);
8264 expect(prompt).toContain("# Project context");
8365 expect(prompt).toContain("local project info");
8466 });
8567
8668 it("has exactly one # Project context section when local context present", () => {
8769 writeFileSync(join(tmpDir, "AGENTS.md"), "local info");
88- const prompt = buildSystemPrompt(
89- tmpDir,
90- undefined,
91- undefined,
92- undefined,
93- fakeHome,
94- );
70+ const prompt = buildSystemPrompt(tmpDir, undefined, undefined, fakeHome);
9571 const occurrences = prompt.split("# Project context").length - 1;
9672 expect(occurrences).toBe(1);
9773 });
9874
9975 it("appends subagent delegation wording in subagent mode", () => {
100- const prompt = buildSystemPrompt(
101- tmpDir,
102- undefined,
103- undefined,
104- true,
105- fakeHome,
106- );
76+ const prompt = buildSystemPrompt(tmpDir, undefined, true, fakeHome);
10777 expect(prompt).toContain("You are running as a subagent");
10878 expect(prompt).toContain(
10979 "Do not spawn further subagents unless the subtask is unambiguously separable",
@@ -111,25 +81,13 @@ describe("buildSystemPrompt", () => {
11181 });
11282
11383 it("does not append subagent wording in non-subagent mode", () => {
114- const prompt = buildSystemPrompt(
115- tmpDir,
116- undefined,
117- undefined,
118- false,
119- fakeHome,
120- );
84+ const prompt = buildSystemPrompt(tmpDir, undefined, false, fakeHome);
12185 expect(prompt).not.toContain("You are running as a subagent");
12286 });
12387
12488 it("appends extraSystemPrompt after context and subagent wording", () => {
12589 writeFileSync(join(tmpDir, "AGENTS.md"), "ctx");
126- const prompt = buildSystemPrompt(
127- tmpDir,
128- undefined,
129- "custom extra",
130- true,
131- fakeHome,
132- );
90+ const prompt = buildSystemPrompt(tmpDir, "custom extra", true, fakeHome);
13391 const subagentIdx = prompt.indexOf("You are running as a subagent");
13492 const extraIdx = prompt.indexOf("custom extra");
13593 const contextIdx = prompt.indexOf("ctx");
@@ -138,13 +96,7 @@ describe("buildSystemPrompt", () => {
13896 });
13997
14098 it("includes cwd and current time in prompt", () => {
141- const prompt = buildSystemPrompt(
142- tmpDir,
143- undefined,
144- undefined,
145- undefined,
146- fakeHome,
147- );
99+ const prompt = buildSystemPrompt(tmpDir, undefined, undefined, fakeHome);
148100 expect(prompt).toContain("Current working directory:");
149101 expect(prompt).toContain("Current date/time:");
150102 });
@@ -152,13 +104,7 @@ describe("buildSystemPrompt", () => {
152104 it("includes global context when ~/.agents/AGENTS.md present", () => {
153105 mkdirSync(join(fakeHome, ".agents"), { recursive: true });
154106 writeFileSync(join(fakeHome, ".agents", "AGENTS.md"), "global info");
155- const prompt = buildSystemPrompt(
156- tmpDir,
157- undefined,
158- undefined,
159- undefined,
160- fakeHome,
161- );
107+ const prompt = buildSystemPrompt(tmpDir, undefined, undefined, fakeHome);
162108 expect(prompt).toContain("# Project context");
163109 expect(prompt).toContain("global info");
164110 });
@@ -167,13 +113,7 @@ describe("buildSystemPrompt", () => {
167113 mkdirSync(join(fakeHome, ".agents"), { recursive: true });
168114 writeFileSync(join(fakeHome, ".agents", "AGENTS.md"), "global info");
169115 writeFileSync(join(tmpDir, "AGENTS.md"), "local info");
170- const prompt = buildSystemPrompt(
171- tmpDir,
172- undefined,
173- undefined,
174- undefined,
175- fakeHome,
176- );
116+ const prompt = buildSystemPrompt(tmpDir, undefined, undefined, fakeHome);
177117 expect(prompt).toContain("global info");
178118 expect(prompt).toContain("local info");
179119 expect(prompt.indexOf("global info")).toBeLessThan(
@@ -182,13 +122,7 @@ describe("buildSystemPrompt", () => {
182122 });
183123
184124 it("does not include # Project context when neither global nor local context present", () => {
185- const prompt = buildSystemPrompt(
186- tmpDir,
187- undefined,
188- undefined,
189- undefined,
190- fakeHome,
191- );
125+ const prompt = buildSystemPrompt(tmpDir, undefined, undefined, fakeHome);
192126 expect(prompt).not.toContain("# Project context");
193127 });
194128 });