Skip to content

fix(connectors): make email AGENT_NOT_GRANTED message provider-aware#1757

Merged
kovtcharov merged 1 commit into
mainfrom
autofix/issue-1751
Jun 19, 2026
Merged

fix(connectors): make email AGENT_NOT_GRANTED message provider-aware#1757
kovtcharov merged 1 commit into
mainfrom
autofix/issue-1751

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

When the email agent hit a per-agent grant gap on a Microsoft/Outlook mailbox, the error told the user to grant Google scopes and reconnect Google — the wrong provider, so it wasn't actionable. The installed:email grant-migration override returned a hardcoded Google string for any AGENT_NOT_GRANTED, shadowing the provider-aware generic branch right below it. Now the override is keyed by (agent_id, provider): Google failures still get the tailored migration message, while a Microsoft failure falls through to the generic branch that names Microsoft and the actual missing Graph scopes. Grant-awareness stays entirely in the connectors layer — agents are unchanged.

Closes #1751

Test plan

  • python -m pytest tests/unit/connectors/test_formatting.py -x passes (new ..._microsoft_falls_through test asserts no Google text leaks onto a Microsoft failure)
  • python util/lint.py --all passes
  • Manual: with the Microsoft grant revoked for installed:email, run a multi-mailbox pre_scan_inbox/triage_inbox and confirm the microsoft entry in mailbox_errors names Microsoft + the missing Graph scopes (not Google/gmail.modify); re-grant to restore.

The installed:email grant-migration override returned a hardcoded
Google reconnect message for any AGENT_NOT_GRANTED, shadowing the
provider-aware generic branch. A Microsoft mailbox grant gap therefore
told users to reconnect Google — useless for a Graph scope gap. Key the
override map by (agent_id, provider) so Microsoft falls through to the
generic message naming Microsoft and the missing Graph scopes.

Closes #1751
@kovtcharov kovtcharov added this pull request to the merge queue Jun 19, 2026
Merged via the queue into main with commit fbe00da Jun 19, 2026
7 checks passed
@kovtcharov kovtcharov deleted the autofix/issue-1751 branch June 19, 2026 21:05
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.

bug(connectors): email agent AGENT_NOT_GRANTED message hardcodes Google, misleads on Outlook/Microsoft grant gaps

2 participants