feat(chat): read the primary calendar for an explicit time range - #134
Open
Excelius-Wang wants to merge 1 commit into
Open
Excelius-Wang wants to merge 1 commit into
Excelius-Wang wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Chat currently reads calendar data through delegated workspace snapshots. Add a read-only
read_calendartool 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 typecheckandpnpm --dir apps/worker typecheck— passed.pnpm test— 289/289 passed, no failures or skips; adds 12 conversation tests and one Google adapter test.pnpm build:server— passed.pnpm build:web --max-workers 2,pnpm build:ios --max-workers 2,pnpm build:android --max-workers 2— 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.