Repository navigation
feat(dispatch): Start DM dispatches for linked provider identities - #2217
sentry-junior[bot] wants to merge 4 commits into
Conversation
Plugin webhook routes can call ctx.agent.dispatchForIdentity with a provider account id. Core binds the provider to the calling plugin and starts a private Slack DM dispatch only when that Identity is linked through OAuth to exactly one current Slack member of the bot workspace. Otherwise it returns not_linked before any model call. Refs #2207 Co-Authored-By: BYK <burak.kaya@sentry.io>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Identity dispatch now applies the allowed domains from main, like Slack ingress, so a linked member outside JUNIOR_ALLOWED_DOMAINS cannot start work from a plugin webhook. Co-Authored-By: Burak Yigit Kaya <126780+BYK@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f4c3a14. Configure here.
Use isNativeIdentityProvider so a plugin named after a native provider, such as google, cannot start work for core-linked sign-in identities. Refs #2207
# Conflicts: # packages/junior-plugin-api/src/operations.ts # packages/junior/src/chat/agent-dispatch/context.ts # packages/junior/src/chat/ingress/slack-allowed-domain.ts Co-Authored-By: BYK <burak.kaya@sentry.io>
BYK
left a comment
There was a problem hiding this comment.
Plugin webhook routes get ctx.agent.dispatchForIdentity({ subjectId, idempotencyKey, input, replyAttribution? }). It starts private work in a Slack DM for the person behind one provider account.
We need to rework some of this logic. If the origin is a public GitHub repo, then the work should be considered public, even if we decide to message the author on a private Slack DM. The reverse is a bit tricky though: once we open a public-facing PR or issue from a private DM we still need to make sure no private or proprietary information goes back to public but the "work" itself is public.
|
Thanks @BYK. As agreed, this PR stays private-only, and it has no code change for origin visibility. Per-Conversation visibility will be its own step, before the GitHub webhook work (step 4). Today Conversation visibility comes from the shared |
A cold review found gaps that break a rolling deploy or widen trust. - Split the Owner step. 4a writes the column, and 4b adds the NOT VALID check one release later, because old workers insert roots with no Owner while migrations run. - Drop each column in two releases. conversationReadColumns() selects every schema column, so release N stops reads and writes and N+1 drops it. Add an explicit stop of actor_json writes. - Pin Guardian labels to the Actor and provenance, never the one system Identity id, and keep trusted event text in the Requester instruction section. - Use findLinkedSlackMember() for event author trust, the same check as #2217 and #2260. - Pin Identity keys, the mailbox field, and the full system merge. - Drop hasActor and list the remaining choices as proposals. Refs #2439 Co-Authored-By: David Cramer <david@sentry.io>

Step 2 of #2207. Plugin webhook routes get
ctx.agent.dispatchForIdentity({ subjectId, idempotencyKey, input, replyAttribution? }). It starts private work in a Slack DM for the person behind one provider account. The result is{ status: "created" | "already_exists", id }or{ status: "not_linked" }. The call does not throw because the person is untrusted.Core decides who counts, in code and before any model call:
junior,slack) never match.user, linked user). Handles, emails, and display names never match.not_linked.users.infomust show a current human member of the bot team: same team, not deleted, not a bot. This repeats the revocation check from Slack ingress.not_linked. Other Slack and storage errors reach the route.On a match, core opens the bot DM and creates a normal plugin dispatch with
privatevisibility and aprivate-direct-conversationcredential subject for that Slack user. Binding, validation, and enqueue use the same code as heartbeat dispatches. No second authority path exists.Not in this PR:
via BYK.
--
View Junior Session [Sentry]