Skip to content

fix #1072: calendar event creation — natural phrasing, ordinal dates, calendar alias#1077

Open
lokhor wants to merge 5 commits into
mainfrom
feature/1072-calendar-event-fix
Open

fix #1072: calendar event creation — natural phrasing, ordinal dates, calendar alias#1077
lokhor wants to merge 5 commits into
mainfrom
feature/1072-calendar-event-fix

Conversation

@lokhor
Copy link
Copy Markdown
Collaborator

@lokhor lokhor commented Jun 3, 2026

Closes #1072

Problem

"add something to the calendar for the 9th of june" failed in three ways:

  1. QIR regex had no pattern for add X to [my] calendar where X isn't a known event noun
  2. LLM called load_skill("calendar") which doesn't exist — calendar is an intent within run_intent
  3. Date parsing didn't handle ordinal suffixes ("9th of June")

Changes

QuickIntentRouter.kt

  • New regex pattern for natural calendar phrasing: add/create/schedule/put/book X to/in/on my calendar
  • Ordinal date extraction: parses "9th of June", "June 9th" in extractCalendarHints
  • Title extraction fix: added to|in|into to titleFromVerb/titleFromFor lookaheads to prevent greedy capture reaching end-of-string
  • Added "something" to GENERIC_CALENDAR_TITLES — triggers NeedsSlot for title instead of using it as event title

NativeIntentHandler.kt

  • resolveDate strips ordinal suffixes (st|nd|rd|th) before DateTimeFormatter parsing

LoadSkillSkill.kt

  • Calendar alias: load_skill("calendar") redirects to run_intent instructions
  • Improved error message hints that calendar/alarm/SMS use run_intent

Tests

  • 7 new/updated test cases in QuickIntentRouterTest (including ordinal date extraction)
  • 1 new test in NativeIntentHandlerTest for ordinal date parsing
  • :core:skills:test — 1481 tests pass | :core:skills:lint — clean

Manual Test Scenarios

Run on device via adb logcat -s KernelAI. All queries assume an S23 Ultra with Google Calendar installed.

Happy path — natural phrasing with relative dates

# Query Expected intent Expected params
1 "add dentist to my calendar on Friday at 2pm" create_calendar_event title="Dentist", date="friday", time="2pm"
2 "put lunch in my calendar tomorrow" create_calendar_event title="Lunch", date="tomorrow", time=null
3 "schedule meeting in my calendar this friday at 3pm" create_calendar_event title="Meeting", date="friday", time="3pm"
4 "book gym session in my calendar on Monday" create_calendar_event title="Gym Session", date="monday", time=null

Happy path — ordinal dates

# Query Expected intent Expected params
5 "add lunch to my calendar on June 9th at 2pm" create_calendar_event title="Lunch", date="9 June", time="2pm"
6 "add lunch to my calendar on 9th of June" create_calendar_event title="Lunch", date="9 June", time=null
7 "add dentist to my calendar on the 15th of August" create_calendar_event title="Dentist", date="15 August", time=null

NeedsSlot — missing title

# Query Expected result
8 "add something to my calendar" NeedsSlot for "title"
9 "put something in my calendar for tomorrow" NeedsSlot for "title" (date="tomorrow" preserved)

NeedsSlot — missing date

# Query Expected result
10 "add dentist appointment to my calendar" NeedsSlot for "date" (title="Dentist Appointment")
11 "book meeting in my calendar" NeedsSlot for "date" (title="Meeting")

Fallback — E4B (LLM) path

# Query Expected behavior
12 "add a really complicated event with multiple attendees to my calendar" Falls through to E4B/LLM for structured extraction
13 "tell me about calendar events next week" Falls through to E4B/LLM (read, not create)

Calendar alias verification

# Action Expected result
14 LLM calls load_skill("calendar") Returns run_intent instructions with create_calendar_event

Edge cases

# Query Expected behavior
15 "add calendar voice memo" NOT matched by calendar regex (excluded via negative lookahead)
16 "add note to calendar" NOT matched by calendar regex (excluded via negative lookahead)
17 "create an event" NeedsSlot for "title" (generic title "Event" filtered)
18 "put a meeting in my calendar on jan 20th" title="Meeting", date="20 January" (ordinal + short month)

lokhor added 2 commits June 2, 2026 22:37
…roller

When Android TTS drops an onDone/onError callback (audio routing
interference, engine glitch), completePlaybackIfDrained waits forever
with non-empty utteranceIds and never emits SpeakingStopped, leaving
the UI stuck on 'Speaking response...'.

Add a 30-second safety-net timeout that fires after the final chunk is
queued. If TTS callbacks haven't drained all utterances by then, the
timeout force-cleans the playback state and emits SpeakingStopped.

Cancels automatically on natural completion or explicit stop().
…, calendar alias

- QIR regex: new pattern catches "add X to [my] calendar" for any noun X
- Date extraction: parse ordinal dates ("9th of June", "June 9th") in extractCalendarHints
- Title extraction: add to/in/into to title lookaheads; add "something" to generic titles
- resolveDate: strip ordinal suffixes before DateTimeFormatter parsing
- load_skill: redirect "calendar" alias to run_intent instructions
- Error message: hint that calendar/alarm/SMS use run_intent
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Debug APK ready

Download app-debug.apk

Commit: 31c4d47 - Build #2103

Updated on each push. Removed when PR is merged or closed.

- "add lunch to my calendar on June 9th at 2pm" — month-first ordinal
- "add lunch to my calendar on 9th of June" — ordinal-first with "of"
@lokhor lokhor changed the title fix(#1072): calendar event creation — natural phrasing, ordinal dates, calendar alias fix #1072: calendar event creation — natural phrasing, ordinal dates, calendar alias Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug adding event to calendar

2 participants