Repository navigation
feat: add multi-account Gmail and Outlook profiles - #7
Conversation
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe change adds named Gmail and Outlook mailbox profiles, profile-bound message references, Outlook Graph mailbox operations, profile-aware approval execution, and updated OAuth onboarding, configuration, documentation, and tests. ChangesMulti-profile mailbox expansion
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Hermes
participant MailboxClient
participant MailboxBrokerServer
participant GmailOrOutlookAdapter
participant ApprovalStore
Hermes->>MailboxClient: request profile-bound mailbox operation
MailboxClient->>MailboxBrokerServer: send JSON request
MailboxBrokerServer->>GmailOrOutlookAdapter: resolve profile and access mailbox
GmailOrOutlookAdapter-->>MailboxBrokerServer: return messages or proposal snapshot
MailboxBrokerServer->>ApprovalStore: store trash/unsubscribe proposal
ApprovalStore-->>Hermes: return pending approval status
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/mailbox-broker/gmail-unsubscribe.ts`:
- Around line 308-312: Update executeHttps to also validate snapshot.backend
against the expected Gmail backend before calling executeHttpsUnsubscribe;
reject mismatches with the existing approval-change error, alongside the
provider, profile, and account checks.
In `@src/mailbox-broker/protocol.ts`:
- Line 13: Align the request-size limit with the schema’s worst-case batch size:
update MAX_REQUEST_BYTES to accommodate valid UniqueMessageRefsSchema batches,
or tighten MessageRefSchema/its batch constraints so mark-read and propose-trash
requests cannot exceed the transport cap. Ensure the chosen limit is enforced
consistently by request parsing and validation.
In `@src/mailbox-broker/server.ts`:
- Around line 76-86: Validate each decoded reference’s backend/provider before
selecting a profile, rejecting v2 references whose claimed profile does not
match the reference backend (including mixed backends in profileFromReferences).
Update profileFromReference and profileFromReferences to perform this validation
before calling selectedProfile, so propose-trash cannot persist
provider-mismatched drafts.
In `@src/providers/email-outlook.ts`:
- Line 77: In the Outlook send logic, update the non-OK response branch in the
relevant method to consume or cancel the response body before throwing the
error. Use the existing response object to call its cancellation method, then
preserve the current statusMessage-based error.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b13b6fe1-1795-412a-a350-0434db002f0f
📒 Files selected for processing (39)
README.mdconfig.example.yamldocs/hermes.mddocs/oauth-onboarding.mddocs/smtp-onboarding.mdscripts/oauth-setup.shscripts/smtp-setup.shskill/SKILL.mdsrc/bot.tssrc/config.tssrc/executor.tssrc/index.tssrc/mailbox-broker/adapter.tssrc/mailbox-broker/gmail-inbox.tssrc/mailbox-broker/gmail-trash.tssrc/mailbox-broker/gmail-unsubscribe.tssrc/mailbox-broker/outlook-mailbox.tssrc/mailbox-broker/profiles.tssrc/mailbox-broker/protocol.tssrc/mailbox-broker/reference.tssrc/mailbox-broker/server.tssrc/mailbox-broker/trash-proposal.tssrc/mailbox-broker/unsubscribe-proposal.tssrc/mailbox-client.tssrc/oauth-setup.tssrc/oauth/cli-options.tssrc/oauth/config-writer.tssrc/oauth/outlook.tssrc/oauth/persist.tssrc/providers/email-outlook.tssrc/providers/outlook-token-client.tssrc/schema.tssrc/smtp-setup.tssrc/smtp/cli-options.tstests/mailbox-profiles.test.tstests/oauth-setup.test.tstests/outlook-mailbox.test.tstests/outlook-provider.test.tstests/smtp-setup.test.ts
Summary
gmail-smtpcompatibility mailbox whether exposed as implicitdefaultor explicitly named, while rejecting legacy-reference replay against every other Gmail providerMail.ReadWriteSafety properties
gmail-smtpcompatibility provider, regardless of its displayed profile nameMOVEwith requiredMOVE/UIDPLUSand no delete/EXPUNGE fallbackmovetodeleteditems; GraphDELETEis structurally rejected and move responses are bounded and identity-verifiedList-Unsubscribeheaders only, with CR/LF-bearing Graph header values rejectedCompatibility
gmail-smtpMail.ReadWriteVerification
npm test— 138/138 passednpm run buildbash -n scripts/*.shnpm pack --dry-rungit diff --checkNot performed
Stacked on
feat/approved-unsubscribe/ PR #6.Summary by CodeRabbit
New Features
Documentation