Repository navigation
ref(conversations): Replace the Conversation Owner with Participants - #3021
Merged
Merged
Conversation
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]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
10 screenshot changes — 10 changed · 0 added · 0 removed Review screenshots in Frameshift |
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 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
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
approved these changes
Nov 9, 2026
This was referenced Nov 9, 2026
23 tasks done
This was referenced Nov 10, 2026
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 | | --- | --- | |  |  | |  |  | Tooltip with every waiting item:  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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.mddefined an Owner (from the #2439 plan), and some code gave the root Actor rights that no other Participant had. This PR removes both.Behavior
union,viewerConversationMembership, and the root Actor fallback inhasSubscriberare gone.Keeping root Actors as Participants
upsertIdentityRecordnow adds that User as a Participant of each root the Identity started.0093backfills those rows for Identities that were linked before this change.actor_identity_idstays 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.mddrops Owner and adds Participant.actor-identity-end-stateplan now says root Actor where it said Owner, and it records the "no owner" decision.testViewer(). Its fake User id only passed access through the email fallback that this PR removes. Those tests now use a persisted viewer (signedInViewer), andcreateConversationFixturesigns 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-automationsand the S3 storage tests also fail onmainin my sandbox. I did not run evals.via @dcramer.
--
View Session [Sentry]