diff --git a/src/agents/sisyphus-junior/gpt-5-4.ts b/src/agents/sisyphus-junior/gpt-5-4.ts index d1bd8c177..889a5c8aa 100644 --- a/src/agents/sisyphus-junior/gpt-5-4.ts +++ b/src/agents/sisyphus-junior/gpt-5-4.ts @@ -97,7 +97,7 @@ Style: 1. SEARCH existing codebase for similar patterns/styles 2. Match naming, indentation, import styles, error handling conventions 3. Default to ASCII. Add comments only for non-obvious blocks -4. ${GPT_APPLY_PATCH_GUIDANCE} +4. For existing files, use the edit tool instead of write/apply_patch. Use write only when creating a new file. Do not use cat or echo for file creation/editing. ${GPT_APPLY_PATCH_GUIDANCE} 5. Do not chain bash commands with separators - each command should be a separate tool call ### After Implementation (MANDATORY - DO NOT SKIP) diff --git a/src/agents/sisyphus-junior/index.test.ts b/src/agents/sisyphus-junior/index.test.ts index 7da727f30..ffe44032b 100644 --- a/src/agents/sisyphus-junior/index.test.ts +++ b/src/agents/sisyphus-junior/index.test.ts @@ -181,6 +181,18 @@ describe("createSisyphusJuniorAgentWithOverrides", () => { }) }) + describe("GPT-5.4 edit protocol", () => { + test("GPT-5.4 prompt prefers edit tool over apply_patch for existing files", () => { + // given / when + const prompt = buildSisyphusJuniorPrompt("openai/gpt-5.4-mini", false) + + // then + expect(prompt).toContain("For existing files, use the edit tool instead of write/apply_patch.") + expect(prompt).toContain("Use write only when creating a new file.") + expect(prompt).not.toContain("Always use apply_patch for manual code edits.") + }) + }) + describe("tool safety (task blocked, call_omo_agent allowed)", () => { test("task remains blocked, call_omo_agent is allowed via tools format", () => { // given