Repository navigation
Description
Summary
In calendar freebusy and calendar conflicts, a calendar name that contains @ (such as Work @ Home) is sent to the API as a literal calendar ID when every selector is primary or contains @. When any other selector needs a calendar-list lookup, the same name resolves to its calendar. So the meaning of one selector depends on the others, and conflicts can report no conflicts for a calendar it never read.
Current (v0.48.0, also main at e8428c3)
Calendar list: me@example.com (primary), Work @ Home (work@group.calendar.google.com), Team (team@group.calendar.google.com). Each has an event from 10:00 to 11:00 on 2027-01-01.
gog calendar freebusy --cal 'Work @ Home' --from 2027-01-01T00:00:00Z --to 2027-01-02T00:00:00Z --json
# request items: [{"id":"Work @ Home"}]
# "Work @ Home": {"errors":[{"domain":"global","reason":"notFound"}]} (exit 0)
gog calendar freebusy --cal 'Work @ Home' --cal Team --from 2027-01-01T00:00:00Z --to 2027-01-02T00:00:00Z --json
# request items: [{"id":"work@group.calendar.google.com"},{"id":"team@group.calendar.google.com"}]
gog calendar conflicts --cal 'Work @ Home' --cal Team --from 2027-01-01T00:00:00Z --to 2027-01-02T00:00:00Z
# CONFLICTS FOUND: 1
gog calendar conflicts --cal 'Work @ Home' --cal primary --from 2027-01-01T00:00:00Z --to 2027-01-02T00:00:00Z
# No conflicts found (exit 0; request items: [{"id":"Work @ Home"},{"id":"primary"}])resolveSelectedCalendarIDsskips the lookup when every input isprimaryor contains@(calendar_util.go#L110-L128). Bothfreebusyandconflictsuse it.resolveCalendarInputschecks calendar names and IDs before it passes an input with@through as an ID (name_resolution.go#L173-L210).calendar events --cal 'Work @ Home'goes through it and resolves the name.
Expected
A selector resolves the same way in every combination. For freebusy and conflicts, that would be the events order: a calendar-list name or ID first, then an input with @ as a raw ID.
One possible approach, not a requirement: let the fast path skip the lookup only for primary and inputs that parse as an email address.
Related
--cal primary --cal me@example.com (the primary calendar's own address) selects one calendar under two IDs, because appendUniqueCalendarID compares ID strings (name_resolution.go#L298). calendar events then lists each event twice, under primary and me@example.com, and --page is rejected as a multi-calendar request. This may be intended; it is listed here because it is the same selection path.
Environment
gog built from main at e8428c3. Reproduced against a local fake of the Calendar API through GOG_GOOGLE_API_BASE_URL.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Nov 11, 2026
Codex review: this still needs some work.
Summary
This issue establishes a current selector-resolution bug that can hide calendar conflicts; the related open PR does not fix it.
Reproducibility: Current source proves that Work @ Home bypasses lookup alone or with primary but resolves with Team; the reporter supplies a synthetic API reproduction, and this read-only review ran no tests.
Next step
Fix the @ fast path and first establish failing regressions showing Work @ Home resolves to the same ID alone, with primary, and with Team.
Review details
Best possible solution:
Make non-address calendar names containing @ enter normal name resolution in both commands, with command-level regression coverage.
Do we have a high-confidence way to reproduce the issue?
Current source proves that Work @ Home bypasses lookup alone or with primary but resolves with Team; the reporter supplies a synthetic API reproduction, and this read-only review ran no tests.
Is this the best way to solve the issue?
Narrowing the fast-path ID classification addresses the demonstrated defect without new options; preserve legitimate raw IDs and establish failing command-level regressions before opening a repair PR.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against e8428c36dd31.
Label changes
Label changes:
P2: A bounded Calendar selector bug produces incorrect availability results for names containing @, with literal calendar IDs available as a workaround.impact:other: Conflict detection can report no overlap after querying the wrong calendar identifier.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:queueable-fix: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.Label justifications:
P2: A bounded Calendar selector bug produces incorrect availability results for names containing @, with literal calendar IDs available as a workaround.impact:other: Conflict detection can report no overlap after querying the wrong calendar identifier.Evidence reviewed
Acceptance criteria:
What I checked:
internal/cmd/calendar_util.go:117, e8428c36dd31)internal/cmd/name_resolution.go:191, e8428c36dd31)internal/cmd/calendar_conflicts.go:87, e8428c36dd31)internal/cmd/calendar_freebusy_conflicts_selection_test.go:17, e8428c36dd31)internal/cmd/calendar_util.go, e19bac1f1ddf)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.Reviewed November 11, 2026, 9:17 AM ET / 14:17 UTC.
fix: preserve workspace request and output contracts
steipete commentedon Nov 14, 2026
Fixed in #1336. Calendar names such as
Work @ Homenow resolve through the calendar list; only actual email-form selectors take the raw-ID fast path.The regression failed against the previous main and passes with the fix. Full
make ci, independent P0–P2 review, and exact-head GitHub CI passed. A built CLI also verified the outgoing request against a synthetic HTTP endpoint.