fix: Proper formatting for anthropic vs non anthropic prompts (#570)

This commit is contained in:
Brace Sproul 2025-07-28 11:41:24 -07:00 • committed by GitHub
parent 8e5414ce2b
commit c99ec10514
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 = (