Vectrum
Sign In

Subagents panel: only the open thread's subagents

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JjohannSocommitted 1 parent b967f82commit14066a2

Showing 2 changed files with 9 additions and 26 deletions.

+1−2README.mdView File
@@ -107,8 +107,7 @@ Gruvbox, Rosé Pine, Solarized and Dracula.
107107 - A subagents panel (Ctrl+Alt+S, or the robot in the top bar), in the project panel's
108108 place: every subagent the thread started, the working ones first with what each is
109109 doing right now (its latest tool call and progress summary), how long it has run, its
110- kind, tool uses and tokens, then the finished and failed ones. Subagents working in other
111- threads list underneath. Click one to jump to its call in the conversation. While the
110+ kind, tool uses and tokens, then the finished and failed ones. Click one to jump to its call in the conversation. While the
112111 panel is closed, a light on the robot says subagents are working. It covers Claude's
113112 Task and Agent calls; Pi's [`subagent` extension](https://github.com/earendil-works/pi/tree/main/packages/coding-agent/examples/extensions/subagent)
114113 (a row per task, single, parallel or chained); and jcode's swarm, whose agents keep
+8−24src/ui/workspace/subagents.rsView File
@@ -1,8 +1,8 @@
11 //! The subagents panel: every subagent the open thread's agent started, the
22 //! working ones first with what each is doing right now (its latest tool
33 //! call, its progress summary, how long it's run, its tool uses and
4- //! tokens), then the finished ones. Subagents working in other threads
5- //! list under them. A click shows the subagent's call in its conversation.
4+ //! tokens), then the finished ones. A click shows the subagent's call in
5+ //! its conversation.
66 //!
77 //! Claude's Task and Agent calls are one subagent each. Pi's `subagent`
88 //! extension and jcode's swarm spawns can start several, each its own row.
@@ -129,15 +129,6 @@ impl Workspace {
129129 let (working, mut finished): (Vec<Subagent>, Vec<Subagent>) =
130130 mine.into_iter().partition(|subagent| subagent.status == TaskStatus::Running);
131131 finished.reverse();
132- // Subagents working in the other threads.
133- let elsewhere: Vec<Subagent> = self
134- .projects
135- .iter()
136- .flat_map(|project| &project.sessions)
137- .filter(|session| Some(*session) != self.active.as_ref())
138- .flat_map(|session| subagents_of(session, cx))
139- .filter(|subagent| subagent.status == TaskStatus::Running)
140- .collect();
141132 let empty = working.is_empty() && finished.is_empty();
142133
143134 let header = h_flex()
@@ -165,15 +156,13 @@ impl Workspace {
165156 .child(div().px(px(10.)).pt(px(8.)).pb(px(4.)).child(metal::engraved(title, p)))
166157 .children(rows)
167158 };
168- let rows = |subagents: Vec<Subagent>, other: bool, cx: &mut Context<Self>| -> Vec<AnyElement> {
169- subagents.into_iter().map(|subagent| self.render_subagent(subagent, other, p, cx)).collect()
159+ let rows = |subagents: Vec<Subagent>, cx: &mut Context<Self>| -> Vec<AnyElement> {
160+ subagents.into_iter().map(|subagent| self.render_subagent(subagent, p, cx)).collect()
170161 };
171162 let working_count = working.len();
172163 let finished_count = finished.len();
173- let elsewhere_count = elsewhere.len();
174- let working_rows = rows(working, false, cx);
175- let finished_rows = rows(finished, false, cx);
176- let elsewhere_rows = rows(elsewhere, true, cx);
164+ let working_rows = rows(working, cx);
165+ let finished_rows = rows(finished, cx);
177166
178167 v_flex()
179168 .w(px(PANEL_WIDTH))
@@ -208,15 +197,14 @@ impl Workspace {
208197 )
209198 })
210199 .when(working_count > 0, |this| this.child(section("Working".into(), working_rows)))
211- .when(finished_count > 0, |this| this.child(section(format!("Finished · {finished_count}"), finished_rows)))
212- .when(elsewhere_count > 0, |this| this.child(section("In other threads".into(), elsewhere_rows))),
200+ .when(finished_count > 0, |this| this.child(section(format!("Finished · {finished_count}"), finished_rows))),
213201 ),
214202 )
215203 }
216204
217205 /// One subagent: its light, what it was asked to do and for how long,
218206 /// its kind and totals, and while it works, what it's doing now.
219- fn render_subagent(&self, subagent: Subagent, other: bool, p: &Palette, cx: &mut Context<Self>) -> AnyElement {
207+ fn render_subagent(&self, subagent: Subagent, p: &Palette, cx: &mut Context<Self>) -> AnyElement {
220208 let running = subagent.status == TaskStatus::Running;
221209 let (led, status) = match subagent.status {
222210 TaskStatus::Running => (Led::Live, None),
@@ -225,7 +213,6 @@ impl Workspace {
225213 TaskStatus::Stopped => (Led::Off, Some("Stopped")),
226214 };
227215 let id = subagent.id;
228- let thread = other.then(|| subagent.session.read(cx).title.clone());
229216 // A delegated task's agent can stop to ask the user something.
230217 let waiting = running
231218 && subagent
@@ -293,9 +280,6 @@ impl Workspace {
293280 )
294281 }),
295282 )
296- .when_some(thread, |this, thread| {
297- this.child(div().truncate().text_size(px(11.5)).text_color(p.ink3).child(thread))
298- })
299283 .when_some(subagent.activity, |this, (icon, label)| {
300284 this.child(
301285 h_flex()