fix(system-prompt): hint session_status for date/time instead of embedding it#3677
Merged
Takhoffman merged 2 commits intoopenclaw:mainfrom Feb 1, 2026
Merged
Conversation
…dding it The system prompt intentionally excludes the current date/time for cache stability (see 66eec29). This leaves agents without date awareness, causing wrong day-of-week claims (openclaw#1897, openclaw#1928, openclaw#2108). Instead of reverting the cache optimization, add a one-line hint directing agents to use session_status when they need the current date/time. This keeps the prompt stable while teaching frontier models where to look. Also adds a negative test ensuring the date/time is NOT re-added to the system prompt, with comments explaining why and pointing to openclaw#3658 for the complementary gateway-level timestamp injection approach. Refs: openclaw#1897, openclaw#1928, openclaw#3658
orzelig
approved these changes
Jan 29, 2026
orzelig
left a comment
There was a problem hiding this comment.
Excellent fix! The hint preserves cache stability while giving models the right tool to check date/time. Comprehensive QA shows it works well for main sessions. Good negative test ensuring the date isn't re-added. The detailed testing documentation is super helpful. LGTM!
3 tasks
80ee7c9 to
034d451
Compare
Contributor
|
Lgtmi |
|
Same note as on #3705 — the macOS CI jobs were cancelled with 0 steps executed (self-hosted runner likely needs approval for external contributors). All non-macOS checks pass. Thanks! 🦞 |
Takhoffman
added a commit
that referenced
this pull request
Feb 1, 2026
uxcu
pushed a commit
to uxcu/kook-openclaw
that referenced
this pull request
Feb 5, 2026
…status-time-hint fix(system-prompt): hint session_status for date/time instead of embedding it
4 tasks
This was referenced Feb 8, 2026
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…status-time-hint fix(system-prompt): hint session_status for date/time instead of embedding it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The system prompt intentionally excludes the current date/time for cache stability (see 66eec29). This leaves agents without date awareness, causing wrong day-of-week claims (#1897, #1928, #2108).
Instead of reverting the cache optimization, add a one-line hint directing agents to use session_status when they need the current date/time. This keeps the prompt stable while teaching frontier models where to look.
Also adds a negative test ensuring the date/time is NOT re-added to the system prompt, with comments explaining why and pointing to #3658 for the complementary gateway-level timestamp injection approach.
Refs: #1897, #1928, #3658
QA Results
Before Fix (no hint in prompt)
Test 1:
Test 2:
Test 3:
After Fix — Main Session (full prompt)
Test 1:
Test 2:
Test 3:
After Fix — Spawned Subagent Sessions (minimal prompt)
We verified via debug logging that
isMinimaldoes not strip the time hint —buildTimeSectionis not gated byisMinimal, only byuserTimezone. Confirmed:promptMode=minimal | hasTimeHint=true.However, spawned agents behave differently:
exec dateexec python3exec dateexec python3exec dateexec dateKey findings:
execoversession_status(reasonable — more direct)session_statuscalls across all spawned tests —execis the natural instinctComplementary Fix: Gateway Timestamp Injection (#3658)
This hint helps frontier models that think to check, but doesn't help when models skip checking entirely. #3658 (gateway timestamp injection) is the stronger complement — it injects the date into the user message itself so models don't need to look it up.
However, #3658 as proposed injects timestamps into incoming user messages at the gateway level. Spawned subagent tasks may need the same treatment — the task text passed via
sessions_spawngoes throughcallGateway({ method: "agent", params: { message: task } })and currently has no timestamp injected. If #3658 only covers inbound channel messages (TUI/web), spawned agents would still be blind.🤖 AI-Assisted
This PR was developed and tested collaboratively between a human and an AI agent (Claude, running in Moltbot). Testing included spawned-session tests across multiple rounds, debug logging verification, and live main-session QA. We understand what the code does — it's a one-line hint + a guardrail test.