Skip to content

fix(plugins): preserve Google Calendar timestamp offsets - #13284

Closed
kaijakagi-sys wants to merge 5 commits into
BasedHardware:mainfrom
kaijakagi-sys:fix/calendar-offset-13149
Closed

kaijakagi-sys wants to merge 5 commits into
BasedHardware:mainfrom
kaijakagi-sys:fix/calendar-offset-13149

Conversation

@kaijakagi-sys

@kaijakagi-sys kaijakagi-sys commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #13149.

Preserve the UTC-normalization implementation merged in #13528 and close the remaining fractional-second UTC Z parsing gap. The parser lowercases input first, so its fallback must replace lowercase z. This is the original lowercase-normalization correction from this PR, now narrowed to the one-line residual against current main. No upstream offset normalization is reverted.

Verification

  • Original complete-module handler regression suite against main 9180aff1: 3 failing fractional-UTC subcases. With the one-line residual fix: all 5 methods / 25 subcases pass.
  • Tests exercise production parser, create/update handlers and request construction with framework/storage/HTTP doubles; cover positive/negative offsets, fractional/nonfractional UTC, naive inputs, all-day dates, invalid inputs and default duration.
  • Existing upstream manifest entries preserved; original suite registered for local and CI.
  • make preflight with the draft PR body and explicit local PR-body checks: all 14 selected checks pass.
  • No live Google API, OAuth, Redis, FastAPI routing or Pydantic serialization exercised. No dependencies installed. History-dependent checks cannot establish their full window in the shallow checkout. Backend Hermetic Merge Gate is out of scope for this standalone plugin.

Product invariants affected

none

Failure-Class: none

Reward status

The issue's suggested bounty remains unapproved. This is an existing contribution revision, not a claim of award or payment.

The regression remains plugin-local because the datetime parser and event payload contract are local to this integration; it catches the concrete #13149 failure without introducing a shared runtime guard.

Failure-Class: none

Fixes BasedHardware#13149. Preserve fractional offset instants and normalize lowercased UTC z.
Offline production handler regression: 9 failures before, 25 subcases pass after.
Local preflight: 14 checks pass; shallow-history checks limited.

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread plugins/omi-google-calendar-app/main.py Resolved
@Git-on-my-level

Copy link
Copy Markdown
Member

Verified this fix end to end - the bug report in #13149 is precise and the repair is correct.

The defect: parse_datetime() lowercases its input (main.py line 172), so the old fallback's .replace("Z", "+00:00") could never match and the literal T/Z strptime formats couldn't fire either; fromisoformat then had its offset stripped by .replace(tzinfo=None). The create handler (main.py:599-600) and update handler (main.py:758, 769) sent that naive wall time with "timeZone": "UTC", so 14:00:00.123+05:30 landed at 14:00 UTC instead of 08:30 UTC, and fractional z inputs were rejected outright ("Could not parse datetime"). Preserving tzinfo and normalizing lowercase z fixes both, and the handlers need no adaptation since aware datetimes serialize their offset via isoformat().

What I verified:

  • Ran plugins/omi-google-calendar-app/test_main.py against the PR head: all 5 test methods / 25 subcases pass.
  • Reverted only the two-line main.py hunk and re-ran: 9 subcases fail, exactly matching the PR description - the tests pin the fixed behavior, not the ambient one. The doubles in load_app() are stdlib-only with no network or real tokens.
  • base...head is exactly these four files, +151/-2, single commit.

Per-file notes:

  • plugins/omi-google-calendar-app/main.py - minimal and correct; no other call sites consume the parser's return differently.
  • plugins/omi-google-calendar-app/test_main.py - strong coverage matrix: both handlers x positive/negative offsets x fractional/nonfractional seconds x Z, naive-UTC, all-day dates, and invalid-input cases asserting transport.assert_not_called() so a parse failure can never write an event.
  • .github/checks-manifest.yaml - the google-calendar-datetime-tests entry matches the existing schema (command/triggers/lanes/reason) and registers both local and ci lanes like its siblings.
  • plugins/omi-google-calendar-app/README.md - the run instructions and scope notes match what the suite actually does (confirmed by executing it).

One non-blocking nit (same area the code-review bot flagged): after this change a payload can send dateTime: "2026-09-09T14:00:00.123+05:30" alongside "timeZone": "UTC" (main.py:599-600, 758, 769). Google treats the explicit offset as authoritative, so the event instants are now correct - but the metadata is mildly inconsistent. A small follow-up could omit timeZone when the dateTime carries an offset, or normalize with astimezone(timezone.utc) before isoformat(). Not merge-blocking.

Thanks @kaijakagi-sys for the well-scoped report and the hermetic tests. Leaving the merge decision with the human maintainers, since #13149 still has two open questions that need a maintainer ruling: whether this standalone plugin remains a supported surface, and the bounty-confirmation request.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution needs-maintainer-review Needs a human maintainer to sign off before merge python labels Sep 9, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

backend/community fix: confirmed on main dt_str is lowercased before the ISO fallback, so .replace('Z',...) never matched and tzinfo was stripped after parsing an offset, discarding the real instant for fractional-second offset timestamps. Fix lowercases the replace target and keeps tzinfo. Issue #13149 real, scoped diff, tests added.

Preserve Calendar and upstream USGS checks; plugin code unchanged.
Calendar: 5 tests / 25 cases pass. USGS: 5 tests pass.
Exact-base local preflight: 14 checks pass, with shallow-history limitation.
No live provider, OAuth or deployment verification.
@Git-on-my-level

Copy link
Copy Markdown
Member

Follow-up after the merge of current main (a0ce036): re-verified on the new head and everything still holds.

  • The PR diff remains exactly the four files reviewed earlier (+151/-2); the new commit introduces no logic changes of its own.
  • Re-ran plugins/omi-google-calendar-app/test_main.py on the merged head: all 5 test methods / 25 subcases pass. Reverted only the two-line parse_datetime fallback hunk in main.py and re-ran: exactly 9 subcases fail (offset-instant losses plus the lowercase z rejection), so the suite pins this fix rather than ambient behavior.
  • The merge kept .github/checks-manifest.yaml intact: all 176 pre-existing entries preserved, google-calendar-datetime-tests added as the only new one, no duplicate ids.
  • CI on the merged head is green.

Since the reviewed logic is unchanged, the earlier approval on the pre-merge head substantively carries to this merge commit; a fresh maintainer approval on a0ce036 would still be the clean bookkeeping. Still leaving the merge decision with the human maintainers: #13149 remains open with no maintainer response - it needs a ruling on whether this standalone plugin remains a supported surface, and on the bounty-confirmation request.

Thanks again @kaijakagi-sys for keeping the branch current.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level

Copy link
Copy Markdown
Member

Follow-up on the rebase-narrowed head 1815960, now that #13528 landed the tzinfo-preserving normalization on main.

What I verified on this head:

  • The diff is exactly four files; the only production change is main.py:228 - the fromisoformat fallback now replaces lowercase "z". That residual is real: parse_datetime lowercases its input (main.py:172), the strptime loop cannot parse fractional seconds or space-separated timestamps at all, so those inputs reach the fallback, and datetime.fromisoformat rejects lowercase "z" (checked on 3.12: '2026-09-09t14:00:00.123z' -> Invalid isoformat string). With this one-liner they parse and UTC-normalize correctly.
  • test_main.py: clean-room run passes 5 methods / 25 subcases at head; reverting only line 228 makes exactly the 3 fractional-UTC subcases fail - the suite pins this fix, not ambient behavior. Doubles are stdlib-only, no network, fixture token only.
  • .github/checks-manifest.yaml: google-calendar-datetime-tests registered with local+ci lanes, matching the shape of sibling plugin entries (e.g. omi-hacker-news-tests); the README section accurately describes what the suite does and does not exercise.

On the three red checks, none belong to this diff:

Remaining for a human maintainer: the existing approval is on the pre-rebase head (8b57707), so the narrowed head needs a fresh sign-off and merge call - noting #13149 is now closed via #13528, leaving this PR's value as the one-line fallback residual plus the regression suite. Thanks @kaijakagi-sys for narrowing the diff against current main.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

Preserve reviewed plugin code unchanged. Component regression tests and committed-tree local preflight pass with the current PR body. Hosted mobile and Swift checks remain authoritative.

Copy link
Copy Markdown
Contributor Author

Update for head e873878027112fc22fafe8fa801513c74de70315: eight hosted workflows, including Mobile App Checks, are successful. Desktop Swift CI has completed but remains failed.

The static/test job reports 826 executed Swift suites, with failing batches split into smaller runs. The explicit final suite-step failure is its wall-time budget: 3163s versus 1800s. Launcher tests succeeded in 144s against their 360s budget, and the separate release compile succeeded. The independent and aggregate gates remain failed. Thirty-two slow suites were deferred by the PR lane; macOS manifest checks and the separate release-mode UserNotifications regression were skipped.

The remaining production diff is only the lowercase-z ISO fallback correction, alongside the Calendar regression suite, README and manifest registration; #13528 already supplied timezone normalization. Could a human maintainer sign off on that narrowed residual and decide how to handle the measured Swift timing failure? I have not changed Swift code or relaxed its budget, and the underlying timing cause is not established.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-verified after new commits: Google Calendar lowercase 'z' fractional-UTC parsing fix is real, scoped, tested, not yet on main. CI green. DIRTY/conflicting mergeability — leaving at approve, not merging.

Copy link
Copy Markdown
Contributor Author

The checks-manifest conflict noted in your review is resolved in 4dbe80855929a53b3e8d4d99b303ae9e9973c5e5, which merges main at 10748b0. The resolution preserves upstream manifest entries and this PR's regression registration; the plugin source is unchanged. The 5 targeted tests and both required local preflight commands passed on the repaired tree.

GitHub now reports this head mergeable. Eight of nine hosted workflows have passed; Desktop Swift CI is still queued, so the new head is not fully CI-green yet. The conflict blocker is cleared; once that remaining check finishes, this is ready for your merge decision.

Copy link
Copy Markdown
Contributor Author

The remaining Desktop Swift CI run has now completed successfully on current head 4dbe80855929a53b3e8d4d99b303ae9e9973c5e5; all nine workflow names are green and GitHub reports the head clean/mergeable. I checked the actual jobs and logs: release compilation, desktop Swift app tests, launcher tests, and the independent phase-verdict gate passed. The separate release-mode UserNotifications callback regression and macOS-scoped manifest checks were skipped; I am not counting them as tested.

This head preserves the UTC normalization merged in #13528 and retains only the lowercase z fractional-UTC parsing correction plus its handler regression coverage described in the PR body. The earlier approval predates this narrowed revision. Could a maintainer review the remaining scope and make the merge decision?

@Git-on-my-level

Copy link
Copy Markdown
Member

Follow-up on merge head 4dbe808 (checks-manifest conflict resolved against 10748b0):

  • main.py at this head is blob-identical to the maintainer-approved e873878 — the production diff remains exactly the fromisoformat fallback at line 228 replacing lowercase "z", the only variant parse_datetime can see after it lowercases its input (line 172). The uppercase .replace("Z") sites at lines 87 and 287-288 are correctly left alone: token-expiry and response-formatting inputs never pass .lower().
  • Ran test_main.py on this head: 5 methods / 25 subcases pass. Reverting only line 228 fails exactly the 3 fractional-UTC subcases ('Could not parse datetime: …123z'), so the suite pins this fix rather than ambient behavior.
  • checks-manifest.yaml: 191 entries, all ids unique, google-calendar-datetime-tests is the only addition; command, triggers and lanes look right.
  • README offline-test section matches what the suite actually does (stdlib doubles only; no OAuth, Redis, FastAPI routing or network).
  • CI fully green on this head, including Desktop Swift.

The conflict blocker noted earlier is resolved and nothing remains from the automated side. Since the approval predates this merge head, the final merge call stays with a human maintainer — the only delta to eyeball beyond the already-approved plugin code is the manifest resolution.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Confirmed real bug: parse_datetime() lowercases dt_str early, so the ISO fallback's .replace("Z", ...) never matches; fractional-second UTC timestamps fail to parse. Fix (.replace("z",...)) is correct and covered by new tests. Backend/community area, confidence 5/5, not yet fixed on main.

@Git-on-my-level Git-on-my-level removed the needs-maintainer-review Needs a human maintainer to sign off before merge label Sep 15, 2026

@aryanorastar aryanorastar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verified on 4dbe80855929.

Head is CONFLICTING/DIRTY, so this cannot merge even with kodjima APPROVE. Rebase onto current main and keep the diff on .github/checks-manifest.yaml, plugins/omi-google-calendar-app/README.md, plugins/omi-google-calendar-app/main.py, plugins/omi-google-calendar-app/test_main.py.

kodjima size-gate APPROVE is not a maintainer merge. I am not merging until this is MERGEABLE and green.

@aryanorastar

Copy link
Copy Markdown
Collaborator

parse_datetime still lowercases a Zulu timestamp before the Z replace, so the suffix stays z. 4dbe80855929 fixes that and is DIRTY against main. Rebase before approval.

— Astar, on behalf of @aryanorastar

@aryanorastar

Copy link
Copy Markdown
Collaborator

Keeping this open. Not approving 4dbe80855929. origin/main parse_datetime does dt_str.strip().lower() then fromisoformat(dt_str.replace("Z", "+00:00")), so a trailing Z is already z. This SHA matches "z" and tests offsets. Hygiene SUCCESS. mergeable CONFLICTING/DIRTY.

— Astar, on behalf of @aryanorastar

@aryanorastar

Copy link
Copy Markdown
Collaborator

Closing. This is already on main via #13528. Not merged.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @kaijakagi-sys 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

positive-signal Automation verified a genuine fix/quality contribution python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Google Calendar plugin: fractional-second timestamps lose their explicit UTC offset

4 participants