From a1af1bd996707c11d85ae1da1addd4f464e8fc39 Mon Sep 17 00:00:00 2001 From: Trenton Sadrakula Date: Sun, 25 Jan 2026 13:15:11 -0600 Subject: [PATCH] feat(system-prompt): add formatted date with day of week MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1897 The system prompt now includes the full formatted date (e.g., "Sunday, January 25th, 2026 — 12:40 PM") above the timezone, so agents no longer have to guess what day it is. 🤖 AI-assisted: Generated with Claude Opus 4.5 📋 Testing: Lightly tested (lint passes, manual review) ✅ I understand what this code does --- src/agents/system-prompt.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/agents/system-prompt.ts b/src/agents/system-prompt.ts index 41ec9a7d5..38bd320c4 100644 --- a/src/agents/system-prompt.ts +++ b/src/agents/system-prompt.ts @@ -49,9 +49,14 @@ function buildUserIdentitySection(ownerLine: string | undefined, isMinimal: bool return ["## User Identity", ownerLine, ""]; } -function buildTimeSection(params: { userTimezone?: string }) { +function buildTimeSection(params: { userTimezone?: string; userTime?: string }) { if (!params.userTimezone) return []; - return ["## Current Date & Time", `Time zone: ${params.userTimezone}`, ""]; + const lines = ["## Current Date & Time"]; + if (params.userTime) { + lines.push(params.userTime); + } + lines.push(`Time zone: ${params.userTimezone}`, ""); + return lines; } function buildReplyTagsSection(isMinimal: boolean) { @@ -297,6 +302,7 @@ export function buildAgentSystemPrompt(params: { : undefined; const reasoningLevel = params.reasoningLevel ?? "off"; const userTimezone = params.userTimezone?.trim(); + const userTime = params.userTime?.trim(); const skillsPrompt = params.skillsPrompt?.trim(); const heartbeatPrompt = params.heartbeatPrompt?.trim(); const heartbeatPromptLine = heartbeatPrompt @@ -459,6 +465,7 @@ export function buildAgentSystemPrompt(params: { ...buildUserIdentitySection(ownerLine, isMinimal), ...buildTimeSection({ userTimezone, + userTime, }), "## Workspace Files (injected)", "These user-editable files are loaded by Clawdbot and included below in Project Context.",