From c99ec10514048e732582e5f6af52589d8cdecb51 Mon Sep 17 00:00:00 2001 From: Brace Sproul Date: Mon, 28 Jul 2025 11:41:24 -0700 Subject: [PATCH] fix: Proper formatting for anthropic vs non anthropic prompts (#570) --- .../programmer/nodes/generate-message/index.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/apps/open-swe/src/graphs/programmer/nodes/generate-message/index.ts b/apps/open-swe/src/graphs/programmer/nodes/generate-message/index.ts index d1e6988e..a1c63e2c 100644 --- a/apps/open-swe/src/graphs/programmer/nodes/generate-message/index.ts +++ b/apps/open-swe/src/graphs/programmer/nodes/generate-message/index.ts @@ -80,15 +80,13 @@ const formatStaticInstructionsPrompt = ( state: GraphState, isAnthropicModel: boolean, ) => { - return isAnthropicModel - ? STATIC_ANTHROPIC_SYSTEM_INSTRUCTIONS - : STATIC_SYSTEM_INSTRUCTIONS.replaceAll( - "{REPO_DIRECTORY}", - getRepoAbsolutePath(state.targetRepository), - ).replaceAll( - "{CUSTOM_RULES}", - formatCustomRulesPrompt(state.customRules), - ); + return ( + isAnthropicModel + ? STATIC_ANTHROPIC_SYSTEM_INSTRUCTIONS + : STATIC_SYSTEM_INSTRUCTIONS + ) + .replaceAll("{REPO_DIRECTORY}", getRepoAbsolutePath(state.targetRepository)) + .replaceAll("{CUSTOM_RULES}", formatCustomRulesPrompt(state.customRules)); }; const formatCacheablePrompt = (