Skip to content

feat(google): Learn longer working hours from past meetings - #2252

Open
sentry-junior[bot] wants to merge 4 commits into
mainfrom
feat/google-saved-working-hours
Open

sentry-junior[bot] wants to merge 4 commits into
mainfrom
feat/google-saved-working-hours

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Google Calendar's public API does not return the working hours people set in Calendar. So findMeetingTimes used one shared 09:00–17:00 window for everyone. With that window, London and Los Angeles share no time, even when someone in London often takes calls until 22:00.

We decided not to keep a copy of people's hours in Junior. Instead, findMeetingTimes learns longer hours from each person's past meetings:

  • Junior already sent one events.list request per attendee to read the calendar time zone. That request now also returns the attendee's last 3 weeks of events, with only times, transparency, and attendees (no titles or descriptions). This adds no requests.
  • A meeting is a timed, busy event with at least one other attendee that the person did not decline. Blocks that people hold alone, such as "do not schedule" holds, focus time, or personal events, do not count. Free/busy still marks those blocks as busy, so slots never go into them.
  • When at least 3 past weekdays had a meeting before 09:00 or after 17:00, the person's hours grow to include that time, rounded out to 30 minutes. The hours never shrink. Meetings on weekends or that cross local midnight are ignored.
  • workdayStart/workdayEnd are now optional. When the requester asks for a time of day, the requested value replaces the learned value.
  • checked[] reports the hours searched for each person. fromMeetings is true when past meetings made the hours longer.
  • When a calendar is shared as free/busy only, Junior cannot see attendees, so that person keeps 09:00–17:00.

An earlier commit on this branch added a stored setWorkingHours tool. Later commits remove it, so the final diff has no table, migration, or new tool.

Checks

  • pnpm --filter @sentry/junior-google test: 23 passed. The test covers late calls, do-not-schedule holds, declined calls, and weekend calls.
  • typecheck, lint, prettier --check: clean
  • Not run: live Google QA and evals. In the eval fixture, the events.list handler returns events without attendees, so evals keep 09:00–17:00.

Refs #2063

via David Cramer.

--

View Junior Session [Sentry]

@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Oct 27, 2026 7:18pm UTC

Request Review

sentry-junior Bot and others added 2 commits October 27, 2026 18:54
Google Calendar does not expose the working hours people set in Calendar,
so findMeetingTimes used one shared 09:00-17:00 window for everyone.

Add setWorkingHours, which saves the requester's own weekday hours in a
new junior_google_working_hours table. findMeetingTimes now searches each
person's saved hours, else 09:00-17:00. A requested time of day can narrow
saved hours but never widen them, and checked[] reports the hours used.

Refs #2063

Co-Authored-By: David Cramer <david@sentry.io>
Drop the stored working hours. Junior should not keep its own copy of
people's hours.

findMeetingTimes now reads the last 3 weeks of free/busy data in the same
query. When at least 3 past weekdays had a meeting before 09:00 or after
17:00 for a person, their hours grow to include that time. The hours never
shrink, and a time of day that the requester asks for replaces them.

Refs #2063

Co-Authored-By: David Cramer <david@sentry.io>
@sentry-junior
sentry-junior Bot force-pushed the feat/google-saved-working-hours branch from 2353b40 to f34db5d Compare October 27, 2026 18:54
@sentry-junior sentry-junior Bot changed the title feat(google): Let people save their own working hours for scheduling feat(google): Learn longer working hours from past meetings Oct 27, 2026
Do-not-schedule blocks, focus time, and personal events are busy in
free/busy, so they made people's learned hours longer. Read the last 3
weeks of each person's events instead, in the request that already reads
the calendar time zone. Count only timed, busy events with another
attendee that the person did not decline.

Refs #2063

Co-Authored-By: David Cramer <david@sentry.io>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 791976e. Configure here.

@sentry-evals

sentry-evals Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Sentry Evals

junior-behavioral

Run Status Passed Failed Errored Cost Tokens Duration
Head Failed 72 3 0 $1.02 0 440.54s

Base commit b175690 has no eval run to compare against.

junior-integration

Run Status Passed Failed Errored Cost Tokens Duration
Head Passed 101 0 0 $0.97 0 307.99s

Base commit b175690 has no eval run to compare against.

The events field mask asks only for start/dateTime and end/dateTime, so
Google leaves out start and end of all-day events. The history schema
required both, so findMeetingTimes failed for any calendar with an
all-day event in the last 3 weeks. Make them optional and skip such
events.

Refs #2063

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 55e5503c Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants