feat(msgraph-mail-wake): Microsoft Graph mailbox change-notification wake provider#111658
feat(msgraph-mail-wake): Microsoft Graph mailbox change-notification wake provider#111658a-alphayed wants to merge 2 commits into
Conversation
…uplicate subscriptions, surface Graph errors safely, self-heal orphans Found by live Microsoft Graph tenant validation: - expiration: real mail ceiling is 10070 min, not 10080 (7d). MAX->10070, default 10000 (clock-skew margin); adaptive one-shot retry clamps to a tenant-reported ceiling and applies the learned ceiling to renew too. - duplicate subscriptions: serialize plugin (re)registrations so concurrent startups can't each create a subscription. - diagnostics: sanitized GraphRequestError (op/status + pattern-gated code) replaces the opaque "error=Error". - orphans: on start, delete Graph subscriptions on our notificationUrl that we no longer track (best-effort, ours-only).
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes are blockedOpenClaw does not accept dependency graph changes through PRs unless a repository admin or security explicitly authorizes the current head SHA. Dependency updates are generated internally by maintainers so external PRs cannot change the resolved graph. Detected dependency graph changes:
Auto-scrub was not attempted because this PR changes package manifest dependency graph fields:
Dependency graph changes must be reviewed by security or handled by maintainers internally. Please remove lockfile changes manually if they are not needed. To remove lockfile changes, restore them from the target branch: git fetch origin
git checkout 'origin/main' -- 'pnpm-lock.yaml'
git commit -m 'chore: remove dependency lockfile change'
git pushIf this PR intentionally needs a dependency graph change, ask a repository admin or member of The action will approve the current head SHA ( |
|
Thanks for the idea. I checked the current extension path, and this is a better fit for ClawHub.com than OpenClaw core. Close this bundled-core feature PR: the requested Microsoft Graph mailbox wake integration is optional provider-specific functionality that already fits the public plugin SDK seams used by the branch, while current repository direction reserves bundled core distribution for functionality that needs a core capability or explicit sponsorship. ClawHub handoff
So I’m closing this as a scope-fit item for the plugin/community path. Please upload or publish it through ClawHub.com so it can live as an installable ClawHub package instead of a bundled OpenClaw core change. Review detailsBest possible solution: Publish this as an external ClawHub plugin: verify manifest metadata and entrypoint, declared webhook permissions, Graph secret/config handling, install/update documentation, example configuration, and a redacted end-to-end mail-delivery-to-session-wake smoke proof; ClawSweeper should not open a ClawHub issue or PR, create tracking work, or publish it for the contributor. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: this PR proposes a new optional integration. Its own report documents live subscription creation and callback validation but not an observed mail-notification-to-wake delivery. Is this the best way to solve the issue? No. The implementation is technically shaped as a standalone plugin and relies on existing public plugin SDK contracts, so external ClawHub distribution is the narrower maintainable solution unless an owner identifies a missing core API or explicitly sponsors bundling. Security review: Security review needs attention: The PR introduces a public webhook/credential surface and a dependency-graph change that require explicit security or repository-admin review before any core merge.
AGENTS.md: unclear because the file could not be read completely. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 1508a586744d. |
What
Adds
msgraph-mail-wake, a bundled channel plugin that watches Microsoft 365 / Outlook mailboxes via Microsoft Graph change notifications and wakes an OpenClaw agent session when matching mail arrives. It mirrors the Gmail Pub/Sub wake pattern but needs no bridge process — Graph posts native HTTPS webhooks straight to the Gateway route. Disabled by default; a no-op until at least one mailbox is configured. Docs:docs/plugins/msgraph-mail-wake.md.Two commits: the plugin itself, and a fix commit for four bugs surfaced by testing against a live Microsoft Graph tenant.
Bugs found via live-tenant testing
Exercising the subscription lifecycle against a live Microsoft 365 tenant surfaced four issues the original documented-contracts-only implementation missed:
ExtensionError: Subscription expiration can only be 10070 minutes in the future.MAXis now 10070, default 10000 (clock-skew margin), plus an adaptive one-shot retry that clamps to a tenant-reported ceiling and applies the learned ceiling to renewals, not just create.register()more than once per startup; two subscription-managerstart()s could race an empty store and each create a subscription. Registrations are now serialized.error=Error. A structuredGraphRequestErrornow surfaces a sanitizedop/status/code(the Graph error code gated behind a safe enum-like pattern) — never raw messages, bodies, or request paths.notificationUrlthat it no longer tracks (best-effort, only-ours).Validation
Known non-blocking tradeoffs
listSubscriptionsreads a single page (no@odata.nextLinkfollow); orphan cleanup is best-effort, re-runs every start, and Graph expires orphans regardless.