Skip to content

feat(chat): read the primary calendar for an explicit time range - #134

Open
Excelius-Wang wants to merge 1 commit into
CopilotKit:mainfrom
Excelius-Wang:feat/chat-calendar-read
Open

Excelius-Wang wants to merge 1 commit into
CopilotKit:mainfrom
Excelius-Wang:feat/chat-calendar-read

Conversation

@Excelius-Wang

Copy link
Copy Markdown

What changed

Chat currently reads calendar data through delegated workspace snapshots. Add a read-only read_calendar tool so a model conversation can directly query the connected primary calendar for an explicit time window. Require offset-bearing RFC3339 bounds with a positive duration of at most 366 days, using shared range validation and the existing owner-scoped workspace, Google client, authentication and event mapper.

Preserve disconnected/error results and provider pagination status instead of presenting incomplete results as an empty or complete calendar. Bound chat output to 20 events and clip text without splitting surrogate pairs. Existing array APIs remain compatible, and calendar mutations still require the existing persisted action review.

Also correct sample all-day overlap to compare dates in the event's calendar time zone, including exclusive-end and skipped-midnight DST boundaries. Reuse the mobile date formatter in the domain package, with ISO year formatting for accepted date boundaries. The sample bug was reproduced through authenticated create → approve → query on unmodified main: a Los Angeles all-day event was missing from that evening's query and incorrectly included in the previous evening's query. Both results are correct after this change.

No new connector, dependency, database table or UI. The tool is for the model backend; the sample chat backend retains its canned responses.

Verification

  • pnpm lint — passed.
  • pnpm typecheck and pnpm --dir apps/worker typecheck — passed.
  • pnpm test — 289/289 passed, no failures or skips; adds 12 conversation tests and one Google adapter test.
  • Focused conversation/Google/mobile date tests — 43/43 passed.
  • pnpm build:server — passed.
  • pnpm build:web --max-workers 2, pnpm build:ios --max-workers 2, pnpm build:android --max-workers 2 — passed.
  • Authenticated sample calendar API baseline/fixed comparison — passed.

Conversation coverage exercises the actual agent, SDK tool transport, temporary owner-scoped storage and scripted model/Google HTTP fixtures. It covers range validation, isolation, disconnection versus empty success, provider failures, all-day/time zones/DST, partial pages and bounded Unicode output.

Integration limits

Real Google account/OAuth acceptance and real-model date clarification/answer quality were not tested. Platform checks are bundle exports, not native-device acceptance. Browser/computer/Docker paths were unchanged and were not retested for this contribution. The sample API reproduction is not evidence of a live Google production incident.

Related: #96 addresses UI all-day comparisons and touches the mobile date file reused here; #110 scopes delegated workspace reads. This change adds the separate direct chat range tool and does not close either PR.

This branch has not been deployed

No deployments
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.

1 participant