Skip to content

ref(conversations): Replace the Conversation Owner with Participants - #3021

Merged
dcramer merged 4 commits into
mainfrom
ref/participants-not-owner
Nov 9, 2026
Merged

dcramer merged 4 commits into
mainfrom
ref/participants-not-owner

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

A Conversation has no owner. Each Turn has an Actor, and a Conversation's Participants are the Users among those Actors. A Participant is active or inactive depending on whether they are subscribed. TERMINOLOGY.md defined an Owner (from the #2439 plan), and some code gave the root Actor rights that no other Participant had. This PR removes both.

Behavior

  • Access, feeds, and archive read only Participant rows. Before, the root Actor also got access by Identity, or by a matching verified email when no row existed. The feed union, viewerConversationMembership, and the root Actor fallback in hasSubscriber are gone.
  • Review item defaults: when a Turn has no person and no Automation creator (for example, an event Turn), the default assignees are now the active Participants, not the Owner (fix(review-items): Assign the Owner when a Turn without a person asks #3015). Assignee checks and defaults also resolve a child id to its root. Before, they looked up participants by the child id.
  • Forged trees: a row that has a parent no longer matches its own participant id, so a cyclic root does not grant access. The old test missed this because its viewer was fake.

Keeping root Actors as Participants

  • The root write already adds the root Actor as a Participant when its Identity has a User. When an Identity gets its User later, upsertIdentityRecord now adds that User as a Participant of each root the Identity started.
  • Migration 0093 backfills those rows for Identities that were linked before this change.
  • actor_identity_id stays as the root Actor. It only records who started the Conversation. People stats come from Turns (ref(people): Attribute spend to the Turn Actor #3023).

Docs and tests

  • TERMINOLOGY.md drops Owner and adds Participant.
  • The actor-identity-end-state plan now says root Actor where it said Owner, and it records the "no owner" decision.
  • Many tests used testViewer(). Its fake User id only passed access through the email fallback that this PR removes. Those tests now use a persisted viewer (signedInViewer), and createConversationFixture signs its Actor in the same way that the web harness does.

Not covered: a later-linked Identity does not get rows backfilled for non-root Turns it authored while it had no User. The event rows do not record whether a message was Turn input or thread context. Today's behavior for those authors does not change.

any-resource-event-automations and the S3 storage tests also fail on main in my sandbox. I did not run evals.

via @dcramer.

--

View Session [Sentry]

A Conversation has no owner. Each Turn has an Actor, and the Participants
are the Users among those Actors, active or inactive through the
subscription. Access, feeds, last-subscriber archive, and review item
defaults now read only Participant rows, and the root Actor keeps no
special case. A Turn without a person assigns the active Participants.

An Identity that gets its User after it started roots now joins those
roots as a Participant, and a migration backfills the rows that this
missed before.

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

vercel Bot commented Nov 9, 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 9, 2026 8:36pm UTC

Request Review

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

10 screenshot changes — 10 changed · 0 added · 0 removed

Review screenshots in Frameshift

Conversation Attachment Zoom · Mobile
Conversation Attachment Zoom · Mobile
Changed
Conversation Captured Memories Popover · Desktop
Conversation Captured Memories Popover · Desktop
Changed
Conversation Details Watched Linked Work · Desktop
Conversation Details Watched Linked Work · Desktop
Changed
Conversation Event Log Virtual · Desktop
Conversation Event Log Virtual · Desktop
Changed
Conversation Long Transcript Touch · Mobile
Conversation Long Transcript Touch · Mobile
Changed
Conversation Share Details · Desktop
Conversation Share Details · Desktop
Changed
Show 4 more changed screenshots
Conversation Unsent Answers · Desktop
Conversation Unsent Answers · Desktop
Changed
Conversation Unsent Answers · Mobile
Conversation Unsent Answers · Mobile
Changed
Conversations Sections Collapsed · Desktop
Conversations Sections Collapsed · Desktop
Changed
Settings Mcp · Desktop
Settings Mcp · Desktop
Changed

@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 and found 1 potential issue.

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 14e86d6. Configure here.

A concurrent first write can create the Identity and its roots between
the read and the upsert. Check every upsert that leaves the Identity
with a User, not only one that saw an existing row.
…owner

# Conflicts:
#	packages/junior/migrations/meta/0091_snapshot.json
#	packages/junior/migrations/meta/_journal.json
#	packages/junior/src/api/conversations/membership.ts
@dcramer

dcramer commented Nov 9, 2026

Copy link
Copy Markdown
Member

needs rebased

…owner

# Conflicts:
#	openspec/changes/actor-identity-end-state/design.md
#	openspec/changes/actor-identity-end-state/proposal.md
#	openspec/changes/actor-identity-end-state/specs/conversation-identity/spec.md
#	openspec/changes/actor-identity-end-state/tasks.md
#	packages/junior/migrations/meta/0092_snapshot.json
#	packages/junior/migrations/meta/_journal.json
@dcramer
dcramer merged commit 262b63b into main Nov 9, 2026
44 checks passed
@dcramer
dcramer deleted the ref/participants-not-owner branch November 9, 2026 21:21
BYK pushed a commit that referenced this pull request Nov 10, 2026
…ite (#3066)

Fixes #3065.

Every Conversation write saved the root Actor's Identity again, even
though `actor_identity_id` never changes after the first write. When
someone posted from the dashboard into a Slack thread, `mergeActor`
added the poster's email to the Slack root Actor (the stored Actor had
no email). Saving that Identity again marked the email as verified,
which linked the thread starter's Slack Identity to the poster's User.
Since #3021, the poster also became a Participant of every Conversation
the starter had started.

`resolveConversationActorIdentityId` now returns the stored
`actor_identity_id` when the Conversation already has one. It saves an
Identity only on the first write, or for an older row that has none. The
merged stored Actor still exists, but later writes no longer act on it.
#2439 step 8 deletes it.

**Behavior change:** a later Conversation write no longer adds profile
fields (email, name) to the root Actor's Identity. The component test
that asserted this now asserts the new rule. In my reading of the code,
a person's own Turns still save their Slack profile on that Identity
through the Turn Actor resolution in `turn-cursor.ts`, but no test here
covers that.

**Not in this PR:** repairing Identities that are already linked to the
wrong User. #3065 has the detection signal (more than one Slack Identity
per User in the same team). The repair should follow the #2439 dry-run
and migration rules.

The new test in `messages.test.ts` fails on `main`: the starter's Slack
Identity ends up with the poster's `user_id` and email. In the full
local suite, the thread tests sometimes fail with `Conversation parent
changed for agent:4ee809ff…`. `main` hits the same failure, so it's an
existing flake.

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

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3A967b857c3c67d14269a6421e -->

--

[View Session in
Sentry](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A967b857c3c67d14269a6421e/?project=4510944073809921)

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

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Daniel Szoke <[email protected]>
BYK added a commit that referenced this pull request Nov 10, 2026
…3046)

