Skip to content

feat(inbox): Add create_inbox_items notification entrypoint - #130823

Draft
hobzcalvin wants to merge 8 commits into
masterfrom
grantpatterson/iswf-3737-add-create_inbox_items-notification
Draft

hobzcalvin wants to merge 8 commits into
masterfrom
grantpatterson/iswf-3737-add-create_inbox_items-notification

Conversation

@hobzcalvin

@hobzcalvin hobzcalvin commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Adds create_inbox_items, the Notification Platform entrypoint for the Universal Inbox (ISWF-3737), and has every existing inbox producer call it directly. The contract is being discussed on ISWF-3725.

def create_inbox_items[SubjectT, DataT: InboxEventData](
    *,
    event_type: InboxEventType[SubjectT, DataT],
    subject: SubjectT,
    data: DataT,
    recipients: Iterable[Actor],
    actor: InboxActor,
) -> None:

Recording. recipients takes users and teams. Teams expand to their active members, recipients outside the subject's organization are dropped, and a user reached both directly and through a team gets one event. Recording goes through InboxEventType.record(), which still drops the actor and now returns the events it created.

One way in. Assignment (GroupAssignee.objects.assign), comment mentions (issues/comments.py), Seer PR-ready (seer/entrypoints/operator.py), and investigation completion (orchestration_events.py) now call create_inbox_items with users and teams. The record_issue_* and record_notebook_completed wrappers are removed.

Notifications (skeleton). INBOX_NOTIFIERS in notifications/platform/inbox.py maps event types to notifiers; the inbox types don't know about notifications. Behind organizations:inbox-notifications, the users who got a new event are handed to the event type's notifier after the transaction commits, so a retry that records nothing notifies nobody. Each recipient is an individual user, notified per their personal settings; teams get no channel post.

  • The mention event types have a notifier: it loads the note's Activity and resolves each user's targets with UserRoutingStrategy and the WORKFLOW setting. Building the notification from the existing activity template and sending it is a TODO.
  • Other event types record without notifying. Assignment can use the same notifier once its data carries activity_id (feat(inbox): Add durable occurrence IDs to event data #130397).

Not in this PR:

  • Building and sending the notifications, reusing the existing activity notifications.
  • Per-event-type settings, e.g. "assigned to your team" vs "assigned to you" (ISWF-3670).
  • The workflow engine's ADD_TO_INBOX action (ISWF-3710). The existing activity notifications for these events keep sending, so cutover has to avoid double-sending.

create_inbox_items takes users and teams, expands teams to their active
members in the subject's organization, records one inbox event per user,
and, behind organizations:inbox-notifications, queues email and Slack DM
notifications for the newly recorded events after the transaction commits.

Refs ISWF-3737

Co-authored-by: Cursor <cursoragent@cursor.com>
@linear-code

linear-code Bot commented Nov 11, 2026

Copy link
Copy Markdown

ISWF-3737

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 11, 2026
hobzcalvin and others added 7 commits November 11, 2026 11:51
Notification templates and delivery will reuse the existing per-event
notifications and land separately, so this keeps only the user and team
fan-out and recording.

Refs ISWF-3737

Co-authored-by: Cursor <cursoragent@cursor.com>
Refs ISWF-3737

Co-authored-by: Cursor <cursoragent@cursor.com>
Behind organizations:inbox-notifications, create_inbox_items hands the
users who got a new event to the event type's notifier after the
transaction commits. Mentions resolve each user's targets with their
workflow notification settings; building and sending the notification is
left as a TODO.

Refs ISWF-3737

Co-authored-by: Cursor <cursoragent@cursor.com>
…ate_inbox_items

Refs ISWF-3737

Co-authored-by: Cursor <cursoragent@cursor.com>
The issue and notebook recorders now call create_inbox_items with user
and team recipients, so recipient expansion and notification handoff
happen in one place. Event types carry their own notifier, and only the
mention event types define one for now.

Refs ISWF-3737

Co-authored-by: Cursor <cursoragent@cursor.com>
Assignment, comment mentions, Seer PR-ready, and investigation completion
now call create_inbox_items themselves, and the record_issue_* and
record_notebook_completed wrappers are removed.

Refs ISWF-3737

Co-authored-by: Cursor <cursoragent@cursor.com>
Refs ISWF-3737

Co-authored-by: Cursor <cursoragent@cursor.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant