Skip to content

feat(agents): include full date with day of week in system prompt#2154

Closed
Episkey-G wants to merge 2 commits intoopenclaw:mainfrom
Episkey-G:feat/system-prompt-full-date
Closed

feat(agents): include full date with day of week in system prompt#2154
Episkey-G wants to merge 2 commits intoopenclaw:mainfrom
Episkey-G:feat/system-prompt-full-date

Conversation

@Episkey-G
Copy link
Copy Markdown

Summary

Fixes #2108

The system prompt now displays the full current date and time when userTime is available, including day of week.

Problem

Previously, the system prompt only showed the timezone:

## Current Date & Time
Time zone: Europe/London

The agent had to infer the current date from message timestamps (which only show YYYY-MM-DD without day of week), leading to confident but incorrect day-of-week statements (e.g., saying "Sunday" when it's actually Monday).

Solution

When userTime is provided, the system prompt now displays:

## Current Date & Time
Current: Monday, 26 January 2026, 06:53 GMT
Time zone: Europe/London

This eliminates day-of-week guessing errors entirely.

Changes

  • Modified buildTimeSection in system-prompt.ts:52-60 to accept and display userTime parameter
  • Updated function call to pass userTime to buildTimeSection
  • Updated tests to verify userTime appears correctly in system prompt
  • Format: Current: <full date> followed by Time zone: <timezone>

Testing

  • Updated existing tests to verify the new format
  • Tests confirm both 12-hour and 24-hour time formats display correctly
  • Backward compatible: when userTime is not provided, falls back to timezone-only display

🤖 Generated with Claude Code

Fixes openclaw#2108

The system prompt now displays the full current date and time when
userTime is available, including day of week (e.g., 'Monday, January 26th, 2026 — 15:30').
This eliminates day-of-week guessing errors where the agent would
confidently state the wrong day based on timestamp inference.

Changes:
- Modified buildTimeSection to accept and display userTime parameter
- Updated tests to verify userTime appears in system prompt
- Format: 'Current: <full date>' followed by 'Time zone: <timezone>'
@sebslight sebslight added gateway Gateway runtime and removed gateway Gateway runtime labels Jan 26, 2026
@openclaw-barnacle openclaw-barnacle bot added the agents Agent runtime and tooling label Jan 27, 2026
@sebslight
Copy link
Copy Markdown
Member

Closing due to merge conflicts. Please rebase on main and reopen if you'd like to continue with this contribution.

@sebslight sebslight closed this Jan 28, 2026
@Episkey-G
Copy link
Copy Markdown
Author

Rebased onto latest main (after Moltbot rename). Ready for review.

Changes:

  • ✅ Resolved CHANGELOG conflicts
  • ✅ Lint passed
  • ✅ Force-pushed to feat/system-prompt-full-date

Commit: 596e58e

@Episkey-G
Copy link
Copy Markdown
Author

This PR has been superseded by #3698 after rebasing onto latest main (post-Moltbot rename).

Please review the new PR: #3698

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

Labels

agents Agent runtime and tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Include full date with day of week in system prompt

2 participants