diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index a552b4ed1..8289e2ce4 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -11,6 +11,7 @@ import threading import time import traceback from collections import defaultdict +from datetime import datetime from json.decoder import JSONDecodeError from pathlib import Path @@ -733,9 +734,16 @@ class Coder: def fmt_system_prompt(self, prompt): lazy_prompt = self.gpt_prompts.lazy_prompt if self.main_model.lazy else "" - platform_text = ( - f"The user's system is `{platform.platform()}` according to python platform.platform()" - ) + platform_text = f"- The user's system: {platform.platform()}\n" + if os.name == "nt": + var = "COMSPEC" + else: + var = "SHELL" + + val = os.getenv(var) + platform_text += f"- The user's shell: {var}={val}\n" + dt = datetime.now().isoformat() + platform_text += f"- The current date/time: {dt}" prompt = prompt.format( fence=self.fence, diff --git a/aider/coders/editblock_prompts.py b/aider/coders/editblock_prompts.py index 44c508ca3..945fd47eb 100644 --- a/aider/coders/editblock_prompts.py +++ b/aider/coders/editblock_prompts.py @@ -19,6 +19,10 @@ Once you understand the request you MUST: 3. Describe each change with a *SEARCH/REPLACE block* per the examples below. All changes to files must use this *SEARCH/REPLACE block* format. ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*! All changes to files must use the *SEARCH/REPLACE block* format. + +Keep this info about the user's system in mind: +{platform} + """ example_messages = [ diff --git a/aider/coders/help_prompts.py b/aider/coders/help_prompts.py index 0defbc0e4..4157f5e88 100644 --- a/aider/coders/help_prompts.py +++ b/aider/coders/help_prompts.py @@ -25,6 +25,8 @@ Don't suggest a solution that isn't supported. Be helpful but concise. Unless the question indicates otherwise, assume the user wants to use aider as a CLI tool. + +Keep this info about the user's system in mind: {platform} """