Skip to content

feat(spaces): Show a Lead's Conversation details instead of a Space panel - #4444

Merged
dcramer merged 22 commits into
mainfrom
feat/lead-conversation-details
Nov 26, 2026
Merged

dcramer merged 22 commits into
mainfrom
feat/lead-conversation-details

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

A Lead is a Conversation, and since #4413 a Space's Threads are its Lead's children. The Space-only details panel repeated what Conversation details already show, so two panels had to be kept in step. A Lead now opens the same Conversation details panel as any Conversation: its Threads (grouped, Done collapsed), To-dos, Inbox items, linked work, Tasks that open in the drawer, Participants, and memories.

The Space keeps a small layer inside those details: an About card with its description, then Members and Settings, after the Tasks and before Participants. ConversationDetails takes them as one optional space slot. SpaceDetailsPanel is deleted. A Space without a Lead still shows the same cards on its page.

On a Lead, the details button and panel are now named "Conversation details", as on other Conversations. A Space page reads three more endpoints, the Inbox items, To-dos, and Watches that every Conversation's details read, so its request budget goes from 15 to 18.

Tree state on the feed's nested Threads

The sidebar orders a root's Threads with attentionOrder (#4433), but the feed sent nested Threads without a tree state. A Thread that waits on the viewer sorted under Done and could hide past the collapsed cap. readFeedThreadRecords now reads each Thread's tree state and Watch flag with readConversationTreeStates, in parallel with its first-message read. The feed takes one more serial SQL round (3 to 4), and each Thread item grows by those two fields.

Dark Light
Desktop dark desktop light desktop
Phone dark phone light phone

via @dcramer.

--

View Session [Sentry]

sentry-junior Bot and others added 16 commits November 26, 2026 03:58
A Space's Conversations are now child agents of its Lead, so results,
messageAgent, listAgents, Watches, stop, archive, and roll-ups work the
same as for any parent. The Lead is the tree root of its Space, and a
new top_level_conversation_id keeps per-work state, such as Participants,
pins, and lists, on each of the Lead's children.

The Lead starts work with startAgent, and startConversation is removed.
A move into, out of, or between Spaces re-parents the Conversation and its
subtree, and refuses to make private work public. A Lead has no cap on
active children, its children count as roots for maxAgentDepth, and it
hears a child's done as a Conversation note.

Co-Authored-By: David Cramer <[email protected]>
Drop top_level_conversation_id. A Conversation in a Space has the Lead as
its parent and its root, as in any agent tree, so Participants and access
come from the Lead. A move rewrites the root of the moved subtree, and the
migration does the same for existing Space work.

Co-Authored-By: David Cramer <[email protected]>
A Space's members were a separate table. With the Lead as the root of every
Space Conversation, they are now its Participants, like any agent tree.
Creating a Space makes its Lead, joining adds a Participant, and leaving
removes it. The migration makes a Lead for every Space and copies the old
members onto it. The old table stays unused until a release without it is
live.

Co-Authored-By: David Cramer <[email protected]>
The Lead transcript shows the Conversations it starts as child agent rows,
like any parent. Drop the Lead page state that only the removed started
Conversation card read.
…bers

A person joins a Space before they post in it on the web. Before, only the
Lead refused web posts from non-members, so a web post in a public Space
Conversation made the poster a member.

Co-Authored-By: David Cramer <[email protected]>
A Lead heard a child's done as a quiet note, so it could not act on the
result, and it broke the rule that a parent gets each child's result.
Space work is a child of its Lead, so feed code that matched a row's id
to Participant roots or to root_conversation_id missed it. A member's feed
now lists the Space's work, and a row reads its own subtree for Threads,
work owners, annotations, and search. Repository and annotation search
resolve a match to its top-level Conversation. createSpace also removes
the Space when its Lead fails to save.

