Skip to content

feat(system-prompt): add formatted date with day of week#1915

Closed
tsadrakula wants to merge 1 commit intoopenclaw:mainfrom
tsadrakula:fix/add-day-of-week-to-system-prompt
Closed

feat(system-prompt): add formatted date with day of week#1915
tsadrakula wants to merge 1 commit intoopenclaw:mainfrom
tsadrakula:fix/add-day-of-week-to-system-prompt

Conversation

@tsadrakula
Copy link
Copy Markdown

Summary

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.

Changes

  • Modified buildTimeSection() in src/agents/system-prompt.ts to accept and display userTime
  • The userTime value was already being computed by formatUserTime() — it just wasn't being passed through

Before

## Current Date & Time
Time zone: America/Chicago

After

## Current Date & Time
Sunday, January 25th, 2026 — 12:40 PM
Time zone: America/Chicago

AI Disclosure

  • AI-assisted: Generated with Claude Opus 4.5
  • Testing: Lightly tested (lint passes, code review)
  • I understand what this code does

Testing

  • npm run lint ✅ passes
  • Manual code review ✅

Fixes openclaw#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
@sebslight sebslight added gateway Gateway runtime and removed gateway Gateway runtime labels Jan 26, 2026
Copy link
Copy Markdown
Contributor

@conroywhitney conroywhitney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like @steipete moved the time to session_status on purpose for performance reasons: 66eec29

Let's discuss another approach in #1897

@conroywhitney
Copy link
Copy Markdown
Contributor

conroywhitney commented Jan 29, 2026

Heads up — #3658 proposes a smarter approach that preserves the caching benefit from 66eec29:

Instead of re-adding the timestamp to the system prompt (which undoes the cache optimization), the gateway would inject timestamps into incoming messages for TUI/web clients — the same pattern that Discord/Telegram/Signal channel plugins already use.

This keeps the system prompt stable/cacheable while giving agents timestamp context from every message. Seems like the better path forward vs. reverting the optimization.

See also: the idea of adding a session_status hint to the prompt for mid-conversation time checks, which costs zero tokens until actually needed.

@tsadrakula tsadrakula closed this Jan 29, 2026
@tsadrakula
Copy link
Copy Markdown
Author

Closing in favor of #3677

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add day of week to system prompt runtime info

3 participants