Skip to content

Add Microsoft 365 Graph integration - #226

Merged
daltoniam merged 10 commits into
mainfrom
feat/microsoft-365-integration
Sep 7, 2026
Merged

Add Microsoft 365 Graph integration#226
daltoniam merged 10 commits into
mainfrom
feat/microsoft-365-integration

Conversation

@daltoniam

Copy link
Copy Markdown
Owner

Summary

  • Add a Microsoft Graph adapter so agents can work with Outlook mail, calendar, OneDrive/SharePoint, Teams, To Do, and directory users through Switchboard.
  • Include Entra ID OAuth (PKCE) setup in the web UI, token refresh, field compaction, and markdown rendering for Outlook messages.

Test plan

  • make ci (or at least go test ./integrations/microsoft365/ ./config/ ./web/)
  • In the web UI, open Microsoft 365 setup, save an Entra app, and complete OAuth
  • search for outlook mail / onedrive / teams and execute microsoft365_get_me

💘 Generated with Crush

Expose Outlook mail, calendar, OneDrive, Teams, and To Do through
Microsoft Graph so agents can work across Microsoft 365 without leaving
Switchboard.

💘 Generated with Crush

Assisted-by: Crush:grok-4.6
Bring in Project Catalog, Slack MCP, Paperless, and Recoll so the PR
can merge cleanly against current main.

💘 Generated with Crush

Assisted-by: Crush:grok-4.6

@acmacalister acmacalister 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.

Solid Microsoft 365 adapter — dispatch/compaction/markdown parity, PKCE OAuth, and the Graph response shaping all look in good shape. CI is green across build/test/lint/security/compose/rust-sdk. A few path-URL and next_link hardening notes inline; the OneDrive path colon issue looks like a real functional bug for path-based file ops.

Comment thread integrations/microsoft365/files.go Outdated
Comment thread integrations/microsoft365/files.go Outdated
Comment thread integrations/microsoft365/files.go Outdated
Comment thread integrations/microsoft365/files.go Outdated
Comment thread integrations/microsoft365/microsoft365.go
Comment thread integrations/microsoft365/oauth.go Outdated
Use Graph's path-colon convention, encode drive segments, allowlist
pagination hosts, and cancel OAuth token exchange with request context.

💘 Generated with Crush

Assisted-by: Crush:grok-4.6
Uploading into a folder path used an extra colon that Graph rejects,
and downloads with no item_id or path hit the drive root. Align the
tool docs with mailbox-wide list_messages behavior.

💘 Generated with Crush

Assisted-by: Crush:grok-4.6

@acmacalister acmacalister 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.

Nice Microsoft 365 adapter — dispatch/compaction/markdown parity looks solid, and the follow-ups on path colon encoding, next_link host checks, and OAuth context all landed cleanly. CI is green (build/test/lint/security/compose/rust-sdk). A few remaining notes on Graph pagination ergonomics, default scopes vs list_users, upload size guard, and live reconfigure after OAuth.

Comment thread integrations/microsoft365/microsoft365.go Outdated
Comment thread integrations/microsoft365/oauth.go Outdated
Comment thread integrations/microsoft365/files.go
Comment thread web/web.go Outdated
Prefer next_link over bare skiptoken, request User.Read.All so
directory listing matches the setup flow, reject simple uploads over
4 MB, and reconfigure the live adapter after OAuth or token save.

💘 Generated with Crush

Assisted-by: Crush:grok-4.6
@daltoniam

Copy link
Copy Markdown
Owner Author

Retriggering CI for 519fc05.

@daltoniam daltoniam closed this Sep 7, 2026
@daltoniam daltoniam reopened this Sep 7, 2026
Include HubSpot defaults and keep Microsoft 365 registered so config
counts stay aligned after the main merge.

💘 Generated with Crush

Assisted-by: Crush:grok-4.6

@acmacalister acmacalister 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.

Solid Microsoft 365 adapter — dispatch/compaction/markdown parity, path encoding, next_link host checks, upload guard, and live Configure-after-OAuth all look in good shape, and prior review threads are resolved. CI is green (build/test/lint/security/compose/rust-sdk).

A few remaining notes around Graph $search quoting (mail/people/directory) and SharePoint scope vs tool copy — details inline.

Comment thread integrations/microsoft365/microsoft365.go Outdated
Comment thread integrations/microsoft365/users.go Outdated
Comment thread integrations/microsoft365/tools.go Outdated
Comment thread integrations/microsoft365/oauth.go Outdated
Graph mail, people, and directory $search need quoted values. Bare
directory terms now expand to displayName/mail clauses, and OAuth
requests Files.ReadWrite.All so SharePoint libraries work after setup.

💘 Generated with Crush

Assisted-by: Crush:grok-4.6

@acmacalister acmacalister 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.

Solid Microsoft 365 adapter — prior review threads look resolved, and CI is green (build/test/lint/security/compose/rust-sdk). One remaining note on directory $search pagination keeping ConsistencyLevel on next_link follow-ups; details inline.

Comment thread integrations/microsoft365/microsoft365.go
Directory and mail $search paging drops custom headers from
@odata.nextLink, so later pages 400 without ConsistencyLevel.
Re-send it when the next URL still has $search or $count.

💘 Generated with Crush

Assisted-by: Crush:grok-4.6

@acmacalister acmacalister 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.

Solid Microsoft 365 adapter — prior review threads look resolved, and CI is green (build/test/lint/security/compose/rust-sdk). A couple of leftover edge cases on empty file downloads and message $search+$orderby inline; nothing blocking.

Comment thread integrations/microsoft365/microsoft365.go Outdated
Comment thread integrations/microsoft365/mail.go Outdated
Keep Microsoft 365 registered alongside Zendesk, Okta, and Intercom
so default config counts stay aligned after the main merge.

💘 Generated with Crush

Assisted-by: Crush:grok-4.6
Empty 200 file bodies were rewritten as success JSON, and Graph
rejects combining $search with $orderby on messages. Keep true empty
content and strip orderby whenever search is set.

💘 Generated with Crush

Assisted-by: Crush:grok-4.6

@acmacalister acmacalister 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.

Clean PR — prior review threads are resolved, and CI is green on this head (build/lint/security/compose/rust-sdk, with the matching CI run succeeding). Dispatch/compaction/markdown parity, Graph path encoding, next_link host checks, OAuth PKCE + live Configure-after-save, and the empty-download / search+orderby fixes all look solid. LGTM.

@daltoniam
daltoniam merged commit ed9dca8 into main Sep 7, 2026
6 checks passed
@daltoniam
daltoniam deleted the feat/microsoft-365-integration branch September 7, 2026 18:55
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.

2 participants