You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #1614 (merged) — applies the claude.yml review suggestions
plus the **root-cause** enumeration fix that #1614 only worked around.
## Why this matters
#1614 shipped connector-derived mailbox selection, but two gaps
remained:
1. **`store.list_connections()` was hardcoded to `("google",)`** — so
*every generic* connection consumer stayed Microsoft-blind:
`api.list_connections()`, `api.get_connection("microsoft")` (returned
`None` even when Microsoft was connected), the `/v1/connections` REST
endpoint, the UI connectors list, and `tripwire_check()` (never swept
the Microsoft connection at startup). #1614's
`connected_mailbox_providers()` patched only the email agent's path.
This makes the primitive registry-driven (enumerate the registered
`oauth_pkce` providers via a function-local import — no layering
regression), so the whole system is consistent.
2. **`EmailSendRequest.provider` was a public REST field that did
nothing** — with two mailboxes connected and an unbound confirmation
token, a caller supplying `provider` to disambiguate still got a 400.
Now wired as the unbound-token fallback (the token's own binding still
wins when present).
Plus a latent-correctness fix to the pre-scan budget guard (counts
actual returned messages, not the per-backend cap).
## Test plan
- [x] `GAIA_MEMORY_DISABLED=1 python -m pytest tests/unit/connectors/
tests/unit/agents/email/ -x` — green; `util/lint.py --all` clean
- [x] New tests: `store.list_connections()` finds microsoft-only / both;
`api.list_connections()` + `get_connection("microsoft")` see Microsoft
(no secret leak); `TestSendRequestProviderFallback` (unbound→routes
there, bound-token wins, unbound+none+both→400); pre-scan budget counts
actual returned
- [x] **Real-world (Strix Halo, same persisted real Gmail + Outlook
connections), before/after:**
| Surface | BEFORE (`f768c2e`, merged #1614) | AFTER (`e694f00`, this
PR) |
|---|---|---|
| `store.list_connections()` | `['google']` | `['google','microsoft']` |
| `api.list_connections()` | `['google']` | `['google','microsoft']` |
| `api.get_connection('microsoft')` | `None` | full metadata (no
secrets) |
| `GET /v1/connections` | `['google']` | `['google','microsoft']` |
Microsoft was connected the whole time — only the enumeration primitive
changed.
Deferred from the review (own follow-up): surfacing the chosen `from:`
mailbox in the `send_now` confirmation prompt — needs a base-agent
confirmation hook touching all agents.
0 commit comments