mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 16:48:26 +00:00
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:
committed by
Tak Hoffman
parent
76391bba3f
commit
a6c68e8690
@@ -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}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user