From 825d93e52db46d11a1ffb1b78ec2e76ce54a390c Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 24 Feb 2026 06:28:24 +0000 Subject: [PATCH] Inject current date into system prompt so LLM knows today's date Co-Authored-By: Claude Opus 4.6 --- meshai/router.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meshai/router.py b/meshai/router.py index 974a227..da1e49f 100644 --- a/meshai/router.py +++ b/meshai/router.py @@ -3,6 +3,7 @@ import logging import re from dataclasses import dataclass +from datetime import datetime, timezone from enum import Enum, auto from typing import Optional @@ -157,10 +158,11 @@ class MessageRouter: # Get conversation history history = await self.history.get_history_for_llm(message.sender_id) - # Get system prompt from config + # Get system prompt from config, inject current date system_prompt = "" if getattr(self.config.llm, 'use_system_prompt', True): - system_prompt = self.config.llm.system_prompt + today = datetime.now(timezone.utc).strftime("%A, %B %d, %Y") + system_prompt = f"{self.config.llm.system_prompt}\nToday's date is {today}." try: response = await self.llm.generate(