Skip to content

feat(notifications): Push Inbox items to their assignees - #4047

Merged
BYK merged 5 commits into
mainfrom
feat/inbox-item-push
Nov 23, 2026
Merged

BYK merged 5 commits into
mainfrom
feat/inbox-item-push

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Step 2 of #3817: notifications come from Inbox item events.

When an open action shows to a named User, Junior sends one web push to that User. A new junior_inbox_item_deliveries table holds one record per item × User × channel × event. The record stops a second push when the item shows again, for example after a content change.

What pushes:

  • Only open actions with named User assignees. Everyone items and notices do not push.
  • An item with a Slack card does not push. The card already tells its thread. Step 4 of the issue adds a delayed push for unseen Slack messages.
  • A User who snoozed the item, is outside their notification hours, or has Slack Do Not Disturb on gets no push. The record keeps skipped and the reason.

Close-clear: when an item closes or is dismissed, its sent deliveries change to cleared. Web Push cannot remove a notification without showing a new one, and browsers penalize silent pushes. So the next push to that User carries close: [itemIds] (items cleared within the 12 h TTL, at most 20), and the service worker closes those tags first.

The push hooks into ShowInboxItem. createInboxItemShow runs the Slack cards, then the push, and replaces createSlackInboxItemShow at every call site. Like Slack cards, the push is best-effort and inline, with no retry.

This also removes the design/attention.md gap about a question card with no reply that sends no push, as confirmed on the issue.

via @BYK.

--

View Session [Sentry]

Add a delivery record per Inbox item, User, and channel. When an open
action is shown to a named User, push it to them once. Skip Everyone
items, notices, items with a Slack card, snoozed items, and pushes
outside the User's notification hours. When an item closes, mark its
deliveries cleared, and close them on each device with the next push.

Refs #3817

Co-Authored-By: BYK <[email protected]>
@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 22, 2026 10:39pm UTC

Request Review

@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 22, 2026
Co-Authored-By: BYK <[email protected]>

# Conflicts:
#	packages/junior/migrations/meta/0160_snapshot.json
#	packages/junior/migrations/meta/_journal.json

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

# Conflicts:
#	packages/junior/migrations/meta/0161_snapshot.json
#	packages/junior/migrations/meta/_journal.json

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit bf2a446. Configure here.

@BYK BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only approving because the code I objected was pre-existing. I need a follow up for that.

@BYK
BYK merged commit 0ac57c4 into main Nov 23, 2026
56 checks passed
@BYK
BYK deleted the feat/inbox-item-push branch November 23, 2026 10:06
BYK added a commit that referenced this pull request Nov 23, 2026
…ter (#4051)

Step 1 of #3817. It is stacked on #4047,
which adds the delivery record.

Today a reply in a dashboard Conversation sends a push and leaves no
Inbox state. With this change the reply becomes an Inbox item, so the
push comes from an item like every other notification.

- **Reply notice.** When a Turn in a Conversation with no Location ends
with a reply, core adds a notice for the Conversation's starter, or
updates the open one. Its dedupe key is `reply:<conversationId>`, so
each Conversation has one open notice, and that notice holds the latest
reply. The Inbox shows it in FYI, with the Conversation title and a
short preview of the reply.
- **Push.** Each reply pushes the notice to the starter again, the same
as the reply push did before. The push tag is now the item id, so a new
reply replaces the older notification on the device. A `reply` row in
`junior_inbox_item_deliveries` (one per item × User) records the latest
push, or the reason it was skipped (outside hours or Slack DND).
- **Close on read.** When the starter's read position reaches the latest
reply, the notice closes as done. This covers the dashboard read report,
the MCP `markConversationRead` tool and archive. The step 2 close-clear
then removes its push from each device with the next push. An earlier
read leaves the notice open.
- **Starter.** The recipient is now the starter, meaning the User of the
root's actor (see `TERMINOLOGY.md`). Only roots run session tasks. For
an older root with no stored actor, the run's Actor stands in, as
before.
- **Agent guard.** Agents cannot use the `reply:` key prefix, and
`canAgentChangeInboxItem` refuses reply notices. An agent can't
overwrite or close the starter's notice.
- A Slack thread is unchanged: it gets no notice and no push.

Design: this adds the confirmed lines to `design/inbox.md` (the notice
intent, and the reply-notice rule) and to `design/attention.md` (who
gets a push). The operator docs describe the reply notice.

No dashboard code changes. The existing FYI notice row renders the reply
notice.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Abb0c4c737e0fda4b1516de7405ffd1d2 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Abb0c4c737e0fda4b1516de7405ffd1d2)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Abb0c4c737e0fda4b1516de7405ffd1d2/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 05278121 Deployed Nov 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant