Skip to content

Agents don't know the current date on /new, /reset, or post-compaction — YYYY-MM-DD in AGENTS.md is literal, not substituted #32363

@andrade-igor

Description

@andrade-igor

Problem

The default AGENTS.md template instructs agents to read memory/YYYY-MM-DD.md (today + yesterday) at session startup. However, YYYY-MM-DD is literal text — there is no runtime substitution in the bootstrap/session-startup flow.

The system prompt provides the user's timezone but never the current date. As a result, agents guess the date based on their training cutoff (e.g., Claude Sonnet 4.6 guesses ~July 2025 when the actual date is March 2026).

Where substitution DOES work

  • memoryFlush prompt — YYYY-MM-DD is replaced with the actual date via replaceAll("YYYY-MM-DD", dateStamp) (confirmed in source)
  • Heartbeat — the date is injected in the heartbeat time section

Where it does NOT work

  • /newBARE_SESSION_RESET_PROMPT re-reads Session Startup from AGENTS.md, agent sees literal YYYY-MM-DD
  • /reset — same path
  • Post-compaction — post-compaction-context.ts extracts Session Startup, same literal text
  • First session — initial bootstrap, same literal text

Observed behavior

  • Agents with many daily notes (e.g., main agent) can work around this by listing memory/ directory and inferring the date from filenames
  • Agents with few or no daily notes guess wrong consistently
  • Tested across multiple agents on the same instance — all agents without daily note history fail to determine the correct date

Expected behavior

The current date should be available to agents at session startup, either by:

  1. Injecting the date into the system prompt (like timezone already is), or
  2. Performing runtime YYYY-MM-DD substitution in AGENTS.md at bootstrap, or
  3. Exposing a session_status / date tool that agents can call

Environment

  • OpenClaw 2026.3.1
  • Model: Anthropic Claude Sonnet 4.6
  • VPS (Ubuntu), single-agent and multi-agent setup

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions