Skip to content

feat(kiloclaw): enable gmail push notifications by default on Google account connect#1143

Open
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
session/agent_70f8d44a-13bd-43d0-aa8b-e6ae175b312b
Open

feat(kiloclaw): enable gmail push notifications by default on Google account connect#1143
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
session/agent_70f8d44a-13bd-43d0-aa8b-e6ae175b312b

Conversation

@kilo-code-bot
Copy link
Contributor

@kilo-code-bot kilo-code-bot bot commented Mar 16, 2026

Summary

  • Gmail push notifications (gmailNotificationsEnabled) are now automatically enabled when a user connects a Google account via updateGoogleCredentials(), instead of defaulting to off and requiring a manual toggle.
  • Previously, users had to connect Google and then separately enable Gmail notifications in Settings. Now connecting a Google account opts them in by default; users can still toggle it off.
  • Added a changelog entry for the new behavior.

Verification

  • pnpm --filter kiloclaw test — all 665 tests pass, including a new test for the auto-enable behavior
  • Existing tests for clearGoogleCredentials (resets to false) and updateGmailNotifications (manual toggle) continue to pass unchanged

Visual Changes

N/A

Reviewer Notes

The change is scoped to updateGoogleCredentials() in the KiloClaw Instance DO — it now sets gmailNotificationsEnabled: true alongside storing the credentials and OIDC email. The schema default (false), createMutableState(), and resetMutableState() remain unchanged because those represent the initial/disconnected state. clearGoogleCredentials() still resets to false, so disconnecting Google correctly disables notifications.

Built for Igor by Kilo for Slack


this.s.googleCredentials = credentials;
this.s.gmailPushOidcEmail = credentials.gmailPushOidcEmail ?? null;
this.s.gmailNotificationsEnabled = true;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

WARNING: Reconnecting a different Google account will reuse the old Gmail cursor

updateGoogleCredentials() now re-enables push delivery immediately, but it still leaves gmailLastHistoryId untouched. That value is injected back into the controller on startup via KILOCLAW_GMAIL_LAST_HISTORY_ID, so switching from account A to account B can patch B's gog state with A's history ID and make Gmail watch resume from an invalid position. Reset the stored history ID when replacing credentials.

@kilo-code-bot
Copy link
Contributor Author

kilo-code-bot bot commented Mar 16, 2026

Code Review Summary

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
kiloclaw/src/durable-objects/kiloclaw-instance/index.ts 472 Re-enabling Gmail push on credential updates leaves the previous gmailLastHistoryId in place, so reconnecting a different account can resume from an invalid cursor.
Other Observations (not in diff)

N/A

Files Reviewed (3 files)
  • kiloclaw/src/durable-objects/kiloclaw-instance/index.ts - 1 issue
  • kiloclaw/src/durable-objects/kiloclaw-instance.test.ts - 0 issues
  • src/app/(app)/claw/components/changelog-data.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by gpt-5.4-20260305 · 1,123,449 tokens

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants