Problem
formatDate in packages/runtime/src/system-prompt/session-environment-prompt.ts builds "Today's date" with new Date(now).toISOString().slice(0,10) (UTC). Near local midnight (UTC+8 00:30 = UTC 16:30 previous day) the injected date is one day behind local "today", which can mislead date-sensitive answers.
Scope
Shared fragment — both desktop and CLI TUI turn-tail use buildSessionEnvironmentPromptFragment, so both are affected. Desktop tests currently pin UTC dates (now: '2026-05-29T12:34:56Z' → 2026-05-29).
Repro
now = 2026-05-29T16:30:00Z, TZ UTC+8 → local 2026-05-30 00:30, but formatDate returns 2026-05-29.
Options
- A: switch
formatDate to local timezone, keep "Today's date" - B: remove date injection
- C: pass UTC ISO + local timezone name, explicit semantics
Verification
Fixed-now test crossing UTC midnight (2026-05-29T16:30:00Z in UTC+8 = local 2026-05-30).
Context
Spun out of PR #531 review (P2, non-blocking). #531 ships CLI system-prompt injection; this is the shared date-fragment timezone semantics, deferred to keep #531 scoped.
Problem
formatDateinpackages/runtime/src/system-prompt/session-environment-prompt.tsbuilds "Today's date" withnew Date(now).toISOString().slice(0,10)(UTC). Near local midnight (UTC+8 00:30 = UTC 16:30 previous day) the injected date is one day behind local "today", which can mislead date-sensitive answers.Scope
Shared fragment — both desktop and CLI TUI turn-tail use
buildSessionEnvironmentPromptFragment, so both are affected. Desktop tests currently pin UTC dates (now: '2026-05-29T12:34:56Z'→2026-05-29).Repro
now = 2026-05-29T16:30:00Z, TZ UTC+8 → local2026-05-30 00:30, butformatDatereturns2026-05-29.Options
formatDateto local timezone, keep "Today's date"Verification
Fixed-
nowtest crossing UTC midnight (2026-05-29T16:30:00Zin UTC+8 = local2026-05-30).Context
Spun out of PR #531 review (P2, non-blocking). #531 ships CLI system-prompt injection; this is the shared date-fragment timezone semantics, deferred to keep #531 scoped.