Skip to content

feat(spaces): Show a Space's Threads in the shared Threads panel - #4433

Merged
dcramer merged 3 commits into
agents/lead-childrenfrom
feat/space-threads-shared-panel
Nov 26, 2026
Merged

dcramer merged 3 commits into
agents/lead-childrenfrom
feat/space-threads-shared-panel

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

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 and the sidebar's Threads read feed rows (attentionOrder), and the Threads panel reads child agent rows. The group order and the newest-first rule live in one place.

The sidebar lists each root's Threads in that order at each level, so a Space's Lead and its Threads panel agree. A collapsed root shows its first three Threads in that order, plus the one that holds the open Thread.

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).

Space

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

Conversation with Threads

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

via @dcramer.

--

View Session [Sentry]

The Space panel now renders the Threads panel that every Conversation
with children shows, fed by the Lead's child agents. That panel groups
Threads by what they need, with Done collapsed, in the In flight order.
The child agents report gains each child's tree state and Watch flag, so
the panel groups by the same state as feed rows.

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 5:35am UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 26, 2026
@sentry-junior sentry-junior Bot mentioned this pull request Nov 26, 2026
2 of 12 tasks

@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.

Stale Bugbot comment from a previous run.

Show archived opens Done, where archived Threads sit. A Thread whose own
run ended while a nested child still works shows the working icon, as its
group does.

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

@dcramer dcramer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get rid of the counts and the category headers. We still want them sorted in the correct order, but we don't need the separation like that

That should obviously be true for threads on all panels like that. And so the new panel shared across any route should treat threads without the subcategories and the counts per subcategory

The sidebar lists each root's Threads in attentionOrder at each level,
so a Space's Lead and any Conversation with Threads show one order. A
collapsed root shows the first Threads in that order.

Co-Authored-By: David Cramer <[email protected]>
@dcramer
dcramer merged commit 027247d into agents/lead-children Nov 26, 2026
7 checks passed
@dcramer
dcramer deleted the feat/space-threads-shared-panel branch November 26, 2026 05:36

@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 1 potential issue.

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 33cbe6e. Configure here.

threads: SidebarThread[];
} {
const direct = root.threads ?? [];
const direct = attentionOrder(root.threads ?? []);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sidebar order misses Thread tree state

Medium Severity

sidebarThreads now sorts with attentionOrder, which groups by treeState, watching, and latestTurnFailed. Nested feed Threads typically have none of those — conversationDisplayState even treats a Thread row as having no tree state — so a Thread that needs the viewer is grouped as Done and can fall past the collapsed cap. The new test only passes because it injects treeState onto those rows.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 33cbe6e. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #4444 (158cd339c): the feed now reads each nested Thread's tree state with the Thread read, so the sidebar's attentionOrder sees needs_you, working, and watching on Threads too.

@sentry-junior

sentry-junior Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Done in #4463. Every Threads panel now shows one list with no group headings or counts. It keeps the same order: needs you, working, waiting, done.

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 33cbe6e1 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