Refs #3030

#3037 added a mock that reports waiting Conversations, so this PR also
moves that mock to the new `items` shape
(`mock-reporting/review-items.ts`).

"Needs attention" mixed three signals: Review items that wait on you,
unread messages, and any open PR while Junior was idle. Rows jumped into
it for an ack from Junior or for a PR nobody needed to touch. This PR
narrows the section to one rule and renames it **Needs you**.

## The rule

A Conversation is in **Needs you** when it has an open **action** Review
item assigned to you. That rule already existed (`reviewItemNeedsUser`,
`/api/review-items/waiting-conversations`). This PR makes it the only
input:

- **Unread** no longer moves a row. The unread dot and bold title stay
as they are (the row-marker redesign is #3032).
- **Open PR while idle** (`unfinishedWork`) no longer counts. The client
field is deleted. The server field stays because auto-archive and
Priority use it.

The same rule drives the Inbox count, the Inbox "Needs you" group, and
the Board, so one item shows the same way everywhere.

## PR asks become Review items

Plugins already put items on the review desk through
`PluginConversationReviewItems`. A plugin can now mark an item as an ask
with `waitsOnAssignees: true`. Core stores it as an `action` with no
question, so the existing rule counts it. I did not add a separate hook.
A second channel would count the same fact twice, and the review desk
already owns assignment (Participants, #3021), dedupe, visibility,
close, and the Slack card.

- **Schema:** the `junior_review_items_kind_check` constraint now also
allows an action with no `request` when its dedupe key starts with
`plugin:` (migration `0098_review_item_plugin_actions`). An agent's
action still needs a question.
- **Replies:** reply matching skips plugin items
(`listReplyActionItems`). The plugin closes them when the provider state
changes, so a "merged it, thanks" reply cannot close one by mistake.
- **GitHub, Ready to merge:** the existing item becomes an ask, titled
`Ready to merge · #946`. It closes when the PR merges, closes, or stops
being ready, as before.
- **GitHub, Review requested (new):** when GitHub requests a review on a
Junior PR from the requester (matched through their linked GitHub
account), the plugin adds `Review requested · #946` to the requester's
Conversation. The ask updates in place on a new request (same dedupe
key). It closes when they submit a review, when the request is removed,
or when the PR closes. Every fact comes from the webhook payload, so the
ask needs no GitHub read and no new table. Team requests are skipped.

## Row chip

The chip keeps its place and its `?review=open` link. It shows the
newest title with "+N more". A plugin item shows the plugin's mark
(GitHub) in place of the Inbox icon. The accessible `Tooltip` lists
every waiting title in full, with no native `title` attribute. The API
now returns `items: [{ title, plugin? }]`, newest first, in place of
`title` and `count`.

| Before | After |
| --- | --- |
| ![Before: Needs attention holds unread and open-PR
rows](https://junior-prod.sentry.dev/public/artifacts/46d47483-13e9-4845-9107-2b0305e1f37a.png)
| ![After: Needs you holds only the waiting
row](https://junior-prod.sentry.dev/public/artifacts/2aa8b910-bede-44ed-9bc0-46c10c276ed7.png)
|
| ![Before: chip,
light](https://junior-prod.sentry.dev/public/artifacts/c0b2235d-4c53-4512-9756-0f2ff4155e1f.png)
| ![After: chip with GitHub mark,
light](https://junior-prod.sentry.dev/public/artifacts/78defe67-342a-4389-8885-a6a8c734360c.png)
|

Tooltip with every waiting item:

![Chip
tooltip](https://junior-prod.sentry.dev/public/artifacts/f68214b1-732e-480f-96b9-e39cfec33040.png)

All shots come from the mock-mode e2e harness
(`conversations-attention.spec.ts`). The "after" mock has a GitHub ask
plus an agent question on one Conversation.

## Things to know

- **Board:** "Ready" still means an open plugin item about the change. I
dropped the `kind = notice` filter so it keeps working after the
cutover. A PR waiting on the requester's review now also shows as Ready.
That is a guess the Board already names in `columns.ts`.
- **Cutover:** Ready-to-merge notices that are open now stay notices
until the PR's readiness changes. Until then they show as FYI, not Needs
you. I did not backfill, because a core migration would need to name a
GitHub dedupe key.
- **Collapsed section state:** the section key changes from `attention`
to `needs-you`, so anyone who collapsed it sees it expanded once.

## Follow-ups (why this says Refs, not Fixes)

- **Reviews on PRs Junior did not open.** A colleague's PR has no
Conversation to hold the ask, and Junior maps a GitHub login to a person
only through a linked account. Doing this needs Review items without a
Conversation (or an Inbox-only home) and a login → Identity lookup in
the plugin API.
- **Review requested from someone other than the requester** on a Junior
PR. Same login → Identity gap.
- **Changes requested.** On a Junior PR, Junior handles that feedback,
so it is not an ask of the viewer today. It needs a product decision.

## Likely conflicts

- **#3032 (sort order, reorder freeze, row markers):** both edit
`conversationSections.ts` and `ConversationSidebar.tsx`. Here the
section rename and the `attentionIds` → `waitingIds` option are the main
changes. The chip moved to `WaitingChip.tsx`.
- **#3031 (progress replies don't mark unread):** touches unread, not
section membership. Small overlap at most.
- **#3036 (Inbox bundles):** consumes Review items. The new plugin asks
land in its "Needs you" group with no change there.
- **Migrations:** this adds `0098_review_item_plugin_actions`. A
parallel PR that also adds a migration needs a renumber.

## Frameshift changes

I pulled the baseline, candidate, and diff images for `ed2372e9a`
(report on `085c4f39c`). I measured where each of the 59 changed pairs
differs, and I looked at every pair that changed outside the
conversation list.

| Count | Cause | Status |
| --- | --- | --- |
| 44 | Conversation list only, desktop and mobile. Rows that were unread
or had an open PR leave the waiting section, and the section is renamed
"Needs you" (collapsed count 3 → 1). Row menus and row tooltips move
with their row. | Expected |
| 4 | `conversations-pinned` and `conversation-sidebar-review-chip`,
dark and light. The chip shows the GitHub ask with the GitHub mark. |
Intended |
| 6 | List changes plus noise: `conversation-unsent-answers` desktop
(transcript scroll), `share-details` and `event-log-virtual` (a header
tooltip shows), and `captured-memories-popover`,
`details-watched-linked-work`, and `push-notifications-tip` (another
video frame). | Expected + noise |
| 5 | Noise only: `conversation-unsent-answers` mobile and
`long-transcript-touch` (transcript scroll), `memories` mobile (chart
hover tooltip), `settings-mcp` (random port), and `automation-page` (the
rail ends 10px short in a 910px capture). | Noise, not from this PR |

How I checked the noise:
- **`conversation-unsent-answers`:** I ran it 3 times on `main` and 3
times on this branch. Both flip between the same two transcript scroll
positions.
- **`automation-page`:** it renders the same pixels on `main` and on
this branch locally, so the CI difference does not come from this PR.

One finding, now fixed in `48b9d20c0`: the new tooltip check hovered the
chip before the existing `conversation-sidebar-review-chip` shots, so
they captured the row's hover actions. The plain shots now come first,
and the tooltip shot follows. The "after" chip shot above is retaken
from the fixed order.

## Testing

- Integration: `plugin-review-items.test.ts` (a plugin ask waits on its
assignee, counts, carries the plugin name, and a reply does not close
it), `review-items/actions.test.ts` (new `items` shape),
`board.test.ts`.
- GitHub plugin: new `pull-request-review-request.test.ts` through the
real webhook route (requester match in any case, other people and teams
skipped, close on review or removal, update in place on a new request),
and the updated `pull-request-ready.test.ts`.
- Dashboard unit: `conversationSections.test.ts`.
- Dashboard e2e: `conversations-attention.spec.ts` (Needs you, unread
stays in place, chip mark and tooltip) and
`conversation-threads.spec.ts`. Full e2e run: 132/133 passed. The one
failure (`conversations-event-log`) timed out under 4 workers and passes
alone.
- `pnpm typecheck`, `pnpm lint`, `pnpm file-length:check`. The full test
suites for junior-github and junior-dashboard pass, and so do the core
API and review-item integration tests.

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

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

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A347ecd22af4f5aa5e0960cd65ba322a4)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A347ecd22af4f5aa5e0960cd65ba322a4/?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]>
Co-authored-by: David Cramer <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 79b1dbe8 Deployed Nov 9, 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