feat: add 3-letter DOW prefix to injected timestamps

Changes [2026-01-28 20:30 EST] to [Wed 2026-01-28 20:30 EST].
Costs ~1 extra token but provides day-of-week for smaller models
that can't derive DOW from a date. Frontier models already handle
it, but this is cheap insurance for 7B-class models.
This commit is contained in:
Conroy Whitney
2026-01-28 22:07:26 -05:00
committed by Tak Hoffman
parent 76391bba3f
commit a6c68e8690
3 changed files with 20 additions and 13 deletions

View File

@@ -53,7 +53,13 @@ export function injectTimestamp(message: string, opts?: TimestampInjectionOption
const formatted = formatZonedTimestamp(now, timezone);
if (!formatted) return message;
return `[${formatted}] ${message}`;
// Add 3-letter day-of-week for smaller models that can't derive DOW
// from a date. Costs ~1 token, cheap insurance.
const dow = new Intl.DateTimeFormat("en-US", { timeZone: timezone, weekday: "short" }).format(
now,
);
return `[${dow} ${formatted}] ${message}`;
}
/**