mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 20:18:28 +00:00
revert: drop "Current Date:" label, keep [Wed YYYY-MM-DD HH:MM TZ]
Small model testing showed the label did not meaningfully help: - Sub-3B models fail regardless of format - 8B models untested with label specifically - Frontier models never needed it The bracket convention [Wed 2026-01-28 22:30 EST] matches existing channel envelope format and is widely present in training data. Saves ~2-3 tokens per message vs the labeled version.
This commit is contained in:
committed by
Tak Hoffman
parent
b6c8c1e89d
commit
8a5b139a9f
@@ -53,14 +53,13 @@ export function injectTimestamp(message: string, opts?: TimestampInjectionOption
|
||||
const formatted = formatZonedTimestamp(now, timezone);
|
||||
if (!formatted) return message;
|
||||
|
||||
// "Current Date:" label is unambiguous even for tiny models (1.7B+).
|
||||
// 3-letter DOW included because small models can't derive it from a date.
|
||||
// Total cost: ~18 tokens — saves thousands when it prevents hallucination.
|
||||
// 3-letter DOW: small models (8B) can't reliably derive day-of-week from
|
||||
// a date, and may treat a bare "Wed" as a typo. Costs ~1 token.
|
||||
const dow = new Intl.DateTimeFormat("en-US", { timeZone: timezone, weekday: "short" }).format(
|
||||
now,
|
||||
);
|
||||
|
||||
return `[Current Date: ${dow} ${formatted}] ${message}`;
|
||||
return `[${dow} ${formatted}] ${message}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user