From 554392e639a9c4e704defbec2c2f2125c3348037 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Wed, 11 Mar 2026 20:38:46 +0900 Subject: [PATCH] fix(agents): add anti-duplication rules to Atlas agent prompts --- src/agents/atlas/atlas-prompt.test.ts | 15 +++++++++++++++ src/agents/atlas/default.ts | 4 ++++ src/agents/atlas/gemini.ts | 4 ++++ src/agents/atlas/gpt.ts | 4 ++++ 4 files changed, 27 insertions(+) diff --git a/src/agents/atlas/atlas-prompt.test.ts b/src/agents/atlas/atlas-prompt.test.ts index 759f3ac8d..e536cff98 100644 --- a/src/agents/atlas/atlas-prompt.test.ts +++ b/src/agents/atlas/atlas-prompt.test.ts @@ -77,6 +77,21 @@ describe("Atlas prompts auto-continue policy", () => { }) }) +describe("Atlas prompts anti-duplication coverage", () => { + test("all variants should include anti-duplication rules for delegated exploration", () => { + // given + const prompts = [ATLAS_SYSTEM_PROMPT, ATLAS_GPT_SYSTEM_PROMPT, ATLAS_GEMINI_SYSTEM_PROMPT] + + // when / then + for (const prompt of prompts) { + expect(prompt).toContain("") + expect(prompt).toContain("Anti-Duplication Rule") + expect(prompt).toContain("DO NOT perform the same search yourself") + expect(prompt).toContain("non-overlapping work") + } + }) +}) + describe("Atlas prompts plan path consistency", () => { test("default variant should use .sisyphus/plans/{plan-name}.md path", () => { // given diff --git a/src/agents/atlas/default.ts b/src/agents/atlas/default.ts index 2f4f025a1..c5aafc80b 100644 --- a/src/agents/atlas/default.ts +++ b/src/agents/atlas/default.ts @@ -8,6 +8,8 @@ * - Extended reasoning sections */ +import { buildAntiDuplicationSection } from "../dynamic-agent-prompt-builder" + export const ATLAS_SYSTEM_PROMPT = ` You are Atlas - the Master Orchestrator from OhMyOpenCode. @@ -24,6 +26,8 @@ Implementation tasks are the means. Final Wave approval is the goal. One task per delegation. Parallel when independent. Verify everything. +${buildAntiDuplicationSection()} + ## How to Delegate diff --git a/src/agents/atlas/gemini.ts b/src/agents/atlas/gemini.ts index a742c34d7..78ac92976 100644 --- a/src/agents/atlas/gemini.ts +++ b/src/agents/atlas/gemini.ts @@ -8,6 +8,8 @@ * - Consequence-driven framing (Gemini ignores soft warnings) */ +import { buildAntiDuplicationSection } from "../dynamic-agent-prompt-builder" + export const ATLAS_GEMINI_SYSTEM_PROMPT = ` You are Atlas - Master Orchestrator from OhMyOpenCode. @@ -51,6 +53,8 @@ Implementation tasks are the means. Final Wave approval is the goal. - **Your creativity should go into ORCHESTRATION QUALITY, not implementation decisions.** +${buildAntiDuplicationSection()} + ## How to Delegate diff --git a/src/agents/atlas/gpt.ts b/src/agents/atlas/gpt.ts index dcd737068..a06f45c22 100644 --- a/src/agents/atlas/gpt.ts +++ b/src/agents/atlas/gpt.ts @@ -8,6 +8,8 @@ * - Scope discipline (no extra features) */ +import { buildAntiDuplicationSection } from "../dynamic-agent-prompt-builder" + export const ATLAS_GPT_SYSTEM_PROMPT = ` You are Atlas - Master Orchestrator from OhMyOpenCode. @@ -61,6 +63,8 @@ Implementation tasks are the means. Final Wave approval is the goal. 3. \`Read\` for changed files +${buildAntiDuplicationSection()} + ## Delegation API