@devries-cameron20 / t3code-1 / commits / 6dcaf6cbe7
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): remote subagents no longer split from the lineage list (#29285)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Theo Browne committed Nov 6, 2026 at 02:54 UTC 6dcaf6cbe727e520f5ff9d854d3be30c89b42bda
2 files changed +65 -38
apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx
+5
@@ -310,6 +310,11 @@ it("shows a remote subagent's full title in its tooltip even when its environmen
310 { router: "/environment/fork" },
311 );
312
313 + // A finished remote task sits with the other finished agents, not in its own list.
314 + await expect
315 + .element(screen.getByRole("button", { name: new RegExp(longTitle) }))
316 + .not.toBeInTheDocument();
317 + await screen.getByRole("button", { name: /Previous agents/ }).click();
318 const row = screen.getByRole("button", { name: new RegExp(longTitle) });
319 await userEvent.hover(row);
320 await vi.waitFor(() =>
apps/web/src/components/chat/ThreadRelationshipsControl.tsx
+60 -38
@@ -136,18 +136,32 @@ function ThreadLineageRowList(props: {
136 );
137 }
138
139 -function ThreadLineageGroup(props: {
139 +type RemoteSubagent = OrchestrationV2Subagent & {
140 + readonly remoteChild: OrchestrationV2RemoteTaskChild;
141 +};
142 +
143 +/** A task delegated to a linked environment has no thread here, so it gets its own row kind. */
144 +type LineageRow = ThreadRelationshipWalkRow | { readonly remote: RemoteSubagent };
145 +
146 +const lineageRowStatus = (row: LineageRow) =>
147 + "remote" in row ? row.remote.status : row.edge.status;
148 +
149 +const isFinishedAgentStatus = (status: string | null | undefined) =>
150 + ["completed", "failed", "error", "cancelled", "interrupted", "idle"].includes(status ?? "");
151 +
152 +function ThreadLineageGroup<Row extends LineageRow>(props: {
153 readonly label: string | null;
141 - readonly rows: ReadonlyArray<ThreadRelationshipWalkRow>;
154 + readonly rows: ReadonlyArray<Row>;
155 readonly expanded: boolean;
143 - readonly children: (rows: ReadonlyArray<ThreadRelationshipWalkRow>) => ReactNode;
156 + readonly children: (rows: ReadonlyArray<Row>) => ReactNode;
157 }) {
158 const [expanded, setExpanded] = useState(props.expanded);
159 const [visibleCount, setVisibleCount] = useState(THREAD_LINEAGE_INITIAL_COUNT);
160 const { visibleRows, hiddenCount } = resolveThreadLineageWindow(props.rows, visibleCount);
148 - const failedCount = props.rows.filter(
149 - ({ edge }) => edge.status === "failed" || edge.status === "error",
150 - ).length;
161 + const failedCount = props.rows.filter((row) => {
162 + const status = lineageRowStatus(row);
163 + return status === "failed" || status === "error";
164 + }).length;
165 if (props.rows.length === 0) return null;
166 return (
167 <div>
@@ -247,9 +261,7 @@ function currentSubagent<Agent extends RuntimeSubagent>(
261 * the thread there, when this client is connected to that environment.
262 */
263 function RemoteSubagentRow(props: {
250 - readonly agent: OrchestrationV2Subagent & {
251 - readonly remoteChild: OrchestrationV2RemoteTaskChild;
252 - };
264 + readonly agent: RemoteSubagent;
265 readonly provider: ServerProvider | undefined;
266 }) {
267 const navigate = useNavigate();
@@ -537,22 +549,29 @@ export function ThreadRelationshipsPanel(props: {
549 if (!isParent && graph.nodes.get(threadId)?.thread?.lineage.sideChat === true)
550 return "sideChats";
551 if (edge.kind !== "subagent" || isParent) return "related";
540 - return ["completed", "failed", "error", "cancelled", "interrupted", "idle"].includes(
541 - edge.status ?? "",
542 - )
543 - ? "previous"
544 - : "active";
552 + return isFinishedAgentStatus(edge.status) ? "previous" : "active";
553 });
546 - const groups = [
554 + const { remoteActive = [], remotePrevious = [] } = groupBy(
555 + (projection?.subagents ?? [])
556 + .filter((agent): agent is RemoteSubagent => agent.remoteChild !== undefined)
557 + .map((remote) => ({ remote })),
558 + ({ remote }) => (isFinishedAgentStatus(remote.status) ? "remotePrevious" : "remoteActive"),
559 + );
560 + const groups: ReadonlyArray<{
561 + id: string;
562 + label: string | null;
563 + rows: ReadonlyArray<LineageRow>;
564 + expanded: boolean;
565 + }> = [
566 { id: "related", label: null, rows: related, expanded: true },
548 - { id: "active", label: null, rows: active, expanded: true },
549 - { id: "previous", label: "Previous agents", rows: previous, expanded: false },
567 + { id: "active", label: null, rows: [...active, ...remoteActive], expanded: true },
568 + {
569 + id: "previous",
570 + label: "Previous agents",
571 + rows: [...previous, ...remotePrevious],
572 + expanded: false,
573 + },
574 ];
551 - // Tasks running in a linked environment have no thread here; they get their own rows.
552 - const remoteSubagents = (projection?.subagents ?? []).filter(
553 - (agent): agent is OrchestrationV2Subagent & { remoteChild: OrchestrationV2RemoteTaskChild } =>
554 - agent.remoteChild !== undefined,
555 - );
575 const runningCount =
576 (projection?.subagents.filter(
577 (agent) => agent.childThreadId === null && agent.status === "running",
@@ -567,7 +586,8 @@ export function ThreadRelationshipsPanel(props: {
586 active.length > 0 ||
587 previous.length > 0 ||
588 runningCount > 0 ||
570 - remoteSubagents.length > 0 ||
589 + remoteActive.length > 0 ||
590 + remotePrevious.length > 0 ||
591 delegatedFrom !== undefined ||
592 // Disconnect lives in this heading, so a thread with only side chats still shows it.
593 (canDetach && sideChats.length > 0));
@@ -929,6 +949,7 @@ export function ThreadRelationshipsPanel(props: {
949 canDetach ||
950 related.length > 0 ||
951 active.length > 0 ||
952 + remoteActive.length > 0 ||
953 delegatedFrom !== undefined
954 }
955 data-thread-relationships-panel
@@ -968,23 +989,24 @@ export function ThreadRelationshipsPanel(props: {
989 )}
990 {groups.map((group) => (
991 <ThreadLineageGroup key={`${scopedThreadKey(ref)}:${group.id}`} {...group}>
971 - {(visibleRows) => visibleRows.map(renderRelationshipRow)}
992 + {(visibleRows) =>
993 + visibleRows.map((row) =>
994 + "remote" in row ? (
995 + <RemoteSubagentRow
996 + key={row.remote.id}
997 + agent={row.remote}
998 + // Its provider instance belongs to the environment it runs in.
999 + provider={providersByEnvironment
1000 + .get(row.remote.remoteChild.environmentId)
1001 + ?.find((entry) => entry.instanceId === row.remote.providerInstanceId)}
1002 + />
1003 + ) : (
1004 + renderRelationshipRow(row)
1005 + ),
1006 + )
1007 + }
1008 </ThreadLineageGroup>
1009 ))}
974 - {remoteSubagents.length > 0 ? (
975 - <ThreadLineageRowList hiddenCount={0} onShowMore={() => {}}>
976 - {remoteSubagents.map((agent) => (
977 - <RemoteSubagentRow
978 - key={agent.id}
979 - agent={agent}
980 - // Its provider instance belongs to the environment it runs in.
981 - provider={providersByEnvironment
982 - .get(agent.remoteChild.environmentId)
983 - ?.find((entry) => entry.instanceId === agent.providerInstanceId)}
984 - />
985 - ))}
986 - </ThreadLineageRowList>
987 - ) : null}
1010 </ThreadDetailsSection>
1011 ) : null}
1012 {sideChatsVisible ? (