Repository navigation
feat(spaces): Group a Space's Threads by what they need - #4416
Conversation
The Space panel lists its Threads under Needs you, Working, Waiting, and Done, each newest Message first, with Done collapsed. One shared attentionGroups order sorts the panel and the busy rows of In flight, so the Space list no longer sorts by last Message alone. User-facing copy for a Space's child Conversations says Thread. Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
285 screenshot changes — 281 changed · 4 added · 0 removed Review screenshots in Frameshift Show 12 more changed screenshots263 more changed screenshots in Frameshift. |
Also stop the mock Space roll-up from reading Inbox items, so the pane in other screenshots stays as it was. Co-Authored-By: David Cramer <[email protected]>
|
I'm not sure how I feel about this yet because these aren't totally the styles we use elsewhere. And this wouldn't go farther away from unifying it with agent trees and the parent-child hierarchy we already have. It is a little bit more useful, I think, but it also might just be useful enough if it's in sorted order, like this with the icons and the rest of the metadata we have here |
Stacked on #4413 (Space Conversations become children of the Lead). Merge that first; this PR's base is `agents/lead-children`. A Space's Threads are now the Lead's child Threads, so the Space panel beside the Lead renders the same Threads panel that every Conversation with children shows, instead of its own list. #4416 added that custom list; this PR removes it (`SpaceThreads.tsx`). ### The Threads panel, everywhere `ConversationThreads` now groups its rows, for every Conversation with Threads and for a Space: - **Needs you · N**: the child's tree waits on the viewer, or its run failed or is blocked. - **Working · N**, then **Waiting · N** (it watches for an Event or a Timer, or its run is paused). - **Done · N** last, collapsed. Its heading opens it. Archived Threads go here, so "Show archived" opens it. - In each group, the most recent update comes first. A row's icon now shows a wait on the viewer, work in its tree, or a Watch over the run's own status, so a row under Needs you or Working does not show a check mark. Tasks keep their flat list. Waiting starts open. Those Threads still have work in flight, and In flight shows them too, so hiding them would put active work two clicks away. Only Done needs nothing and grows without limit, so only Done starts collapsed. ### One order `attentionGroups` in `conversationSections.ts` is the only sort. It takes rows of any shape with a reader for their group and time. In flight's busy rows read feed rows (`attentionOrder`), and the Threads panel reads child agent rows. The group order and the newest-first rule live in one place. ### API `GET /api/conversations/:id/agents` now returns each child's `treeState` and `watching`, from the same `readConversationTreeStates` read that feed rows and the Space roll-up use. Without it, the panel could not tell a child that waits on the viewer from one that is done. It adds one SQL statement to the read, in parallel with the metrics reads. Redacted rows keep both fields: they show no content. ### Mock data The mock `/agents` route answers a Lead with its Space's Conversations as child Threads, as the API does after #4413. ### Follow-up deletion Space-only code that the Lead's children now duplicate. This PR keeps it: - `packages/junior-dashboard/src/client/spaces/queries.ts` `useSpaceConversationsData`, and its read in `packages/junior-dashboard/src/client/lead/useLeadWork.ts` `useLeadWork`: the Lead looks up its Space's Conversations from the `spaceId` feed, which are now its child Threads. - `packages/junior/src/api/conversations/list.ts` `conversationSpaceFilter`, the `spaceId` field of `conversationFeedQuerySchema` in `packages/junior/src/api/schema/conversation-feed.ts`, and the mock `filterMockConversationsBySpace` in `packages/junior-dashboard/src/mock-reporting/spaces.ts` (and its branch in `conversation-reports.ts`): the feed filter goes once nothing reads it. - `packages/junior-dashboard/src/client/lead/leadWork.ts` `LeadWorkState` and `packages/junior-dashboard/src/client/lead/LeadWorkStatus.tsx` `leadWorkStatus`: a second set of states and icons beside `ConversationStateIcon`, used by the Lead's watch reports (`lead/watchReport.ts`, `lead/LeadWatchReport.tsx`). | | Dark | Light | | --- | --- | --- | | Desktop |  |  | | Phone |  |  | <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3Ab5ee8d5333087bc45e7c6d1574b48eaf --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3Ab5ee8d5333087bc45e7c6d1574b48eaf) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Ab5ee8d5333087bc45e7c6d1574b48eaf/?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]>
…ead design (#4428) States where Spaces and the Lead are heading. A Space uses the core Conversation tree (parents, roots, Participants, access, stops, archives, Watches, updates), and only a few Space-specific layers sit on top of it. - `design/spaces.md` is rewritten. The Lead is the root of the Space's tree. Every Space Conversation, whether the Lead starts it, a person starts it in the Space, or a person moves it in, is a child of the Lead and has the Lead as its root. Children inherit the Lead's Participants. Archive and snooze act per child. The file lists the Space layers explicitly: metadata, membership, configuration, the Lead's prompt and tools, moves, and rendering (the sidebar, the Threads panel, and top-level lists). - `design/lead.md` is new. It covers the Lead's role, its curated manager tool set (it runs Threads, reads, plans, and asks people, and it never writes or runs code), and the Turn gates: explicit reply on child and Event Turns, quiet `done` updates, and child results as claims. Gaps record what is not on main yet. - `design/agent-teams.md`: a Lead's team is its Space, and the Lead gaps move to `lead.md`. - `design/child-agents.md`: removes contradictions with Spaces. A move changes a child's parent, a moved Conversation delivers to its own Location, and the 8-child limit does not apply to a Lead's children. - `TERMINOLOGY.md`: updates Lead, Space, Thread, Team, Delivery, and Participant, and adds Top-level Conversation (derived, not stored). Related: #4377 (`thread` kind), #4411 and #4414 (moves), #4416 (Threads panel). #4413 edits some of the same lines. After this merges, it should drop those doc changes and delete only the gaps it closes. <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:local%3Aweb%3A56172fc7761dc3a4c09f6bc7 --> -- [View Session](https://junior-prod.sentry.dev/conversations/local%3Aweb%3A56172fc7761dc3a4c09f6bc7) [[Sentry]](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A56172fc7761dc3a4c09f6bc7/?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]>
|
Agreed, and the follow-ups took that path. #4433 replaced this custom list with the shared agent-tree Threads list: the same rows, icons, and metadata, in attention order with Done collapsed. #4444 then made a Lead render the regular |
The Space panel beside the Lead now lists the Space's Threads in groups, like the Threads tab of Claude Code Projects:
Waiting starts open. Those Threads still have work in flight, and In flight shows them too, so hiding them would put active work two clicks away. Only Done needs nothing and grows without limit, so only Done starts collapsed.
One order
attentionGroupsinconversationSections.tsis the only sort. The Threads panel groups with it, and In flight's busy rows (after pins, which keep the viewer's order) useattentionOrder, which flattens the same groups. This changes In flight in two ways: a row that needs the viewer now sorts above rows that work or watch, and busy rows sort by last Message instead of the feed's activity time, like every other list.Why the Space list was out of order
On main, the Space list sorted only by last Message (
newestFirst) and took its icons from the Inbox waiting map. State never changed the order, so a Thread that needed you could sit below newer done ones. The earlier fix (feat/space-conversation-order, c9a4fc55b) added a sharedattentionOrderfor both lists, but it never shipped: the In flight change waited on a decision, and then the work was held for Lead-children PR 2. This PR replaces that branch.Copy
A Space's child Conversations are Threads in the dashboard: the panel card and its empty and error text, the Space row's failed label ("A Thread failed"), and the Lead's first-run intro. Internal names do not change.
Mock data
The mock Space feed now gives each row a tree state the way the API does, with needs-you from the viewer's open action items. So in the mock, Billing migration's pane row now shows Waiting on you, and the existing Space and Lead screenshots change with it.
Waits on Lead-children PR 2
agents/lead-childrenhas no open PR and is behind main, so this PR builds on main and does not depend on it. The panel readsGET /api/conversations?spaceId=, so after Space Conversations become children of the Lead:spaceIdfeed filter.via @dcramer.
--
View Session [Sentry]