Repository navigation
feat(conversations)!: Archive conversations for everyone - #2900
Merged
Merged
Conversation
Every archive now lives on junior_conversations.archived_at and applies to every participant, root or child. applyToChildren follows the same refusal, cascade and restore rules on a root. Pins stay per person; pinning restores the archive and archiving no longer unpins. Auto-archive archives a root once any opted-in participant is idle past their grace time. Migration 0086 backfills a root only when every participant archived it, copies child_archived_at, and drops it.
Archive now lives on junior_conversations and bumps detail_version, so the versions hash no longer reads it from the participant row. Co-Authored-By: David Cramer <[email protected]>
…hoices Archive is shared, so a run must respect every participant: a pin, auto-archive turned off, or a Review item that waits on any person keeps the root. The 0086 backfill no longer archives a root whose actor has no participant row, and it keeps child_archived_at so the release before still reads it during rollout. Archive copy for tools and the dashboard now says it applies to everyone.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dcramer
approved these changes
Nov 7, 2026
dcramer
left a comment
Member
There was a problem hiding this comment.
this is a big behavior change but tbqh its probably the right future looking direction
we just need archived to be a meaningful thing
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 a1c7c16. Configure here.
…estores A root actor may have no participant row, so the update did nothing and another member's auto-archive could archive the root again.
Contributor
|
14 screenshot changes — 14 changed · 0 added · 0 removed Review screenshots in Frameshift Show 8 more changed screenshots |
sentry-junior Bot
added a commit
that referenced
this pull request
Nov 7, 2026
Resolve conflicts with the shared archive (#2900) and agent tree kinds. Renumber the child spawn migration to 0087 and regenerate its snapshot. Keep `kind` in the lineage entry for the agent tree, and drop its Location and visibility: child Runs read the copy bound at spawn. Drop the supersede refactor (supersede-turns.ts) and its tests. The bind-at-spawn design does not need it.
23 tasks done
This was referenced Nov 8, 2026
dcramer
added a commit
that referenced
this pull request
Nov 9, 2026
#2939) Archive is shared now (#2900), so one person cannot drop a conversation that someone else still works in. This adds a per-person unsubscribe for that case. **Contract** The Given/When/Then contract is at the top of `packages/junior/src/api/conversations/subscription.ts`. The feed filter, Turn input membership, auto-archive, and each entry point point to it. Each scenario has one test in `tests/integration/api/conversations/subscription.test.ts`: - Unsubscribing removes it from only your feed, and you keep access (open, search, archived list). - It stays out of your feed until you address Junior again (Slack mention or DM, or a dashboard Message). A passive Slack reply, or other people working, does not bring it back. - Pin and Subscribe also bring it back. Unsubscribe drops your pin. - The last subscriber leaving archives it for everyone. The person who started it counts as subscribed before they post. - Whoever restores an archived conversation (a Message or Unarchive) is subscribed again, so a restored conversation is never in no feed. - The agent tool changes only the person who started the Turn. Nobody can subscribe or unsubscribe another person. The tests use only the public API, the agent tool, and stored Slack Turns. They write no participant rows by hand, so a storage change does not need a test change. Each rule fails its test when I break it on purpose. **Entry points** - Dashboard: **Unsubscribe** / **Subscribe** in the conversation `⋯` menu. - Agent tool `setConversationSubscription` (deferred, source `conversation-subscription`). It takes only `subscribed`. The person is the Turn actor and the target is the current Conversation, so the model cannot name someone else. Child agents do not get it. - MCP tool `setConversationSubscription` under `conversations:manage`, for the signed-in user. - HTTP: `PATCH /api/conversations/:id/subscription` with `{ subscribed }`. A child id resolves to its root. **Implementation** - Migration 0088 adds `junior_conversation_participants.unsubscribed_at`. The row stays, so access does not change. - The re-subscribe happens when a Turn starts from the person's Message and `meta.explicitMention !== false`, or when their Message or Unarchive restores an archived root. - Unsubscribe and pin lock the root with `FOR NO KEY UPDATE`, so they run one at a time with each other, archives, and Turns in the root, but never block a Turn in a child that adds a participant or child row. The last-subscriber archive is one update over the tree that waits for in-flight child Turns; it then checks subscribers again and undoes the archive if such a Turn subscribed someone. - Auto-archive ignores unsubscribed participants. - Detail returns `subscribed` for participants, and the detail ETag hashes it. **Not in this PR** - No Slack slash command or undo toast. **Checks** - typecheck and `pnpm lint` pass. Throwaway stress tests ran pin, mention, a second unsubscribe, and a new person's mention in a child thread concurrently with the last unsubscribe. All passed with no deadlocks; the child-thread case deadlocked 23 of 25 times before this lock change. Dashboard unit tests pass. The subscription, MCP route, and MCP tool suites pass, as do the archive, auto-archive, list, and conversation storage suites. <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0B595QDZLL%3A1794165313.465219 --> -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AC0B595QDZLL%3A1794165313.465219) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0B595QDZLL%3A1794165313.465219/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: David Cramer <[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.

Part of #2792. Archive now applies to everyone in a Conversation, for roots and children alike.
Model
junior_conversations.archived_atholds the archive for every Conversation. Nothing reads or writes the per-personjunior_conversation_participants.archived_atanymore.applyToChildrenfollows the same refuse-and-cascade rules on a root as on a child.noParticipantKeepsRoot,notWaitingOnAnyone/reviewItemNeedsSomeone).Migration 0086
archived_aton a root only when every member had archived it. The root's actor counts as a member who has not archived when it has no participant row.child_archived_at(schemalegacyChildArchivedAt), so code from the previous release keeps working during the deploy. A later migration drops it, together with the participantarchived_at.Copy
archive-done-conversations,search-conversations,set-conversation-auto-archive),AutoArchiveToggle,AutoArchiveSettingsanddocs/mcp-server.mdnow say archive applies to everyone.detail-etag.tsno longer hashes the participant archive. Archive writes bump the Conversation'sdetail_version.Known items, not in this PR
archiveConversationon a root with unarchived children returns 409 unlessapplyToChildrenis passed.CONCURRENTLY.pin.tsclears the archive and upserts the pin in two writes, with no transaction.Checks
db:generateshows no drift. Dashboard e2e passed on 26eefaf.auto-archive.test.ts, run in CI.via @dcramer.
--
View Session [Sentry]