Repository navigation
fix(conversations): Archive idle conversations and count child-agent work on the root - #2814
Merged
Merged
Conversation
…work on the root Co-Authored-By: BYK <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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 7efbcd4. Configure here.
BYK
requested changes
Nov 6, 2026
BYK
left a comment
Member
There was a problem hiding this comment.
Behavior change to review: Archive done now (and the archiveDoneConversations MCP tool) has no wait time, so it now archives every idle conversation that has no open work, is not pinned, and does not wait on the user. A new human message still restores a conversation.
This is wrong. It should still check the staleness criteria.
Archive done now and the archiveDoneConversations MCP tool now use the viewer's auto-archive wait time, the same as the scheduled sweep. A conversation with activity during the wait time stays in the feed.
BYK
approved these changes
Nov 6, 2026
BYK
added a commit
that referenced
this pull request
Nov 6, 2026
…s attention The GitHub plugin now reports open pull requests that are ready to merge, have a failed check suite on the head commit, or have a change request since the last push. Core folds them to the root conversation, the feed exposes workNeedsAttention, and the dashboard puts those conversations in Needs attention. Stacks on #2814. Co-Authored-By: BYK <[email protected]>
BYK
added a commit
that referenced
this pull request
Nov 6, 2026
…eds attention (#2824) An open pull request that Junior is not working on waits on a person: merge it, close it, or review it. The dashboard now puts these conversations in **Needs attention**. - A conversation goes to Needs attention when it has unfinished work (an open linked pull request, child-agent work included since #2814) and its status is not `active`. While Junior runs, it stays in its time section. - The feed already sends `unfinishedWork` and `status`. No new plugin API, feed field, or stored GitHub state. - Needs attention lists the newest activity first, like the time sections. - `attentionIds` is now required in `buildConversationSections`. - "Unread until acted on" is a separate change. This PR does not touch the finished/unread indicators. Limitation: only conversations in the loaded feed pages show in Needs attention. ### Screenshot Mock dashboard. "Package release and self-update" and "Dashboard QA edge cases" have open pull requests and are idle, so they are in Needs attention. "Investigate checkout latency" also has unfinished work but is running, so it stays in Today.  ### Checks - `@sentry/junior-dashboard`: `conversationSections` tests, typecheck, and lint passed. - Dashboard e2e: 107 passed. The `conversations-attention` specs now check the row's section, because the mock feed has open-PR conversations in Needs attention. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3Ac7f95be098be3d02ee855c42e6bc322f --> -- [View Session in Sentry](https://sentry.sentry.io/explore/conversations/agent%3Ac7f95be098be3d02ee855c42e6bc322f/?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]>
BYK
added a commit
that referenced
this pull request
Nov 7, 2026
…cted on (#2828) Before this change, the "finished since you last saw it" state lived in browser localStorage, and opening a conversation cleared it. A conversation left Needs attention as soon as you looked at it, and the state did not sync across devices. Now a conversation stays in Needs attention until you act on it. The state comes from the read position that the server already stores for each user (`junior_conversation_read_positions`). There is no new column. ## Behavior - **Opening does not read.** The transcript reports nothing until the first user input in that visit: a wheel, touch, pointer, or key input in the transcript (scroll keys on the page count when nothing has focus), or focus or a click in the composer. A scroll that the page makes (to the "New" divider, or auto-follow while rows stream in) does not count. After the first input, rows report as they come into view, as before. - **Unread rule.** A completed root is `unread` when Junior's latest visible reply (an assistant message that is not quiet) has a seq after `greatest(stored lastReadSeq, viewer's latest message seq)`. Tool, status, and quiet events fold into activity rows, so they do not light it up. Your own reply, from the dashboard or Slack, counts as acted (same rule as #2730). - **Archive** and **Mark as read** read to the last event. **Mark as unread** is the one backward write: it sets the position just before the latest visible reply. Automatic reports stay forward-only. - The leading row marker toggles read state (from 10101b0). The conversation menu has Mark as read / unread too, for mobile and deep links. - Open-at-unread, the "New" divider, and MCP `markConversationRead` do not change. ## Missing read position and rollout - A root with no stored position counts from its start, so a new conversation reaches Needs attention. - Migration `0084_read_position_backfill` (custom, via `drizzle-kit generate --custom`) gives each root in each user's feed (participant rows plus root-actor roots) a position at its last event. Existing positions move forward to the last event. Nothing lights up at deploy. Side effect: the "New" divider does not show on the first visit after deploy for those conversations. ## Child conversations Child-agent events have their own `conversation_id`. The root gets only collapsed subagent events and the result messages. The root agent's reply after a child finishes is a root assistant message, so a root-only check is enough. No subtree rollup. ## Cost The feed adds one lateral query per root on the page: newest-first, `limit 1`, on `junior_conversation_events_message_role_idx`, plus a `max(seq)` of the viewer's messages per root. It runs only for viewer feeds. The detail ETag hashes the unread state, so a poll after a read or a mark gets the new state. ## Client details - The reporter takes the live stored position. When it goes down (Mark as unread, or a cached copy at open that is ahead of the server), rows after it report again. - The detail cache keeps the newest read position against stale polls. It now takes the server's position when the server says the conversation is unread, which is how a Mark as unread from this or another device arrives. ## Removed - `junior_conversation_participants.read_at`, its migration, and the related code and tests. - `useConversationFinishedIndicators` (localStorage) and its tests. ## Screenshots Opened, still in Needs attention with the "New" divider:  Row marker as the read toggle:  ## Checks - `pnpm typecheck`, `pnpm lint` (includes file length and migration metadata): pass - Integration `tests/integration/api/conversations/` and `tests/integration/api/mcp`: 120 pass. `unread.test.ts` covers: no position counts from the start, quiet reply does not count, open does not clear, detail and ETag poll, Mark as read, Mark as unread, archive, viewer's Slack reply, per-viewer state, and non-participant 404. The backfill SQL was run against seeded rows: it inserted and moved positions, and the unread set went from 2 to 0. - Dashboard unit tests: pass, except `dashboard-output.test.ts` (fails on `main` in the sandbox too, `nitroIntegration` export). - E2E `conversations-attention`, `conversation-archive`, `conversations-read-position`, `conversations-read-position-links`, `conversations-long-transcript`: pass. Open does not clear, transcript input does, marker and menu toggles work. Independent of #2814, which handles the PR-state signals in `unfinishedWork`. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A742e951b57f3b6673144b915f53f49a2 --> -- [View Session in Sentry](https://sentry.sentry.io/explore/conversations/agent%3A742e951b57f3b6673144b915f53f49a2/?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]>
23 tasks done
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.

Auto-archive skipped most stale conversations for two reasons.
A conversation with no plugin-reported work was never done. Most conversations never open a pull request, so they could never auto-archive. Now a conversation with no reported work is done when the existing checks pass: the whole tree is idle and had no activity for the wait time, it is not pinned, and no open Review item waits on the user. A conversation with reported work still waits until all of it finishes and the wait time passes. The Settings copy ("when all of its linked work … is merged or closed and nobody replies during the wait time") already describes this. When a plugin cannot report work, the run archives nothing from that page, because the failure can hide open work.
Work done by a child agent was missed. A child agent runs under its own conversation id, so a pull request that it opens links to the child. Auto-archive and the feed asked plugins only about root ids. In the latest 300 Junior-authored PRs in getsentry, 82 carry an
agent:child id.listConversationWorknow also asks about the children of each candidate root and counts their work for the root. This change needs that: without it, a root whose child has an open PR would now get archived.listWaitingConversationshad the same gap. An action item added by a child agent links the child, but Needs attention compares against root ids, so the root never showed. It now rolls up to the root.Archive done now (and the
archiveDoneConversationsMCP tool) uses the same checks and wait time as the scheduled sweep. It does not need auto-archive on, and it skips conversations where the user turned auto-archive off.via @BYK.
--
View Session in Sentry