mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 12:41:23 +00:00
fix(system-prompt): hint session_status for date/time instead of embedding it
The system prompt intentionally excludes the current date/time for cache
stability (see 66eec295b). 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
This commit is contained in:
@@ -51,7 +51,12 @@ function buildUserIdentitySection(ownerLine: string | undefined, isMinimal: bool
|
||||
|
||||
function buildTimeSection(params: { userTimezone?: string }) {
|
||||
if (!params.userTimezone) return [];
|
||||
return ["## Current Date & Time", `Time zone: ${params.userTimezone}`, ""];
|
||||
return [
|
||||
"## Current Date & Time",
|
||||
`Time zone: ${params.userTimezone}`,
|
||||
"If you need the current date, time, or day of week, use the session_status tool.",
|
||||
"",
|
||||
];
|
||||
}
|
||||
|
||||
function buildReplyTagsSection(isMinimal: boolean) {
|
||||
|
||||
Reference in New Issue
Block a user