Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

✨ feat(conversation): surface topic subagents in the right working panel (#20285)

Arvin Xu36e09e57e384
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.json
index 891a99ca410..25def574ac9 100644
--- a/locales/en-US/chat.json
+++ b/locales/en-US/chat.json
@@ -2819,6 +2819,8 @@
"workingPanel.overview.ports.revoked": "Sharing stopped",
"workingPanel.overview.ports.title": "Ports",
"workingPanel.overview.ports.unavailable": "Can't read this device's ports right now",
+ "workingPanel.overview.subagents": "Subagents",
+ "workingPanel.overview.subtopics": "Subtopics",
"workingPanel.overview.sync.ahead_one": "{{count}} commit ahead",
"workingPanel.overview.sync.ahead_other": "{{count}} commits ahead",
"workingPanel.overview.sync.behind_one": "{{count}} commit behind",
diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.json
index 766ab168349..636eda27dc3 100644
--- a/locales/zh-CN/chat.json
+++ b/locales/zh-CN/chat.json
@@ -2819,6 +2819,8 @@
"workingPanel.overview.ports.revoked": "已停止共享",
"workingPanel.overview.ports.title": "端口",
"workingPanel.overview.ports.unavailable": "暂时无法读取这台设备的端口",
+ "workingPanel.overview.subagents": "子代理",
+ "workingPanel.overview.subtopics": "子话题",
"workingPanel.overview.sync.ahead_one": "领先 {{count}} 个提交",
"workingPanel.overview.sync.ahead_other": "领先 {{count}} 个提交",
"workingPanel.overview.sync.behind_one": "落后 {{count}} 个提交",
diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.ts
index 1137c147cfb..9a0e148896b 100644
--- a/packages/locales/src/default/chat.ts
+++ b/packages/locales/src/default/chat.ts
@@ -2939,6 +2939,8 @@ export default {
'workingPanel.overview.ports.revoked': 'Sharing stopped',
'workingPanel.overview.ports.title': 'Ports',
'workingPanel.overview.ports.unavailable': "Can't read this device's ports right now",
+ 'workingPanel.overview.subagents': 'Subagents',
+ 'workingPanel.overview.subtopics': 'Subtopics',
'workingPanel.overview.sync.ahead_one': '{{count}} commit ahead',
'workingPanel.overview.sync.ahead_other': '{{count}} commits ahead',
'workingPanel.overview.sync.behind_one': '{{count}} commit behind',
diff --git a/src/features/AgentSidebar/Topic/List/Item/index.test.tsx b/src/features/AgentSidebar/Topic/List/Item/index.test.tsx
index ec663cc0c5d..7c161e98a15 100644
--- a/src/features/AgentSidebar/Topic/List/Item/index.test.tsx
+++ b/src/features/AgentSidebar/Topic/List/Item/index.test.tsx
@@ -139,9 +139,11 @@ vi.mock('./Actions', () => ({
vi.mock('./useDropdownMenu', () => ({
useTopicItemDropdownMenu: () => ({ dropdownMenu: [] }),
}));
+// The row only decides *whether* to mount the thread list; the list itself has
+// its own tests (`ThreadList/*.test.ts`), so stub it to a marker here.
vi.mock('../../TopicListContent/ThreadList', () => ({
default: ({ topicId }: { topicId: string }) => (
- <div data-testid="topic-thread-list" data-topic-id={topicId} />
+ <div data-testid="thread-list" data-topic-id={topicId} />
),
}));
@@ -168,7 +170,6 @@ describe('TopicItem active state', () => {
render(<TopicItem id="tpc_test" title="Topic" />);
expect(screen.getByTestId('nav-item')).toHaveAttribute('data-active', 'true');
- expect(screen.getByTestId('topic-thread-list')).toHaveAttribute('data-topic-id', 'tpc_test');
});
it('does not highlight a stale topic while visiting non-topic agent sub-routes', () => {
@@ -183,7 +184,6 @@ describe('TopicItem active state', () => {
render(<TopicItem id="tpc_test" title="Topic" />);
expect(screen.getByTestId('nav-item')).toHaveAttribute('data-active', 'false');
- expect(screen.queryByTestId('topic-thread-list')).not.toBeInTheDocument();
});
it('prefixes the cmd-click href with the active workspace slug', () => {
@@ -475,3 +475,50 @@ describe('TopicItem active state', () => {
expect(screen.getByTestId('topic-item-icon')).toHaveAttribute('data-icon', icon);
});
});
+
+// The mobile surface has no working sidebar (the desktop host of a topic's
+// threads), so the rows nest under the topic row there — but only under the
+// route's topic. Mounting them under an inactive topic opened its thread while
+// `activeTopicId` still pointed elsewhere, and fetched threads per topic.
+describe('TopicItem mobile thread list', () => {
+ const navigateTo = (urlTopicId?: string) => {
+ useTopicNavigationMock.mockReturnValue({
+ isInAgentSubRoute: false,
+ isInTopicContextRoute: false,
+ navigateToTopic: vi.fn(),
+ routeTopicId: undefined,
+ urlTopicId,
+ });
+ };
+
+ afterEach(() => {
+ vi.unstubAllGlobals();
+ });
+
+ it('nests the route topic threads on the mobile surface', () => {
+ vi.stubGlobal('__MOBILE__', true);
+ navigateTo('tpc_test');
+
+ render(<TopicItem id="tpc_test" title="Topic" />);
+
+ expect(screen.getByTestId('thread-list')).toHaveAttribute('data-topic-id', 'tpc_test');
+ });
+
+ it('does not nest an inactive topic threads on the mobile surface', () => {
+ vi.stubGlobal('__MOBILE__', true);
+ navigateTo('tpc_other');
+
+ render(<TopicItem id="tpc_test" title="Topic" />);
+
+ expect(screen.queryByTestId('thread-list')).not.toBeInTheDocument();
+ });
+
+ it('does not nest the thread list on the desktop surface', () => {
+ vi.stubGlobal('__MOBILE__', false);
+ navigateTo('tpc_test');
+
+ render(<TopicItem id="tpc_test" title="Topic" />);
+
+ expect(screen.queryByTestId('thread-list')).not.toBeInTheDocument();
+ });
+});
diff --git a/src/features/AgentSidebar/Topic/List/Item/index.tsx b/src/features/AgentSidebar/Topic/List/Item/index.tsx
index 11806d22a7d..5a7d45f2f09 100644
--- a/src/features/AgentSidebar/Topic/List/Item/index.tsx
+++ b/src/features/AgentSidebar/Topic/List/Item/index.tsx
@@ -112,6 +112,23 @@ const styles = createStaticStyles(({ css }) => ({
// fire — each racing to write activeTopicId (see ).
let pendingSingleClickTimer: ReturnType<typeof setTimeout> | null = null;
+/**
+ * The mobile surface renders its topic list in a modal and never mounts the
+ * working sidebar — the desktop host of a topic's thread list. Without nesting
+ * the rows under the topic row, mobile users can't reach an existing subtopic
+ * at all, so the nesting lives here on that surface only.
+ *
+ * Scoped to the route's topic (`showThreadList`): opening a thread under an
+ * inactive topic would call `openThreadInPortal` while `activeTopicId` still
+ * points at another topic, so the thread would resolve against the wrong topic's
+ * context — and every mounted list would fetch its own threads.
+ *
+ * Read per call rather than once at module load so a test can stub `__MOBILE__`.
+ */
+const isMobileSurface = () => typeof __MOBILE__ !== 'undefined' && __MOBILE__;
+// Nesting cue: keeps the rows visually under their topic row.
+const NESTED_THREAD_LIST_INDENT = 32;
+
const cancelPendingSingleClick = () => {
if (pendingSingleClickTimer) {
clearTimeout(pendingSingleClickTimer);
@@ -218,6 +235,7 @@ interface TopicItemRowProps extends TopicItemProps {
defaultTopicActive: boolean;
isTopicActive: boolean;
navRef: RefObject<TopicNavigationActions>;
+ /** Route's topic — only its row may carry its thread list (see the mobile mount). */
showThreadList: boolean;
}
@@ -577,7 +595,7 @@ const TopicItemRow = memo<TopicItemRowProps>(
) : (
navItem
)}
- {showThreadList && (
+ {isMobileSurface() && showThreadList && id && (
<Suspense
fallback={
<Flexbox gap={8} paddingBlock={8} paddingInline={24} width={'100%'}>
@@ -586,7 +604,9 @@ const TopicItemRow = memo<TopicItemRowProps>(
</Flexbox>
}
>
- <ThreadList topicId={id} />
+ <Flexbox style={{ paddingInlineStart: NESTED_THREAD_LIST_INDENT }} width={'100%'}>
+ <ThreadList topicId={id} />
+ </Flexbox>
</Suspense>
)}
</Flexbox>
diff --git a/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/ThreadItem/active.test.ts b/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/ThreadItem/active.test.ts
new file mode 100644
index 00000000000..728df2f3a4d
--- /dev/null
+++ b/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/ThreadItem/active.test.ts
@@ -0,0 +1,26 @@
+import { describe, expect, it } from 'vitest';
+
+import { isThreadRowActive } from './active';
+
+describe('isThreadRowActive', () => {
+ // Regression: OR-ing the portal thread with `activeThreadId` highlighted two
+ // rows at once whenever the conversation and the Portal were on different
+ // threads.
+ it('marks only the portal thread when the conversation and the Portal differ', () => {
+ expect(
+ isThreadRowActive({ activeThreadId: 'thd_a', portalThreadId: 'thd_b', threadId: 'thd_b' }),
+ ).toBe(true);
+ expect(
+ isThreadRowActive({ activeThreadId: 'thd_a', portalThreadId: 'thd_b', threadId: 'thd_a' }),
+ ).toBe(false);
+ });
+
+ it('falls back to the conversation thread when the Portal shows no thread', () => {
+ expect(
+ isThreadRowActive({ activeThreadId: 'thd_a', portalThreadId: undefined, threadId: 'thd_a' }),
+ ).toBe(true);
+ expect(
+ isThreadRowActive({ activeThreadId: 'thd_a', portalThreadId: undefined, threadId: 'thd_b' }),
+ ).toBe(false);
+ });
+});
diff --git a/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/ThreadItem/active.ts b/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/ThreadItem/active.ts
new file mode 100644
index 00000000000..7aa5e21e9d7
--- /dev/null
+++ b/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/ThreadItem/active.ts
@@ -0,0 +1,18 @@
+/**
+ * Whether a thread row reads as "current".
+ *
+ * A row opens its thread in the Portal instead of switching the conversation,
+ * so the Portal's thread is the row's current state; `activeThreadId` is only
+ * the fallback for when the Portal shows no thread. OR-ing the two marked two
+ * rows active at once whenever the conversation and the Portal were on
+ * different threads.
+ */
+export const isThreadRowActive = ({
+ activeThreadId,
+ portalThreadId,
+ threadId,
+}: {
+ activeThreadId?: null | string;
+ portalThreadId?: null | string;
+ threadId: string;
+}): boolean => (portalThreadId ? threadId === portalThreadId : threadId === activeThreadId);
diff --git a/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/ThreadItem/index.tsx b/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/ThreadItem/index.tsx
index 232958362d2..49efca4408a 100644
--- a/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/ThreadItem/index.tsx
+++ b/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/ThreadItem/index.tsx
@@ -1,5 +1,4 @@
-import { Icon } from '@lobehub/ui';
-import { cssVar } from 'antd-style';
+import { GroupBotIcon } from '@lobehub/ui/icons';
import { CornerDownRight } from 'lucide-react';
import type { DragEvent } from 'react';
import { memo, useCallback } from 'react';
@@ -7,9 +6,10 @@ import { memo, useCallback } from 'react';
import { startThreadDrag } from '@/features/ChatInput/InputEditor/ReferTopic/threadDragData';
import NavItem from '@/features/NavPanel/components/NavItem';
import { useChatStore } from '@/store/chat';
+import { portalThreadSelectors } from '@/store/chat/selectors';
-import { useThreadNavigation } from '../../../hooks/useThreadNavigation';
import Actions from './Actions';
+import { isThreadRowActive } from './active';
import { useThreadItemDropdownMenu } from './useDropdownMenu';
export interface ThreadItemProps {
@@ -20,19 +20,16 @@ export interface ThreadItemProps {
title: string;
}
-// Indent applied INSIDE the NavItem's Block (overrides default paddingInline=4
-// on the start side), so the icon + title shift right by one icon-slot width
-// while the row background/highlight stays full-width.
-const SUBAGENT_PADDING_INLINE_START = 32;
-
const ThreadItem = memo<ThreadItemProps>(({ title, id, isSubagent, sourceMessageId }) => {
const activeThreadId = useChatStore((s) => s.activeThreadId);
-
- const { navigateToThread, isInAgentSubRoute } = useThreadNavigation();
+ // This row opens its thread in the Portal, so its "current" state is the
+ // portal's thread — see `isThreadRowActive` for the conversation fallback.
+ const portalThreadId = useChatStore((s) => portalThreadSelectors.portalCurrentThread(s)?.id);
+ const openThreadInPortal = useChatStore((s) => s.openThreadInPortal);
const handleClick = useCallback(() => {
- navigateToThread(id);
- }, [id, navigateToThread]);
+ openThreadInPortal(id, sourceMessageId);
+ }, [id, openThreadInPortal, sourceMessageId]);
const handleDragStart = useCallback(
(event: DragEvent) => {
@@ -47,29 +44,25 @@ const ThreadItem = memo<ThreadItemProps>(({ title, id, isSubagent, sourceMessage
title,
});
- const active = id === activeThreadId;
+ const active = isThreadRowActive({ activeThreadId, portalThreadId, threadId: id });
return (
- <>
- <NavItem
- draggable
- actions={<Actions dropdownMenu={dropdownMenu} />}
- active={active && !isInAgentSubRoute}
- contextMenuItems={dropdownMenu}
- data-thread-id={id}
- icon={<Icon color={cssVar.colorTextDescription} icon={CornerDownRight} size={'small'} />}
- // The capped ThreadList is a flex column, so rows shrink to fit its
- // max-height instead of overflowing — the scroll never engages. Pin the
- // row min-height to the NavItem height (36) to force overflow → scroll.
- title={title}
- style={{
- minHeight: 36,
- ...(isSubagent && { paddingInlineStart: SUBAGENT_PADDING_INLINE_START }),
- }}
- onClick={handleClick}
- onDragStart={handleDragStart}
- />
- </>
+ <NavItem
+ draggable
+ actions={<Actions dropdownMenu={dropdownMenu} />}
+ active={active}
+ contextMenuItems={dropdownMenu}
+ data-thread-id={id}
+ icon={isSubagent ? GroupBotIcon : CornerDownRight}
+ iconSize={16}
+ // The capped ThreadList is a flex column, so rows shrink to fit its
+ // max-height instead of overflowing — the scroll never engages. Pin the
+ // row min-height to the NavItem height (36) to force overflow → scroll.
+ style={{ minHeight: 36 }}
+ title={title}
+ onClick={handleClick}
+ onDragStart={handleDragStart}
+ />
);
});
diff --git a/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/ThreadListSection.tsx b/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/ThreadListSection.tsx
new file mode 100644
index 00000000000..b8fe42fd389
--- /dev/null
+++ b/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/ThreadListSection.tsx
@@ -0,0 +1,37 @@
+import { Flexbox } from '@lobehub/ui';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import { sectionStyles } from '@/features/Conversation/WorkingSidebar/Overview/sectionStyles';
+import { useChatStore } from '@/store/chat';
+import { threadSelectors } from '@/store/chat/selectors';
+
+import { getThreadListHeadingKey } from './heading';
+import ThreadList from './index';
+
+/**
+ * Right working-panel presentation of a topic's thread list: a section heading
+ * over the rows. The heading says "Subagents" only when every row is one.
+ *
+ * The mobile topic list uses `ThreadList` directly instead — it has no room for
+ * a section header and nests the rows under the topic row.
+ */
+const ThreadListSection = memo(({ topicId }: { topicId: string }) => {
+ const { t } = useTranslation('chat');
+ const threads = useChatStore(threadSelectors.getThreadsByTopic(topicId));
+
+ if (!threads || threads.length === 0) return;
+
+ return (
+ <Flexbox className={sectionStyles.section}>
+ <Flexbox className={sectionStyles.sectionHeader}>
+ <span className={sectionStyles.sectionTitle}>{t(getThreadListHeadingKey(threads))}</span>
+ </Flexbox>
+ <ThreadList topicId={topicId} />
+ </Flexbox>
+ );
+});
+
+ThreadListSection.displayName = 'ThreadListSection';
+
+export default ThreadListSection;
diff --git a/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/heading.test.ts b/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/heading.test.ts
new file mode 100644
index 00000000000..4a60ff9f7bc
--- /dev/null
+++ b/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/heading.test.ts
@@ -0,0 +1,31 @@
+import { describe, expect, it } from 'vitest';
+
+import { getThreadListHeadingKey, SUBAGENT_LIST_HEADING, THREAD_LIST_HEADING } from './heading';
+
+describe('getThreadListHeadingKey', () => {
+ it('labels a list of tool-spawned subagent threads as Subagents', () => {
+ expect(
+ getThreadListHeadingKey([
+ { metadata: { sourceToolCallId: 'call_1' } },
+ { metadata: { sourceToolCallId: 'call_2' } },
+ ]),
+ ).toBe(SUBAGENT_LIST_HEADING);
+ });
+
+ // Regression: keying on `ThreadType.Isolation` labelled a direct `@Agent`
+ // thread — an ordinary target-agent conversation, and so without a
+ // `sourceToolCallId` — as a subagent.
+ it('uses the inclusive heading when the threads are not tool-spawned subagents', () => {
+ expect(getThreadListHeadingKey([{ metadata: { sourceToolCallId: 'call_1' } }, {}])).toBe(
+ THREAD_LIST_HEADING,
+ );
+ expect(getThreadListHeadingKey([{}, { metadata: undefined }])).toBe(THREAD_LIST_HEADING);
+ expect(getThreadListHeadingKey([{ metadata: { sourceToolCallId: undefined } }])).toBe(
+ THREAD_LIST_HEADING,
+ );
+ });
+
+ it('falls back to the inclusive heading for an empty list', () => {
+ expect(getThreadListHeadingKey([])).toBe(THREAD_LIST_HEADING);
+ });
+});
diff --git a/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/heading.ts b/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/heading.ts
new file mode 100644
index 00000000000..d2f2768a20a
--- /dev/null
+++ b/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/heading.ts
@@ -0,0 +1,27 @@
+import { type ThreadMetadata } from '@lobechat/types';
+
+import { isSubagentThread } from './subagent';
+
+export type ThreadListHeadingKey =
+ 'workingPanel.overview.subagents' | 'workingPanel.overview.subtopics';
+
+/** Heading when every listed thread is a subagent. */
+export const SUBAGENT_LIST_HEADING: ThreadListHeadingKey = 'workingPanel.overview.subagents';
+/** Inclusive heading for a list that also holds non-subagent threads. */
+export const THREAD_LIST_HEADING: ThreadListHeadingKey = 'workingPanel.overview.subtopics';
+
+/**
+ * Heading key for the right-panel thread list.
+ *
+ * A topic's list mixes tool-spawned subagents with ordinary threads (a direct
+ * `@Agent` isolation thread, a user fork), so the list may only be called
+ * "Subagents" when every row is one — otherwise those threads would be
+ * mislabelled. Subagent-ness comes from `metadata.sourceToolCallId`, the same
+ * marker the thread portal uses.
+ */
+export const getThreadListHeadingKey = (
+ threads: readonly { metadata?: null | ThreadMetadata }[],
+): ThreadListHeadingKey =>
+ threads.length > 0 && threads.every(isSubagentThread)
+ ? SUBAGENT_LIST_HEADING
+ : THREAD_LIST_HEADING;
diff --git a/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/index.tsx b/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/index.tsx
index 5063443c18f..b3f1f7d296c 100644
--- a/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/index.tsx
+++ b/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/index.tsx
@@ -1,26 +1,33 @@
-import { ThreadType } from '@lobechat/types';
import { ScrollShadow } from '@lobehub/ui';
import { memo } from 'react';
import { useFetchThreads } from '@/hooks/useFetchThreads';
import { useScrollActiveThreadIntoView } from '@/hooks/useScrollActiveThreadIntoView';
import { useChatStore } from '@/store/chat';
-import { threadSelectors } from '@/store/chat/selectors';
+import { portalThreadSelectors, threadSelectors } from '@/store/chat/selectors';
+import { isSubagentThread } from './subagent';
import ThreadItem from './ThreadItem';
-// Cap the nested thread list so a topic with many threads doesn't push the rest
-// of the topic list off-screen; the overflow scrolls within the list itself.
+// Cap the thread list so a topic with many threads doesn't push the rest of the
+// list off-screen; the overflow scrolls within the list itself.
// ~9 rows (NavItem 36px + 1px gap).
const MAX_HEIGHT = 9 * 37;
+/**
+ * Rows-only thread list, shared by its two hosts: the right working panel wraps
+ * it in `ThreadListSection` (section heading + rows), while the mobile topic
+ * list nests the rows under the topic row.
+ */
const ThreadList = memo(({ topicId }: { topicId: string }) => {
const threads = useChatStore(threadSelectors.getThreadsByTopic(topicId));
- const activeThreadId = useChatStore((s) => s.activeThreadId);
+ // Rows open their thread in the Portal rather than switching the
+ // conversation, so the row to keep in view is the Portal's current thread.
+ const portalThreadId = useChatStore((s) => portalThreadSelectors.portalThreadId(s));
useFetchThreads(topicId);
- const containerRef = useScrollActiveThreadIntoView(activeThreadId, threads?.length);
+ const containerRef = useScrollActiveThreadIntoView(portalThreadId, threads?.length);
if (!threads || threads.length === 0) return;
@@ -32,11 +39,11 @@ const ThreadList = memo(({ topicId }: { topicId: string }) => {
size={12}
style={{ maxHeight: MAX_HEIGHT }}
>
- {threads?.map((item, index) => (
+ {threads.map((item, index) => (
<ThreadItem
id={item.id}
index={index}
- isSubagent={item.type === ThreadType.Isolation}
+ isSubagent={isSubagentThread(item)}
key={item.id}
sourceMessageId={item.sourceMessageId ?? undefined}
title={item.title}
diff --git a/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/subagent.ts b/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/subagent.ts
new file mode 100644
index 00000000000..101baed0559
--- /dev/null
+++ b/src/features/AgentSidebar/Topic/TopicListContent/ThreadList/subagent.ts
@@ -0,0 +1,12 @@
+import type { ThreadMetadata } from '@lobechat/types';
+
+/**
+ * Whether a thread was spawned by a tool call — the product's own subagent
+ * marker (see `threadSelectors.isActiveThreadSubagent` and `Portal/Thread/Chat`).
+ *
+ * A direct `@Agent` mention creates an isolation thread *without* it, and that
+ * thread is an ordinary target-agent conversation the user can keep chatting
+ * in, so keying on `ThreadType.Isolation` alone would label it a subagent.
+ */
+export const isSubagentThread = (thread: { metadata?: null | ThreadMetadata }): boolean =>
+ Boolean(thread.metadata?.sourceToolCallId);
diff --git a/src/features/Conversation/WorkingSidebar/Overview/index.tsx b/src/features/Conversation/WorkingSidebar/Overview/index.tsx
index 1fb1de2edc7..b99f02515fb 100644
--- a/src/features/Conversation/WorkingSidebar/Overview/index.tsx
+++ b/src/features/Conversation/WorkingSidebar/Overview/index.tsx
@@ -27,6 +27,7 @@ import {
getPullRequestState,
PR_STATE_VISUAL,
} from '@/features/AgentSidebar/Topic/List/Item/metaCardData';
+import ThreadListSection from '@/features/AgentSidebar/Topic/TopicListContent/ThreadList/ThreadListSection';
import { TopicBackgroundActivity } from '@/features/BackgroundActivity/TopicSection';
import BranchSwitcher from '@/features/ChatInput/ControlBar/BranchSwitcher';
import WorktreeSwitcher from '@/features/ChatInput/ControlBar/WorktreeSwitcher';
@@ -390,14 +391,7 @@ const Overview = memo<OverviewProps>(
) : (
gitRows
)
- ) : (
- <OverviewRow
- icon={FilesIcon}
- trailing={<ChevronRight />}
- value={t('workingPanel.overview.files')}
- onClick={() => onOpenTab('files')}
- />
- );
+ ) : null;
return (
<Flexbox className={styles.body}>
@@ -473,7 +467,21 @@ const Overview = memo<OverviewProps>(
/>
)}
+ {/* Thread rows open in the Portal; the list labels itself as subagents and
+ sits in its own section so the resource rows below aren't grouped under it. */}
+ {topicId && <ThreadListSection topicId={topicId} />}
+
<Flexbox className={sectionStyles.section}>
+ {hasWorkspace && (
+ <OverviewRow
+ weak
+ icon={FilesIcon}
+ iconSize={15}
+ trailing={<ChevronRight />}
+ value={t('workingPanel.overview.files')}
+ onClick={() => onOpenTab('files')}
+ />
+ )}
<OverviewRow
weak
icon={SkillsIcon}