-
-
Notifications
You must be signed in to change notification settings - Fork 39.6k
Closed
Description
Description
buildTimeSection() in system-prompt.ts only outputs the user's timezone in the system prompt, but does not include the formatted date/time string (userTime). This causes the LLM to fall back to its training data cutoff year when referencing dates (e.g., writing 2025-02-15 instead of 2026-02-15 for memory file paths).
Current behavior
The system prompt includes:
## Current Date & Time
Time zone: America/New_York
The agent has no reliable way to know the current date and guesses wrong.
Expected behavior
## Current Date & Time
Now: Saturday, February 15th, 2026 — 7:47 PM
Time zone: America/New_York
Root cause
buildTimeSection() receives only { userTimezone } but the caller (buildAgentSystemPrompt) already has access to userTime via params — it's computed by formatUserTime() in buildSystemPromptParams() and passed through, but never used.
// current code
function buildTimeSection(params) {
if (!params.userTimezone) return [];
return [
"## Current Date & Time",
`Time zone: ${params.userTimezone}`,
""
];
}
// call site
...buildTimeSection({ userTimezone }), // userTime not passedSuggested fix
function buildTimeSection(params) {
if (!params.userTimezone) return [];
const lines = ["## Current Date & Time"];
if (params.userTime) lines.push(`Now: ${params.userTime}`);
lines.push(`Time zone: ${params.userTimezone}`, "");
return lines;
}
// call site
const userTime = params.userTime?.trim();
...buildTimeSection({ userTimezone, userTime }),Impact
- Memory flush creates files with wrong year (e.g.,
memory/2025-02-15.mdinstead ofmemory/2026-02-15.md) - Any date-sensitive agent behavior is unreliable
- Affects all sessions (interactive, cron, sub-agents)
Version
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels