🤯 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.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
♻️ refactor(lobe-agent): remove callSubAgents in favor of parallel callSubAgent calls (#15608)
Arvin Xuaa46864df6df
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.jsonindex 22f57ad2037..c7439942892 100644--- a/locales/en-US/chat.json+++ b/locales/en-US/chat.json@@ -893,7 +893,6 @@"workflow.toolDisplayName.calculate": "Calculated","workflow.toolDisplayName.callAgent": "Called an agent","workflow.toolDisplayName.callSubAgent": "Call SubAgent",- "workflow.toolDisplayName.callSubAgents": "Call SubAgents","workflow.toolDisplayName.clearTodos": "Cleared todos","workflow.toolDisplayName.copyDocument": "Copied a document","workflow.toolDisplayName.crawlMultiPages": "Crawled pages",diff --git a/locales/en-US/plugin.json b/locales/en-US/plugin.jsonindex a47ad71b0e6..22d9a46c43d 100644--- a/locales/en-US/plugin.json+++ b/locales/en-US/plugin.json@@ -73,8 +73,6 @@"builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} media","builtins.lobe-agent.apiName.analyzeVisualMedia.result": "Analyze visual media: <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "Call SubAgent",- "builtins.lobe-agent.apiName.callSubAgents": "Call SubAgents",- "builtins.lobe-agent.apiName.callSubAgents.more": "{{count}} in total","builtins.lobe-agent.apiName.clearTodos": "Clear todos","builtins.lobe-agent.apiName.clearTodos.modeAll": "all","builtins.lobe-agent.apiName.clearTodos.modeCompleted": "completed",diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.jsonindex 6869ea7fd0f..e189b2ad99c 100644--- a/locales/zh-CN/chat.json+++ b/locales/zh-CN/chat.json@@ -893,7 +893,6 @@"workflow.toolDisplayName.calculate": "完成了计算","workflow.toolDisplayName.callAgent": "调用了助理","workflow.toolDisplayName.callSubAgent": "Call SubAgent",- "workflow.toolDisplayName.callSubAgents": "Call SubAgents","workflow.toolDisplayName.clearTodos": "清空了待办","workflow.toolDisplayName.copyDocument": "复制了文档","workflow.toolDisplayName.crawlMultiPages": "抓取了多个页面",diff --git a/locales/zh-CN/plugin.json b/locales/zh-CN/plugin.jsonindex 8c539e5c152..68cd8c149b5 100644--- a/locales/zh-CN/plugin.json+++ b/locales/zh-CN/plugin.json@@ -73,8 +73,6 @@"builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} 个媒体","builtins.lobe-agent.apiName.analyzeVisualMedia.result": "分析视觉媒体:<question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "Call SubAgent",- "builtins.lobe-agent.apiName.callSubAgents": "Call SubAgents",- "builtins.lobe-agent.apiName.callSubAgents.more": "等 {{count}} 个","builtins.lobe-agent.apiName.clearTodos": "清除待办","builtins.lobe-agent.apiName.clearTodos.modeAll": "全部","builtins.lobe-agent.apiName.clearTodos.modeCompleted": "已完成",diff --git a/packages/agent-runtime/src/agents/GeneralChatAgent.ts b/packages/agent-runtime/src/agents/GeneralChatAgent.tsindex 343306c8153..0e8764ad924 100644--- a/packages/agent-runtime/src/agents/GeneralChatAgent.ts+++ b/packages/agent-runtime/src/agents/GeneralChatAgent.ts@@ -570,9 +570,9 @@ export class GeneralChatAgent implements Agent {const { data, parentMessageId, stop } =context.payload as GeneralAgentCallToolResultPayload;- // Check if this is a sub-agent dispatch request (lobe-agent.callSubAgent /- // callSubAgents and similarly-shaped tools emit state.type=execSubAgent*- // with stop=true so the runtime forks a sub-agent here).+ // Check if this is a sub-agent dispatch request (lobe-agent.callSubAgent+ // and similarly-shaped tools emit state.type=execSubAgent* with stop=true+ // so the runtime forks a sub-agent here).if (stop && data?.state) {const stateType = data.state.type;diff --git a/packages/builtin-tool-lobe-agent/src/client/Inspector/CallSubAgents/index.tsx b/packages/builtin-tool-lobe-agent/src/client/Inspector/CallSubAgents/index.tsxdeleted file mode 100644index bf7f3805f24..00000000000--- a/packages/builtin-tool-lobe-agent/src/client/Inspector/CallSubAgents/index.tsx+++ /dev/null@@ -1,93 +0,0 @@-'use client';--import type { BuiltinInspectorProps } from '@lobechat/types';-import { GroupBotIcon } from '@lobehub/ui/icons';-import { createStaticStyles, cx } from 'antd-style';-import { memo } from 'react';-import { useTranslation } from 'react-i18next';--import { inspectorTextStyles, shinyTextStyles } from '@/styles';--import type { CallSubAgentsParams, CallSubAgentsState } from '../../../types';--const styles = createStaticStyles(({ css, cssVar }) => ({- chip: css`- overflow: hidden;- display: inline-flex;- flex-shrink: 1;- align-items: center;-- min-width: 0;- padding-block: 2px;- padding-inline: 10px;- border-radius: 999px;-- font-size: 12px;- color: ${cssVar.colorText};- text-overflow: ellipsis;- white-space: nowrap;-- background: ${cssVar.colorFillTertiary};- `,- icon: css`- flex-shrink: 0;- color: ${cssVar.colorTextDescription};- `,- label: css`- flex-shrink: 0;- color: ${cssVar.colorText};- `,- more: css`- flex-shrink: 0;- color: ${cssVar.colorTextTertiary};- `,- root: css`- gap: 6px;- `,-}));--/** Show every description when there are at most this many; otherwise collapse. */-const MAX_VISIBLE = 2;--/**- * Collapsed row for lobe-agent's `callSubAgents`. Leading bot icon + "Call- * SubAgents" label, then each sub-agent description as a chip when there are- * few (<= 2). Beyond that, only the first is shown followed by a "{{count}} in- * total" tail to keep the row compact.- */-export const CallSubAgentsInspector = memo<- BuiltinInspectorProps<CallSubAgentsParams, CallSubAgentsState>->(({ args, partialArgs, isArgumentsStreaming }) => {- const { t } = useTranslation('plugin');-- const tasks = args?.tasks || partialArgs?.tasks || [];- const descriptions = tasks.map((task) => task?.description?.trim()).filter(Boolean) as string[];- const count = descriptions.length;-- const isShiny = isArgumentsStreaming;- const visible = count > MAX_VISIBLE ? descriptions.slice(0, 1) : descriptions;- const showMore = count > MAX_VISIBLE;-- return (- <div- className={cx(inspectorTextStyles.root, styles.root, isShiny && shinyTextStyles.shinyText)}- >- <GroupBotIcon className={styles.icon} size={14} />- <span className={styles.label}>{t('builtins.lobe-agent.apiName.callSubAgents')}</span>- {visible.map((description, index) => (- <span className={styles.chip} key={index}>- {description}- </span>- ))}- {showMore && (- <span className={styles.more}>- {t('builtins.lobe-agent.apiName.callSubAgents.more', { count })}- </span>- )}- </div>- );-});--CallSubAgentsInspector.displayName = 'CallSubAgentsInspector';--export default CallSubAgentsInspector;diff --git a/packages/builtin-tool-lobe-agent/src/client/Inspector/index.ts b/packages/builtin-tool-lobe-agent/src/client/Inspector/index.tsindex c99cc04c7b1..12cd62e7b60 100644--- a/packages/builtin-tool-lobe-agent/src/client/Inspector/index.ts+++ b/packages/builtin-tool-lobe-agent/src/client/Inspector/index.ts@@ -3,7 +3,6 @@ import type { BuiltinInspector } from '@lobechat/types';import { LobeAgentApiName } from '../../types';import { AnalyzeVisualMediaInspector } from './AnalyzeVisualMedia';import { CallSubAgentInspector } from './CallSubAgent';-import { CallSubAgentsInspector } from './CallSubAgents';import { ClearTodosInspector } from './ClearTodos';import { CreatePlanInspector } from './CreatePlan';import { CreateTodosInspector } from './CreateTodos';@@ -19,7 +18,6 @@ import { UpdateTodosInspector } from './UpdateTodos';export const LobeAgentInspectors: Record<string, BuiltinInspector> = {[LobeAgentApiName.analyzeVisualMedia]: AnalyzeVisualMediaInspector as BuiltinInspector,[LobeAgentApiName.callSubAgent]: CallSubAgentInspector as BuiltinInspector,- [LobeAgentApiName.callSubAgents]: CallSubAgentsInspector as BuiltinInspector,[LobeAgentApiName.clearTodos]: ClearTodosInspector as BuiltinInspector,[LobeAgentApiName.createPlan]: CreatePlanInspector as BuiltinInspector,[LobeAgentApiName.createTodos]: CreateTodosInspector as BuiltinInspector,diff --git a/packages/builtin-tool-lobe-agent/src/client/Render/CallSubAgents/index.tsx b/packages/builtin-tool-lobe-agent/src/client/Render/CallSubAgents/index.tsxdeleted file mode 100644index 669bae6b3bd..00000000000--- a/packages/builtin-tool-lobe-agent/src/client/Render/CallSubAgents/index.tsx+++ /dev/null@@ -1,135 +0,0 @@-'use client';--import type { BuiltinRenderProps } from '@lobechat/types';-import { Block, Button, Flexbox } from '@lobehub/ui';-import { createStaticStyles } from 'antd-style';-import { ListTree } from 'lucide-react';-import { memo, useCallback } from 'react';-import { useTranslation } from 'react-i18next';--import { useChatStore } from '@/store/chat';-import { portalThreadSelectors, threadSelectors } from '@/store/chat/selectors';--import type { CallSubAgentsParams, CallSubAgentsState, SubAgentRunStats } from '../../../types';-import { SubAgentStats } from '../../components/SubAgentStats';--const styles = createStaticStyles(({ css, cssVar }) => ({- index: css`- flex-shrink: 0;- font-size: 12px;- color: ${cssVar.colorTextQuaternary};- `,- openThread: css`- height: 22px;- padding-inline: 6px;- font-size: 12px;- `,- row: css`- display: flex;- gap: 8px;- align-items: center;- justify-content: space-between;-- padding-block: 10px;- padding-inline: 12px;- border-block-end: 1px dashed ${cssVar.colorBorderSecondary};-- &:last-child {- border-block-end: none;- }- `,- title: css`- overflow: hidden;-- font-size: 13px;- color: ${cssVar.colorText};- text-overflow: ellipsis;- white-space: nowrap;- `,-}));--interface SubAgentRowProps extends SubAgentRunStats {- description: string;- index: number;- threadId: string;-}--const SubAgentRow = memo<SubAgentRowProps>(- ({ description, index, threadId, model, totalToolCalls, totalTokens }) => {- const { t: tChat } = useTranslation('chat');-- const subagentThread = useChatStore((s) =>- threadId- ? (threadSelectors.currentTopicThreads(s) ?? []).find((thread) => thread.id === threadId)- : undefined,- );- const openThreadInPortal = useChatStore((s) => s.openThreadInPortal);- const closeThreadPortal = useChatStore((s) => s.closeThreadPortal);- const portalThreadId = useChatStore(portalThreadSelectors.portalThreadId);- const isOpenInPortal = !!subagentThread && portalThreadId === subagentThread.id;-- const handleToggleThread = useCallback(() => {- if (!subagentThread) return;- if (isOpenInPortal) {- closeThreadPortal();- } else {- openThreadInPortal(subagentThread.id, subagentThread.sourceMessageId);- }- }, [subagentThread, isOpenInPortal, openThreadInPortal, closeThreadPortal]);-- return (- <div className={styles.row}>- <Flexbox horizontal align={'center'} gap={8} style={{ minWidth: 0 }}>- <span className={styles.index}>{index + 1}.</span>- <span className={styles.title}>{description}</span>- </Flexbox>- <Flexbox horizontal align={'center'} gap={12} style={{ flexShrink: 0 }}>- <SubAgentStats model={model} totalTokens={totalTokens} totalToolCalls={totalToolCalls} />- {subagentThread && (- <Button- className={styles.openThread}- icon={ListTree}- size={'small'}- type={'text'}- onClick={handleToggleThread}- >- {isOpenInPortal- ? tChat('thread.closeSubagentThread')- : tChat('thread.openSubagentThread')}- </Button>- )}- </Flexbox>- </div>- );- },-);--SubAgentRow.displayName = 'CallSubAgentsRow';--export const CallSubAgentsRender = memo<- BuiltinRenderProps<CallSubAgentsParams, CallSubAgentsState>->(({ pluginState }) => {- const subAgents = pluginState?.subAgents;-- if (!subAgents || subAgents.length === 0) return null;-- return (- <Block variant={'outlined'} width="100%">- {subAgents.map((subAgent, index) => (- <SubAgentRow- description={subAgent.description}- index={index}- key={subAgent.threadId || index}- model={subAgent.model}- threadId={subAgent.threadId}- totalTokens={subAgent.totalTokens}- totalToolCalls={subAgent.totalToolCalls}- />- ))}- </Block>- );-});--CallSubAgentsRender.displayName = 'CallSubAgentsRender';--export default CallSubAgentsRender;diff --git a/packages/builtin-tool-lobe-agent/src/client/Render/index.ts b/packages/builtin-tool-lobe-agent/src/client/Render/index.tsindex 8728e41f15a..f1bf50b7db9 100644--- a/packages/builtin-tool-lobe-agent/src/client/Render/index.ts+++ b/packages/builtin-tool-lobe-agent/src/client/Render/index.ts@@ -1,6 +1,5 @@import { LobeAgentApiName } from '../../types';import CallSubAgentRender from './CallSubAgent';-import CallSubAgentsRender from './CallSubAgents';import CreatePlan from './CreatePlan';import TodoListRender from './TodoList';@@ -13,7 +12,6 @@ import TodoListRender from './TodoList';*/export const LobeAgentRenders = {[LobeAgentApiName.callSubAgent]: CallSubAgentRender,- [LobeAgentApiName.callSubAgents]: CallSubAgentsRender,// Plan operations render the PlanCard UI[LobeAgentApiName.createPlan]: CreatePlan,@@ -26,7 +24,6 @@ export const LobeAgentRenders = {};export { default as CallSubAgentRender } from './CallSubAgent';-export { default as CallSubAgentsRender } from './CallSubAgents';export { default as CreatePlan, PlanCard } from './CreatePlan';export type { TodoListRenderState } from './TodoList';export { default as TodoListRender, TodoListUI } from './TodoList';diff --git a/packages/builtin-tool-lobe-agent/src/client/Streaming/CallSubAgents/index.tsx b/packages/builtin-tool-lobe-agent/src/client/Streaming/CallSubAgents/index.tsxdeleted file mode 100644index e9b0e077f4a..00000000000--- a/packages/builtin-tool-lobe-agent/src/client/Streaming/CallSubAgents/index.tsx+++ /dev/null@@ -1,79 +0,0 @@-'use client';--import type { BuiltinStreamingProps } from '@lobechat/types';-import { Block, Markdown } from '@lobehub/ui';-import { createStaticStyles } from 'antd-style';-import { memo } from 'react';--import type { CallSubAgentsParams } from '../../../types';--const styles = createStaticStyles(({ css, cssVar }) => ({- index: css`- flex-shrink: 0;- font-size: 12px;- color: ${cssVar.colorTextQuaternary};- `,- instruction: css`- font-size: 12px;- line-height: 1.5;- color: ${cssVar.colorTextTertiary};- `,- taskContent: css`- display: flex;- flex: 1;- flex-direction: column;- gap: 2px;-- min-width: 0;- `,- taskItem: css`- display: flex;- gap: 8px;- align-items: flex-start;-- padding-block: 10px;- padding-inline: 12px;- border-block-end: 1px dashed ${cssVar.colorBorderSecondary};-- &:last-child {- border-block-end: none;- }- `,- title: css`- font-size: 13px;- line-height: 1.4;- color: ${cssVar.colorText};- `,-}));--export const CallSubAgentsStreaming = memo<BuiltinStreamingProps<CallSubAgentsParams>>(- ({ args }) => {- const { tasks } = args || {};-- if (!tasks || tasks.length === 0) return null;-- return (- <Block variant={'outlined'} width="100%">- {tasks.map((task, index) => (- <div className={styles.taskItem} key={index}>- <div className={styles.index}>{index + 1}.</div>- <div className={styles.taskContent}>- {task.description && <div className={styles.title}>{task.description}</div>}- {task.instruction && (- <div className={styles.instruction}>- <Markdown animated variant={'chat'}>- {task.instruction}- </Markdown>- </div>- )}- </div>- </div>- ))}- </Block>- );- },-);--CallSubAgentsStreaming.displayName = 'CallSubAgentsStreaming';--export default CallSubAgentsStreaming;diff --git a/packages/builtin-tool-lobe-agent/src/client/Streaming/index.ts b/packages/builtin-tool-lobe-agent/src/client/Streaming/index.tsindex 8d97eb40217..558903ee63a 100644--- a/packages/builtin-tool-lobe-agent/src/client/Streaming/index.ts+++ b/packages/builtin-tool-lobe-agent/src/client/Streaming/index.ts@@ -2,7 +2,6 @@ import type { BuiltinStreaming } from '@lobechat/types';import { LobeAgentApiName } from '../../types';import { CallSubAgentStreaming } from './CallSubAgent';-import { CallSubAgentsStreaming } from './CallSubAgents';import { CreatePlanStreaming } from './CreatePlan';/**@@ -13,10 +12,8 @@ import { CreatePlanStreaming } from './CreatePlan';*/export const LobeAgentStreamings: Record<string, BuiltinStreaming> = {[LobeAgentApiName.callSubAgent]: CallSubAgentStreaming as BuiltinStreaming,- [LobeAgentApiName.callSubAgents]: CallSubAgentsStreaming as BuiltinStreaming,[LobeAgentApiName.createPlan]: CreatePlanStreaming as BuiltinStreaming,};export { CallSubAgentStreaming } from './CallSubAgent';-export { CallSubAgentsStreaming } from './CallSubAgents';export { CreatePlanStreaming } from './CreatePlan';diff --git a/packages/builtin-tool-lobe-agent/src/client/executor/index.ts b/packages/builtin-tool-lobe-agent/src/client/executor/index.tsindex 72450bc81d1..77a8cf2656a 100644--- a/packages/builtin-tool-lobe-agent/src/client/executor/index.ts+++ b/packages/builtin-tool-lobe-agent/src/client/executor/index.ts@@ -8,7 +8,6 @@ import { LobeAgentManifest } from '../../manifest';import type {AnalyzeVisualMediaParams,CallSubAgentParams,- CallSubAgentsParams,ClearTodosParams,CreatePlanParams,CreateTodosParams,@@ -397,52 +396,6 @@ class LobeAgentExecutor extends BaseExecutor<typeof LobeAgentApiName> {success: true,};};-- callSubAgents = async (- params: CallSubAgentsParams,- ctx: BuiltinToolContext,- ): Promise<BuiltinToolResult> => {- const { tasks } = params;-- if (!tasks || tasks.length === 0) {- return { content: 'No sub-agents provided to dispatch.', success: false };- }-- if (!ctx.subAgent) {- return { content: 'Sub-agent execution is not available in this runtime.', success: false };- }-- const subAgent = ctx.subAgent;- const results = await Promise.all(- tasks.map((task) =>- subAgent.run({- description: task.description,- inheritMessages: task.inheritMessages,- instruction: task.instruction,- timeout: task.timeout,- toolMessageId: ctx.messageId,- }),- ),- );-- const content = results- .map((r, i) => `${i + 1}. ${tasks[i].description}\n${r.success ? r.result : `❌ ${r.error}`}`)- .join('\n\n');-- return {- content,- state: {- subAgents: results.map((r, i) => ({- description: tasks[i].description,- model: r.model,- threadId: r.threadId,- totalToolCalls: r.totalToolCalls,- totalTokens: r.totalTokens,- })),- },- success: true,- };- };}export const lobeAgentExecutor = new LobeAgentExecutor();diff --git a/packages/builtin-tool-lobe-agent/src/client/index.ts b/packages/builtin-tool-lobe-agent/src/client/index.tsindex 494be0b72a1..d10457bb1d0 100644--- a/packages/builtin-tool-lobe-agent/src/client/index.ts+++ b/packages/builtin-tool-lobe-agent/src/client/index.ts@@ -8,7 +8,6 @@ export { LobeAgentInspectors } from './Inspector';export type { TodoListRenderState } from './Render';export {CallSubAgentRender,- CallSubAgentsRender,CreatePlan,LobeAgentRenders,PlanCard,@@ -17,12 +16,7 @@ export {} from './Render';// Streaming components (real-time tool execution feedback)-export {- CallSubAgentsStreaming,- CallSubAgentStreaming,- CreatePlanStreaming,- LobeAgentStreamings,-} from './Streaming';+export { CallSubAgentStreaming, CreatePlanStreaming, LobeAgentStreamings } from './Streaming';// Intervention components (interactive editing)export {diff --git a/packages/builtin-tool-lobe-agent/src/manifest.ts b/packages/builtin-tool-lobe-agent/src/manifest.tsindex cc5c1103b16..b9b44b51a0c 100644--- a/packages/builtin-tool-lobe-agent/src/manifest.ts+++ b/packages/builtin-tool-lobe-agent/src/manifest.ts@@ -219,51 +219,6 @@ export const LobeAgentManifest: BuiltinToolManifest = {type: 'object',},},- {- description:- 'Dispatch one or more sub-agents in parallel. Each sub-agent runs in an isolated context. Use this when several independent investigations / multi-step tasks should proceed concurrently.',- name: LobeAgentApiName.callSubAgents,- parameters: {- properties: {- tasks: {- description: 'Array of sub-agents to dispatch.',- items: {- properties: {- description: {- description: 'Brief description of what this sub-agent does (shown in UI).',- type: 'string',- },- instruction: {- description: 'Detailed instruction/prompt for the sub-agent execution.',- type: 'string',- },- inheritMessages: {- description:- 'Whether to inherit context messages from the parent conversation. Default is false.',- type: 'boolean',- },- ...(isDesktop && {- runInClient: {- description:- 'Whether to run on the desktop client (for local file/shell access). MUST be true when the sub-agent requires local-system tools. Default is false (server execution).',- type: 'boolean',- },- }),- timeout: {- description: 'Optional timeout in milliseconds. Default is 30 minutes.',- type: 'number',- },- },- required: ['description', 'instruction'],- type: 'object',- },- type: 'array',- },- },- required: ['tasks'],- type: 'object',- },- },],identifier: LobeAgentIdentifier,meta: {diff --git a/packages/builtin-tool-lobe-agent/src/systemRole.ts b/packages/builtin-tool-lobe-agent/src/systemRole.tsindex a39b99ac2f1..520a0d57654 100644--- a/packages/builtin-tool-lobe-agent/src/systemRole.ts+++ b/packages/builtin-tool-lobe-agent/src/systemRole.ts@@ -34,9 +34,9 @@ const subAgentSection = `<sub_agents>You can dispatch **sub-agents** to handle long-running, multi-step work in isolated contexts.-**Sub-Agent Tools:**+**Sub-Agent Tool:**- \`callSubAgent\`: Dispatch a single sub-agent. **Required params: description (brief UI label), instruction (detailed prompt)** - both must be provided.-- \`callSubAgents\`: Dispatch multiple sub-agents in parallel. Each task requires **description** and **instruction**.+- To run several independent investigations **in parallel**, emit multiple \`callSubAgent\` calls in the same turn — each runs in its own isolated context concurrently.**Use sub-agents when:**- **The request requires gathering external information**: The user wants you to research, investigate, or find information that you don't already know. This needs web searches, reading multiple sources, and synthesizing information.@@ -49,14 +49,14 @@ Ask yourself: "Can I answer this well from my existing knowledge, or does this r- If you need to search the web, read articles, or investigate → Dispatch a sub-agent- If you can answer directly from knowledge → Just respond-Use \`callSubAgent\` for a single sub-agent, \`callSubAgents\` for multiple parallel sub-agents.+Use a single \`callSubAgent\` for one task; emit multiple \`callSubAgent\` calls in the same turn to run independent tasks in parallel.**Example scenarios:**- User asks about best restaurants in a city → \`callSubAgent\` (needs current info from reviews, searches)- User wants research on a topic → \`callSubAgent\` (multi-step: search, read, analyze, summarize)- User asks to compare products/services → \`callSubAgent\` (needs data from multiple sources)- User asks a factual question you know → Just answer directly-- User wants multiple independent analyses → \`callSubAgents\` (parallel execution)+- User wants multiple independent analyses → multiple \`callSubAgent\` calls in one turn (parallel execution)</sub_agents>${isDesktop ? runInClientSection : ''}`;diff --git a/packages/builtin-tool-lobe-agent/src/types.ts b/packages/builtin-tool-lobe-agent/src/types.tsindex 0a14e07b9e7..49046c611cb 100644--- a/packages/builtin-tool-lobe-agent/src/types.ts+++ b/packages/builtin-tool-lobe-agent/src/types.ts@@ -3,7 +3,6 @@ export const LobeAgentIdentifier = 'lobe-agent';export const LobeAgentApiName = {analyzeVisualMedia: 'analyzeVisualMedia',callSubAgent: 'callSubAgent',- callSubAgents: 'callSubAgents',clearTodos: 'clearTodos',createPlan: 'createPlan',createTodos: 'createTodos',@@ -34,33 +33,7 @@ export interface AnalyzeVisualMediaState {usage?: unknown;}-// ==================== Sub-Agent Tasks ====================--/**- * Single sub-agent task definition.- *- * A sub-agent is a long-running, isolated execution that runs in its own- * context (server or desktop client) and reports back to the parent- * conversation when it finishes.- */-export interface SubAgentTask {- /** Brief description of what this sub-agent does (shown in UI) */- description: string;- /** Whether to inherit context messages from parent conversation */- inheritMessages?: boolean;- /** Detailed instruction/prompt for the sub-agent execution */- instruction: string;- /**- * Whether to execute the sub-agent on the client side (desktop only).- * When true and running on desktop, the sub-agent runs locally with- * access to local tools (file system, shell commands, etc.).- *- * MUST be true when the sub-agent requires local-system tools.- */- runInClient?: boolean;- /** Timeout in milliseconds (optional, default 30 minutes) */- timeout?: number;-}+// ==================== Sub-Agent ====================/*** Parameters for callSubAgent API@@ -74,14 +47,6 @@ export interface CallSubAgentParams {timeout?: number;}-/**- * Parameters for callSubAgents API- * Dispatch one or more sub-agents in parallel.- */-export interface CallSubAgentsParams {- tasks: SubAgentTask[];-}-/** Execution stats reported back by a finished sub-agent run. */export interface SubAgentRunStats {/** Model the sub-agent ran on */@@ -103,11 +68,6 @@ export interface CallSubAgentState extends SubAgentRunStats {threadId: string;}-/** State persisted on the callSubAgents tool message (one entry per sub-agent). */-export interface CallSubAgentsState {- subAgents: ({ description: string; threadId: string } & SubAgentRunStats)[];-}-// ==================== Todo Item ====================/** Status of a todo item */diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.tsindex d48ebc016fe..adbb3240038 100644--- a/packages/locales/src/default/chat.ts+++ b/packages/locales/src/default/chat.ts@@ -994,7 +994,6 @@ export default {'workflow.toolDisplayName.calculate': 'Calculated','workflow.toolDisplayName.callAgent': 'Called an agent','workflow.toolDisplayName.callSubAgent': 'Call SubAgent',- 'workflow.toolDisplayName.callSubAgents': 'Call SubAgents','workflow.toolDisplayName.clearTodos': 'Cleared todos','workflow.toolDisplayName.copyDocument': 'Copied a document','workflow.toolDisplayName.crawlMultiPages': 'Crawled pages',diff --git a/packages/locales/src/default/plugin.ts b/packages/locales/src/default/plugin.tsindex fc27dcf864f..ea0da0be1e2 100644--- a/packages/locales/src/default/plugin.ts+++ b/packages/locales/src/default/plugin.ts@@ -56,8 +56,6 @@ export default {'builtins.lobe-agent.apiName.analyzeVisualMedia.result':'Analyze visual media: <question>{{question}}</question>','builtins.lobe-agent.apiName.callSubAgent': 'Call SubAgent',- 'builtins.lobe-agent.apiName.callSubAgents': 'Call SubAgents',- 'builtins.lobe-agent.apiName.callSubAgents.more': '{{count}} in total','builtins.lobe-agent.subAgent.stats.tokens': '{{count}} tokens','builtins.lobe-agent.subAgent.stats.tools': '{{count}} tools','builtins.lobe-agent.title': 'Lobe Agent',diff --git a/src/features/Conversation/Messages/AssistantGroup/constants.ts b/src/features/Conversation/Messages/AssistantGroup/constants.tsindex 23a6105185e..265b42aac0a 100644--- a/src/features/Conversation/Messages/AssistantGroup/constants.ts+++ b/src/features/Conversation/Messages/AssistantGroup/constants.ts@@ -172,7 +172,6 @@ export const TOOL_API_DISPLAY_NAMES: Record<string, string> = {// Lobe Agent — Sub-AgentscallSubAgent: 'workflow.toolDisplayName.callSubAgent',- callSubAgents: 'workflow.toolDisplayName.callSubAgents',// MemoryaddActivityMemory: 'workflow.toolDisplayName.addActivityMemory',diff --git a/src/features/DevPanel/RenderGallery/fixtures/lobe-agent.ts b/src/features/DevPanel/RenderGallery/fixtures/lobe-agent.tsindex 9d43010b951..55b48c5dc1f 100644--- a/src/features/DevPanel/RenderGallery/fixtures/lobe-agent.ts+++ b/src/features/DevPanel/RenderGallery/fixtures/lobe-agent.ts@@ -32,20 +32,6 @@ export default defineFixtures({},},}),- callSubAgents: single({- pluginState: {- tasks: [- {- description: 'Audit builtin render coverage',- instruction: 'Find any registered render without a usable sample fixture.',- },- {- description: 'Check route gating',- instruction: 'Make sure production builds do not expose /devtools.',- },- ],- },- }),clearTodos: single({pluginState: {todos: {