Co-Authored-By: David Cramer <[email protected]>
Leave and unsubscribe on a Space Conversation act on the Lead, its root.
When the person was the last subscriber, that archived the Lead's whole
tree, which is every Conversation in the Space. Only a Space archive ends
a Space now. Also drop stale startConversation and root wording.
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 | ![dark
desktop](https://junior-prod.sentry.dev/public/artifacts/cc616c98-0230-4cae-86c4-706801ad0f9b.png)
| ![light
desktop](https://junior-prod.sentry.dev/public/artifacts/3cdbc28c-0180-4e93-93d7-d07693c50980.png)
|
| Phone | ![dark
phone](https://junior-prod.sentry.dev/public/artifacts/8371ad70-450b-4fc4-ab48-18865a29a51d.png)
| ![light
phone](https://junior-prod.sentry.dev/public/artifacts/ba207bc6-165e-4ca4-b8bc-e871f0f8ea04.png)
|

<!-- 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]>
# Conflicts:
#	design/agent-teams.md
#	design/child-agents.md
#	packages/junior-evals/evals/agent/lead.eval.ts
…per Conversation

A Thread that the grouping puts in Needs you because its tree waits on
the viewer now shows that icon, even when its own run failed or is
blocked. The Threads panel gets a key per Conversation, so an open Done
group does not stay open on the next Conversation.
A Lead's child counts as a root for limits.maxAgentDepth, and the depth
check in spawn.ts already allows it. The tool binding did not know that,
so with depth 0 such a child never got startAgent. The run now passes
whether its Conversation is top-level work.

Co-Authored-By: David Cramer <[email protected]>
…anel

A Lead opens the same Conversation details as any Conversation: its
Threads, To-dos, Inbox items, linked work, and Participants. Its Space's
description, members, and settings show as cards in those details, and
the Space-only details panel is gone.

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

vercel Bot commented Nov 26, 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 26, 2026 7:36am UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 26, 2026
Co-Authored-By: David Cramer <[email protected]>

# Conflicts:
#	TERMINOLOGY.md
#	design/agent-teams.md
#	design/spaces.md
…lead-conversation-details

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

# Conflicts:
#	packages/junior-dashboard/src/client/shell/pages/spaces/SpaceDetails.tsx
@sentry-junior sentry-junior Bot mentioned this pull request Nov 26, 2026
2 of 12 tasks
The Participants of a Lead are its Space's members, and a person joins a
Space on purpose. A mention in a public Space's work added the mentioned
person as a Participant of the Lead, which made them a member without
Join. Mentions in a Space now add nobody, on the dashboard and in Slack.
Base automatically changed from agents/lead-children to main November 26, 2026 07:19
The sidebar orders a root's Threads with attentionOrder, but nested feed
Threads had no tree state, so a Thread that waits on the viewer sorted
under Done and could hide past the collapsed cap. The Thread read now
reads each Thread's tree state with its first messages, so the feed
takes one more SQL round.

Co-Authored-By: David Cramer <[email protected]>
@github-actions github-actions Bot added risk: high PR risk score: high and removed risk: medium PR risk score: medium labels Nov 26, 2026
@dcramer
dcramer enabled auto-merge (squash) November 26, 2026 07:26

@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 using default effort and found 2 potential issues.

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 158cd33. Configure here.

#4413 merged into main, so this PR now targets main.
@dcramer

dcramer commented Nov 26, 2026

Copy link
Copy Markdown
Member

Members should exist the same way between conversations and spaces, and the description doesn't need to show up right now, nor does the config panel, so it can literally just be the normal conversation panel

@github-actions

Copy link
Copy Markdown
Contributor

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

Review screenshots in Frameshift

Composer Skill Card · Desktop
Composer Skill Card · Desktop
Changed
Composer Skill Details · Desktop
Composer Skill Details · Desktop
Changed
Composer Skill Reference · Desktop
Composer Skill Reference · Desktop
Changed
Space Add Members · Desktop
Space Add Members · Desktop
Changed
Space Add Members Light · Desktop
Space Add Members Light · Desktop
Changed
Space Edit · Desktop
Space Edit · Desktop
Changed
Show 12 more changed screenshots
Space Edit Light · Desktop
Space Edit Light · Desktop
Changed
Space Lead · Desktop
Space Lead · Desktop
Changed
Space Lead First Run · Desktop
Space Lead First Run · Desktop
Changed
Space Lead Non Member · Desktop
Space Lead Non Member · Desktop
Changed
Space Lead Reports · Desktop
Space Lead Reports · Desktop
Changed
Space Page · Desktop
Space Page · Desktop
Changed
Space Pane Menu · Desktop
Space Pane Menu · Desktop
Changed
Space Pane Menu Light · Desktop
Space Pane Menu Light · Desktop
Changed
Space Threads · Desktop
Space Threads · Desktop
Changed
Space Threads · Mobile
Space Threads · Mobile
Changed
Space Threads Light · Desktop
Space Threads Light · Desktop
Changed
Space Threads Light · Mobile
Space Threads Light · Mobile
Changed

@dcramer
dcramer merged commit bc2a779 into main Nov 26, 2026
57 checks passed
@dcramer
dcramer deleted the feat/lead-conversation-details branch November 26, 2026 07:45

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 9d45be48 Deployed Nov 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant