feat(ai): date_info tool for exact date arithmetic

Small local models get weekdays, "how long ago" and day counts between dates
wrong, confidently. Persona chats anchored on old SMS threads ask exactly
those questions. date_info answers them exactly, in the owner's display zone:
- no args: now (replaces get_current_datetime)
- date: its weekday and how long ago / until
- date + other_date: the gap in days, weeks and years/months/days, plus
  hours when both carry times
- date + add_days: the date N days after (or before)

Checked live on gemma4-26b-A4B and gemma4-31: each date question took one
date_info call and came back correct.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cameron CordesandClaude Opus 5.5 committed 2026-10-18 20:33:00 -04:00
1 parent 7215c1bdfe
commit edfa48d116
4 files changed
+378 -23

No files matched your search

+2 -2
View File
@@ -55,7 +55,7 @@ can be read aloud in a few seconds. Avoid generic filler like \"what a \
wonderful day\" — if you have little to go on, simply describe the moment \
plainly.\n\nYou may call read-only tools (search_rag, search_messages, \
get_sms_messages, get_calendar_events, get_location_history, reverse_geocode, \
get_personal_place_at, recall_entities, get_current_datetime) to ground each \
get_personal_place_at, recall_entities, date_info) to ground each \
line in real context — e.g. reverse_geocode a moment's GPS to name the place, \
or check the calendar/messages around its date. Never invent details. Return \
ONLY the JSON object, no prose or code fences.";
@@ -335,7 +335,7 @@ pub async fn generate_script_agentic(
"reverse_geocode",
"get_personal_place_at",
"recall_entities",
"get_current_datetime",
"date_info",
]
.into_iter()
.collect();