System prompt: include weekday in Current Date & Time section#40199
System prompt: include weekday in Current Date & Time section#40199ishitadatta wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR adds a
Confidence Score: 5/5
Last reviewed commit: 4a32ea0 |
sriram369
left a comment
There was a problem hiding this comment.
Thanks for tackling this — weekday context is genuinely useful for scheduling-aware agents.
Two concerns worth discussing before this lands:
1. This conflicts with the documented preferred approach
The existing test has a comment pointing to #3658 as the preferred direction:
gateway-level timestamp injection into messages, not the system prompt
This PR goes the other way. Has that issue been revisited and closed as won't-do? If message-level injection is still the plan, this adds complexity in the wrong layer.
2. The weekday still causes daily cache churn
The original date/time was removed because it changed on every request. A weekday changes once per day — much better, but still a guaranteed daily cache miss for every agent that has userTime set. For high-volume local-model setups (exactly the users most sensitive to caching, like the Qwen3/MLX crowd), that's a cold restart every 24 hours.
3. The test comment was softened
The original comment read:
"The system prompt intentionally does NOT include the current date/time. Only the timezone is included, to keep the prompt stable for caching."
This PR changes it to:
"The system prompt intentionally does NOT include the full current date/time. Timezone and weekday are included..."
That's a meaningful architectural position being quietly revised inside a test comment. If the project is intentionally relaxing the caching guarantee, it deserves an explicit decision rather than a comment edit.
Not blocking — just flagging these for maintainer awareness before merge.
|
Hi Sriram thanks, this is very fair feedback. You’re right on all three points: Layering / architecture: Cache behavior: Comment change: Given this, I’m happy to rework the contribution in one of these ways (maintainer preference): A) Close this PR and open a new one that adds/improves message-level weekday/timestamp injection, or |
Summary
Adds a weekday line to the runtime system prompt time section when
userTimeis available.Before:
## Current Date & TimeTime zone: America/New_YorkAfter:
## Current Date & TimeTime zone: America/New_YorkDay of week: MondayWhy
This improves schedule/calendar reliability without reintroducing full date/time churn in the system prompt.
Scope
src/agents/system-prompt.tsuserTimeand injectDay of week: <weekday>.src/agents/system-prompt.test.tsValidation
npx vitest run src/agents/system-prompt.test.ts(43 tests passed)Relates to #9899.