fix(calendar-tool): forbid placeholder events in create_event description

Reproducer (2026-04-29 dentist appointment): user said "this Friday,
I have an appointment" with no other details. The model immediately
called create_event with title="Appointment", description="User
mentioned an appointment this Friday but hasn't provided details
yet.", all_day=true. THEN it asked the user for time/location in
its reply. When the user came back with "8am at my dentist for
permanent crown fitting", the model called update_event — but never
updated the title, leaving the placeholder "Appointment" in the
calendar permanently.

The bug isn't about the tool surface, it's that the model created
an event before it had real content. The system prompt had no rule
against this, so the model hedged: "log a placeholder, ask for
details, then update". That pattern pollutes the calendar with
garbage titles and forces immediate update_event calls.

create_event tool description now includes an explicit anti-pattern:
record a moment, ask for the missing pieces, and only call create_event
once you have actual title + time + location. Stand-in titles like
"Appointment" / "Meeting" / "Event" with "details TBD" descriptions
are explicitly named as the failure mode.

Pure prompt change. 18 tests pass; ruff clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-29 10:54:39 -04:00
parent 9f8b451d15
commit 35fab6cbf7
+11 -1
View File
@@ -149,7 +149,17 @@ def _validate_weekday(start_dt_utc: datetime, user_tz, expected: str | None) ->
"When the user names a weekday ('this Friday', 'next Monday'), "
"state the resolved calendar date in your reply BEFORE calling "
"this tool, and pass `expected_weekday` so the server can verify "
"the date falls on the day you intended."
"the date falls on the day you intended.\n\n"
"DON'T call this tool with placeholder values. If the user "
"mentions an event without giving you concrete details (a real "
"title, a specific time, and location when it applies), record "
"a moment instead and ask for the missing pieces — do NOT create "
"an event with a stand-in title like 'Appointment', 'Meeting', "
"or 'Event' and a description that says 'details TBD'. Wait for "
"the user's reply, then call create_event ONCE with the actual "
"title, time, and location. Premature placeholder events pollute "
"the calendar and require an immediate update_event to fix — "
"both visible to the user, neither what they asked for."
),
parameters={
"title": {"type": "string", "description": "A descriptive event title"},