Skip to content

Commit 8286bbe

Browse files
committed
fix(email): surface calendar truncation in the API
1 parent a641abd commit 8286bbe

11 files changed

Lines changed: 8369 additions & 8305 deletions

hub/agents/email/python/CHANGELOG.md

Lines changed: 1118 additions & 1114 deletions
Large diffs are not rendered by default.

hub/agents/email/python/CONTRACT.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,9 @@ and is **Gmail-only** (a request resolving to an Outlook mailbox is rejected
505505
- `GET /v1/email/calendar/events``CalendarEventsResponse` (read-only view;
506506
`CalendarEvent` flattens provider start/end strings). `time_min`/`time_max`
507507
are optional; omitting both defaults to a forward window (now → +30 days) so
508-
recurring series don't surface their oldest instances (#2162).
508+
recurring series don't surface their oldest instances (#2162). The response
509+
includes `count` for the returned page and `truncated: true` when the
510+
provider reports another page; a truncated response is not a complete window.
509511
- `POST /v1/email/calendar/events/preview``CalendarEventPreviewResponse` mints
510512
a confirmation token bound to the event.
511513
- `POST /v1/email/calendar/events` (`CalendarCreateEventRequest`) creates the

hub/agents/email/python/gaia_agent_email/api_routes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3261,7 +3261,11 @@ async def list_calendar_events(
32613261
)
32623262
for e in data.get("events", [])
32633263
]
3264-
return CalendarEventsResponse(events=events)
3264+
return CalendarEventsResponse(
3265+
events=events,
3266+
count=len(events),
3267+
truncated=bool(data.get("truncated", False)),
3268+
)
32653269

32663270

32673271
@router.post("/calendar/events/preview", response_model=CalendarEventPreviewResponse)

hub/agents/email/python/gaia_agent_email/contract.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,16 @@ class CalendarEventsResponse(_Strict):
11501150
events: List[CalendarEvent] = Field(
11511151
default_factory=list, description="Matching events, ordered by start time."
11521152
)
1153+
count: int = Field(
1154+
default=0, ge=0, description="Number of events returned in this page."
1155+
)
1156+
truncated: bool = Field(
1157+
default=False,
1158+
description=(
1159+
"True when the provider reported another page; the events list is "
1160+
"not the complete calendar window."
1161+
),
1162+
)
11531163

11541164

11551165
class CalendarCreateEventRequest(_Strict):

hub/agents/email/python/gaia_agent_email/outlook_calendar_backend.py

Lines changed: 380 additions & 380 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)