Repository navigation
Move provider to a plugin-architecture - #661
Conversation
PR SummaryMajor provider refactor with protocol and app updates.
Written by Cursor Bugbot for commit d0beb09. This will update automatically on new commits. Configure here. |
1305577 to
43d758f
Compare
43d758f to
73b30c0
Compare
|
Rebased CI fixes:
Fresh CI run queued; I’ll watch and follow up if anything flakes. |
|
Fixed HealthStore regression: degrade health when linked provider probe fails.\n\nCommit: |
a582b7c to
8989ae3
Compare
8989ae3 to
16d0d5d
Compare
| kindTarget, | ||
| ) | ||
| : undefined; | ||
| return { provider, to: normalized ?? kindTarget }; |
There was a problem hiding this comment.
Session target prefix breaks iMessage and MS Teams routing
High Severity
The refactored resolveAnnounceTargetFromKey now adds group: or channel: prefix to ALL recognized providers' targets, but providers without messaging.normalizeTarget (like iMessage and MS Teams) don't strip this prefix. Previously, only Discord got channel: and Signal got group:, with other providers getting bare IDs. Now iMessage group sessions return to: "group:chat123" instead of to: "chat123", and MS Teams returns to: "group:conversationId" instead of bare to: "conversationId". These prefixed values pass through resolveOutboundTarget unchanged and could cause downstream send functions to fail or route to wrong destinations.
16d0d5d to
40918c4
Compare
6672775 to
7fbf3cb
Compare
|
Rebased Local gate green:
Follow-ups after rebase:
|
5d5e709 to
eb72a1a
Compare
|
Rebased Local gate green:
CI fix: New commits: |
|
Follow-up: default sandbox tool denylist no longer calls Local gate green again:
New commits: |
03d6f05 to
6104f9f
Compare
|
Rebased onto latest main (origin/main @ 0279f09). Follow-up cleanup:
CI should be green again after rerun; running full gate locally next. |
7ab6e32 to
8b81637
Compare
8b81637 to
be8a352
Compare
| action: Type.Union( | ||
| nonSendActions.map((action) => Type.Literal(action)), | ||
| ), | ||
| to: Type.Optional(Type.String()), |
There was a problem hiding this comment.
Object spread order makes required params optional in schema
Medium Severity
The send action schema construction spreads ...props after defining required to: Type.String() and message: Type.String(). Since MessageToolCommonSchema contains to: Type.Optional(Type.String()) and message: Type.Optional(Type.String()), and JavaScript object spread puts later properties over earlier ones, the required versions get overridden by the optional versions. This means the schema will incorrectly allow send actions without to or message parameters.
Summary
Providers (iMessage, Discord, WhatsApp, …) are plugin-driven end-to-end (CLI, gateway runtime, status/probes, outbound, followup routing). Adding/removing a provider no longer requires touching gateway core switch statements.
Breaking changes (vs
main)providers.statusis v3: provider-keyed maps (providers,providerAccounts,providerOrder,providerLabels).{ providers, providerAccounts }); old per-provider top-level fields are gone.Architecture (vs
main)src/providers/plugins/types.ts(ProviderPlugin+ adapters).src/providers/plugins/index.ts(all plugins; use for UX surfaces / listing).src/providers/dock.ts(cheap metadata/defaults for shared flows; avoid init cycles).src/providers/registry.ts(canonical ids + input aliases).Gateway
src/gateway/server-providers.ts(start/stop/logout via plugins; map-based runtime snapshot).src/gateway/server-methods/providers.ts(generic provider.status/logout/login routing).Status
src/commands/health.ts: provider-keyed maps (providers,providerOrder,providerLabels).src/commands/status-all/providers.ts: tables rendered from plugin config/status.src/commands/status-all.ts: attaches gateway provider issues via provider ids (no label→id string mapping).Outbound + followups
src/infra/outbound/deliver.tsdelegates toplugin.outboundand supportsreplyToId,threadId, andabortSignal.src/providers/plugins/load.tsloads a single provider plugin on-demand (avoid importing the heavy registry on hot paths).src/auto-reply/reply/route-reply.tsuses outbound delivery (lazy import) instead of a per-providerswitch.Onboarding
src/commands/onboarding/providers/*and wired viasrc/commands/onboarding/registry.ts.WhatsApp / Baileys import cost
src/web/auth-store.ts(file-based auth checks + self id) so status/outbound don’t pay Baileys import cost.Adding a provider
src/providers/plugins/<id>.ts(ProviderPlugin).src/providers/plugins/index.tsand add ids/aliases insrc/providers/registry.ts.src/providers/dock.tsfor shared behavior (allowFrom formatting, mention stripping, threading defaults, streaming defaults).status,outbound,gateway,auth,reload,pairing,onboarding,agentTools.pnpm protocol:check.Notes
docs/refactor/provider-plugin.md.Testing
pnpm lint && pnpm build && pnpm test && pnpm protocol:check && pnpm docs:build