refactor: Move lazy/overeager prompts to final reminders in system prompt

This commit is contained in:
Paul Gauthier 2025-05-01 17:24:14 -07:00 committed by Paul Gauthier (aider)
parent e205629a94
commit 849a379a8c

View file

@ -1079,12 +1079,15 @@ class Coder:
return platform_text return platform_text
def fmt_system_prompt(self, prompt): def fmt_system_prompt(self, prompt):
final_reminders = []
if self.main_model.lazy: if self.main_model.lazy:
lazy_prompt = self.gpt_prompts.lazy_prompt final_reminders.append(self.gpt_prompts.lazy_prompt)
elif self.main_model.overeager: if self.main_model.overeager:
lazy_prompt = self.gpt_prompts.overeager_prompt final_reminders.append(self.gpt_prompts.overeager_prompt)
else:
lazy_prompt = "" user_lang = self.get_user_language()
if user_lang:
final_reminders.append(f"Reply in {user_lang}.")
platform_text = self.get_platform_info() platform_text = self.get_platform_info()
@ -1111,10 +1114,13 @@ class Coder:
else: else:
quad_backtick_reminder = "" quad_backtick_reminder = ""
final_reminders = "\n\n".join(final_reminders)
dump(prompt)
prompt = prompt.format( prompt = prompt.format(
fence=self.fence, fence=self.fence,
quad_backtick_reminder=quad_backtick_reminder, quad_backtick_reminder=quad_backtick_reminder,
lazy_prompt=lazy_prompt, final_reminders=final_reminders,
platform=platform_text, platform=platform_text,
shell_cmd_prompt=shell_cmd_prompt, shell_cmd_prompt=shell_cmd_prompt,
rename_with_shell=rename_with_shell, rename_with_shell=rename_with_shell,