From 3099a2f53c856f670ad0059a1d3a2c13f2c0a2c4 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Thu, 12 Feb 2026 15:59:31 -0800 Subject: [PATCH] Add timestamp to active system prompt in AIAgent - Appended the current local date and time to the active system prompt to provide context for the model, addressing potential misinterpretations due to training cutoffs. --- run_agent.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/run_agent.py b/run_agent.py index 56328a3731..af3afc0da5 100644 --- a/run_agent.py +++ b/run_agent.py @@ -1981,6 +1981,15 @@ class AIAgent: else: active_system_prompt = context_files_prompt + # Append the current local date and time so the model knows what + # day/time it is (LLM training cutoffs can otherwise mislead it). + now = datetime.now() + timestamp_line = f"Current local date and time: {now.strftime('%A, %B %d, %Y %I:%M %p')}" + if active_system_prompt: + active_system_prompt = f"{active_system_prompt}\n\n{timestamp_line}" + else: + active_system_prompt = timestamp_line + # Main conversation loop api_call_count = 0 final_response = None