fix: include day of week in date/time context injection (#4629)#4637
fix: include day of week in date/time context injection (#4629)#4637krishnpalchouhan wants to merge 4 commits intoopenclaw:mainfrom
Conversation
The system prompt now displays the full formatted time including the day of week (e.g., "Current time: Monday, January 5th, 2026 — 3:26 PM (America/Chicago)") instead of just showing the timezone.
|
@greptile This is a 0/5 as it destroys an intentional feature. |
|
You're absolutely right — this PR undoes an intentional performance optimization. What was destroyed: Commit 66eec29 ("perf: stabilize system prompt time") deliberately removed the current time from the system prompt to improve prompt cache stability. Including a timestamp that changes every minute breaks Anthropic's prompt caching, significantly increasing costs and latency. The intentional design is:
Why this PR is problematic:
The correct approach: Issue #10836 shows the right solution: enhance This PR should be closed in favor of #10836's approach, which solves the underlying problem without sacrificing performance. |
The system prompt now displays the full formatted time including the day of week (e.g., "Current time: Monday, January 5th, 2026 — 3:26 PM (America/Chicago)") instead of just showing the timezone.
Greptile Overview
Greptile Summary
This PR updates the system prompt’s “Current Date & Time” section to include the fully formatted current time (optionally supplied via
params.userTime) alongside the user’s timezone, while preserving the previous behavior of showing only the timezone when no formatted time is provided. Tests were adjusted to assert the new “Current time: … (TZ)” output for both 12-hour and 24-hour formats.Confidence Score: 5/5
userTimezonepresence; it preserves prior output whenuserTimeis not provided, and the updated tests cover both 12-hour and 24-hour cases plus the fallback timezone-only case.(2/5) Greptile learns from your feedback when you react with thumbs up/down!