🤯 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
✨ feat(goal): rename goal tool to builtin-goal and keep it available for revisions (#21775)
Arvin Xu6f7a9c6874e1
diff --git a/apps/server/src/services/aiAgent/__tests__/execAgent.pinnedSkillContent.test.ts b/apps/server/src/services/aiAgent/__tests__/execAgent.pinnedSkillContent.test.tsindex 245557e0289..8fda05979b2 100644--- a/apps/server/src/services/aiAgent/__tests__/execAgent.pinnedSkillContent.test.ts+++ b/apps/server/src/services/aiAgent/__tests__/execAgent.pinnedSkillContent.test.ts@@ -387,11 +387,11 @@ describe('AiAgentService.execAgent - pinned skill content injection', () => {await service.execAgent({ agentId: 'agent-1', prompt: '/goal ship it' } as any);- expect(operationSkillSetArg()?.enabledPluginIds).toContain('lobe-goal');+ expect(operationSkillSetArg()?.enabledPluginIds).toContain('builtin-goal');expect(operationSkillSetArg()?.enabledPluginIds).not.toContain('lobe-task');expect(toolsEngineConfigArg()?.agentConfig).toEqual({chatConfig: { toolMode: 'custom' },- plugins: ['lobe-goal'],+ plugins: ['builtin-goal'],});});@@ -411,10 +411,10 @@ describe('AiAgentService.execAgent - pinned skill content injection', () => {selectedToolIds: ['selected-tool'],} as any);- expect(operationSkillSetArg()?.enabledPluginIds).toEqual(['lobe-goal']);+ expect(operationSkillSetArg()?.enabledPluginIds).toEqual(['builtin-goal']);expect(toolsEngineConfigArg()?.agentConfig).toEqual({chatConfig: { toolMode: 'custom' },- plugins: ['lobe-goal'],+ plugins: ['builtin-goal'],});});diff --git a/apps/server/src/services/aiAgent/pipeline/toolDiscovery/index.ts b/apps/server/src/services/aiAgent/pipeline/toolDiscovery/index.tsindex e9ce20e4e71..ff6dc214283 100644--- a/apps/server/src/services/aiAgent/pipeline/toolDiscovery/index.ts+++ b/apps/server/src/services/aiAgent/pipeline/toolDiscovery/index.ts@@ -1,5 +1,5 @@import { CredsIdentifier } from '@lobechat/builtin-tool-creds';-import { GoalIdentifier, isGoalPrompt } from '@lobechat/builtin-tool-goal';+import { GoalIdentifier, isGoalIdentifier, isGoalPrompt } from '@lobechat/builtin-tool-goal';import type { DeviceAttachment } from '@lobechat/builtin-tool-remote-device';import { generateSystemPrompt, RemoteDeviceManifest } from '@lobechat/builtin-tool-remote-device';import {@@ -163,7 +163,11 @@ export const discoverTools = async (? [GoalIdentifier]: [...new Set([- ...getActivePluginIds(agentConfig?.plugins),+ // An agent that pinned the goal tool before its rename still+ // carries the legacy id; resolve it to the current one.+ ...getActivePluginIds(agentConfig?.plugins).map((id) =>+ isGoalIdentifier(id) ? GoalIdentifier : id,+ ),...(additionalPluginIds || []),...(selectedToolIds || []),...(hasMentionedAgents ? ['lobe-agent-management'] : []),diff --git a/apps/server/src/services/aiAgent/pipeline/toolDiscovery/turnContext.test.ts b/apps/server/src/services/aiAgent/pipeline/toolDiscovery/turnContext.test.tsnew file mode 100644index 00000000000..ea4cc88a695--- /dev/null+++ b/apps/server/src/services/aiAgent/pipeline/toolDiscovery/turnContext.test.ts@@ -0,0 +1,41 @@+import { GoalIdentifier } from '@lobechat/builtin-tool-goal';+import { describe, expect, it, vi } from 'vitest';++import { resolveTurnScopedPluginIds } from './turnContext';++vi.mock('../../helpers/mediaAvailability', async (importOriginal) => ({+ ...(await importOriginal<Record<string, unknown>>()),+ isMultimodalUnderstandingConfigured: () => false,+}));++const resolve = (history: any[]) =>+ resolveTurnScopedPluginIds({+ attachedFileTypes: [],+ isBotConversation: false,+ loadHistoryMessages: async () => history,+ modelMediaCapabilities: { audio: true, video: true, vision: true },+ });++const goalCall = (pluginState?: Record<string, unknown>, identifier = 'lobe-goal') => ({+ plugin: { apiName: 'createGoal', identifier },+ pluginState,+ role: 'tool',+});++describe('resolveTurnScopedPluginIds goal follow-up', () => {+ it('keeps the goal tool after the user rejected a goal proposal', async () => {+ expect(await resolve([{ role: 'user' }, goalCall(), { role: 'user' }])).toContain(+ GoalIdentifier,+ );+ });++ it('drops the goal tool once the latest proposal created a goal', async () => {+ expect(+ await resolve([goalCall(), goalCall({ goalId: 'goal_1' }, GoalIdentifier)]),+ ).not.toContain(GoalIdentifier);+ });++ it('does not add the goal tool to a conversation without goal proposals', async () => {+ expect(await resolve([{ role: 'user' }, { role: 'assistant' }])).toEqual([]);+ });+});diff --git a/apps/server/src/services/aiAgent/pipeline/toolDiscovery/turnContext.ts b/apps/server/src/services/aiAgent/pipeline/toolDiscovery/turnContext.tsindex f8e22b4189b..fa6bf18d2f0 100644--- a/apps/server/src/services/aiAgent/pipeline/toolDiscovery/turnContext.ts+++ b/apps/server/src/services/aiAgent/pipeline/toolDiscovery/turnContext.ts@@ -1,3 +1,4 @@+import { GoalIdentifier, hasUnfinishedGoalProposal } from '@lobechat/builtin-tool-goal';import { LobeAgentManifest } from '@lobechat/builtin-tool-lobe-agent';import { MessageToolIdentifier } from '@lobechat/builtin-tool-message';import { TaskIdentifier } from '@lobechat/builtin-tool-task';@@ -25,7 +26,10 @@ const log = debug('lobe-server:ai-agent-service');* Turn-scoped builtin tools to append to the candidate plugin ids: the IM* message tool for bot conversations, the task tool for a project coordinator* (it delegates by creating and assigning tasks), and multimodal understanding- * when this turn or its history carries media the model cannot read itself.+ * when this turn or its history carries media the model cannot read itself,+ * and the goal tool while the conversation's latest goal proposal has not+ * created a goal (rejected with feedback, pending, or failed), so the resumed+ * turn or a plain "try again" can revise and resubmit it without `/goal`.*/export const resolveTurnScopedPluginIds = async (params: {attachedFileTypes: string[];@@ -65,8 +69,11 @@ export const resolveTurnScopedPluginIds = async (params: {multimodalUnderstandingConfigured &&(needsAudioUnderstanding || needsImageUnderstanding || needsVideoUnderstanding);+ const continuesGoalProposal = hasUnfinishedGoalProposal(await loadHistoryMessages());+return [...(isBotConversation ? [MessageToolIdentifier] : []),+ ...(continuesGoalProposal ? [GoalIdentifier] : []),...(isProjectCoordinator ? [TaskIdentifier] : []),...(shouldEnableMultimodalUnderstanding ? [LobeAgentManifest.identifier] : []),];diff --git a/apps/server/src/services/aiAgent/shareGate/README.md b/apps/server/src/services/aiAgent/shareGate/README.mdindex 149461570d2..acd24543bac 100644--- a/apps/server/src/services/aiAgent/shareGate/README.md+++ b/apps/server/src/services/aiAgent/shareGate/README.md@@ -32,7 +32,7 @@ Confirmed leak paths (a concrete visitor→creator-data route was found):system-only tools whose every API WRITES agent-document rows under thecreator's account. No write grant exists to honor.-- `lobe-task` / `lobe-goal`: `TaskModel`/`taskRouter` are scoped only by+- `lobe-task` / `builtin-goal`: `TaskModel`/`taskRouter` are scoped only by`userId`/`workspaceId` — the CREATOR's. Every mutating and single-task-readAPI takes a model-supplied identifier resolved with no topic/conversationcheck, letting a visitor read, edit, delete, reschedule or RUN (spendingdiff --git a/apps/server/src/services/toolExecution/serverRuntimes/index.ts b/apps/server/src/services/toolExecution/serverRuntimes/index.tsindex db4152d4908..10c53e6970d 100644--- a/apps/server/src/services/toolExecution/serverRuntimes/index.ts+++ b/apps/server/src/services/toolExecution/serverRuntimes/index.ts@@ -7,6 +7,8 @@* - Per-request runtimes (e.g., CloudSandbox - needs topicId, userId)*/+import { LegacyGoalIdentifier } from '@lobechat/builtin-tool-goal';+import type { ToolExecutionContext } from '../types';import { acceptanceEvidenceRuntime } from './acceptanceEvidence';import { activatorRuntime } from './activator';@@ -114,6 +116,9 @@ registerRuntimes([verifyResultRuntime,]);+// Goal calls approved after the rename still name the tool `lobe-goal`.+serverRuntimeFactories.set(LegacyGoalIdentifier, goalRuntime.factory);+// ==================== Registry API ====================/**diff --git a/locales/ar/plugin.json b/locales/ar/plugin.jsonindex 5671492555f..84f9196f6bb 100644--- a/locales/ar/plugin.json+++ b/locales/ar/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "إجمالي {{count}} من المعاملات","arguments.title": "المعلمات",+ "builtins.builtin-goal.apiName.createGoal": "ابدأ الهدف","builtins.claude-code.apiName.Agent": "تشغيل الوكيل الفرعي","builtins.claude-code.apiName.Bash": "تشغيل الأمر","builtins.claude-code.apiName.Edit": "تحرير الملف",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "فحص المهمة المتوقفة","builtins.lobe-goal-supervisor.apiName.readArtifact": "قراءة مستند الهدف","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "اختيار إجراء الاسترداد",- "builtins.lobe-goal.apiName.createGoal": "ابدأ الهدف","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "إنشاء وكلاء دفعة واحدة","builtins.lobe-group-agent-builder.apiName.createAgent": "إنشاء وكيل","builtins.lobe-group-agent-builder.apiName.createGroup": "إنشاء مجموعة",diff --git a/locales/bg-BG/plugin.json b/locales/bg-BG/plugin.jsonindex 59f6309b150..92f68cba53b 100644--- a/locales/bg-BG/plugin.json+++ b/locales/bg-BG/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "{{count}} параметъра общо","arguments.title": "Аргументи",+ "builtins.builtin-goal.apiName.createGoal": "Започни цел","builtins.claude-code.apiName.Agent": "Стартиране на подагент","builtins.claude-code.apiName.Bash": "Изпълни команда","builtins.claude-code.apiName.Edit": "Редактиране на файл",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "Преглед на прекъсната задача","builtins.lobe-goal-supervisor.apiName.readArtifact": "Прочетете артефакт на целта","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "Изберете действие за възстановяване",- "builtins.lobe-goal.apiName.createGoal": "Започни цел","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "Създай агенти на групи","builtins.lobe-group-agent-builder.apiName.createAgent": "Създай агент","builtins.lobe-group-agent-builder.apiName.createGroup": "Създайте група",diff --git a/locales/de-DE/plugin.json b/locales/de-DE/plugin.jsonindex 8b8fdd89546..ad62b74d302 100644--- a/locales/de-DE/plugin.json+++ b/locales/de-DE/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "{{count}} Parameter insgesamt","arguments.title": "Argumente",+ "builtins.builtin-goal.apiName.createGoal": "Ziel starten","builtins.claude-code.apiName.Agent": "Subagent ausführen","builtins.claude-code.apiName.Bash": "Befehl ausführen","builtins.claude-code.apiName.Edit": "Datei bearbeiten",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "Unterbrochene Aufgabe inspizieren","builtins.lobe-goal-supervisor.apiName.readArtifact": "Zielartefakt lesen","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "Wiederherstellungsaktion wählen",- "builtins.lobe-goal.apiName.createGoal": "Ziel starten","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "Agenten stapelweise erstellen","builtins.lobe-group-agent-builder.apiName.createAgent": "Agent erstellen","builtins.lobe-group-agent-builder.apiName.createGroup": "Gruppe erstellen",diff --git a/locales/en-US/plugin.json b/locales/en-US/plugin.jsonindex 9926489849b..fdda99719e7 100644--- a/locales/en-US/plugin.json+++ b/locales/en-US/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "{{count}} params in total","arguments.title": "Arguments",+ "builtins.builtin-goal.apiName.createGoal": "Start goal","builtins.claude-code.apiName.Agent": "Run subagent","builtins.claude-code.apiName.Bash": "Run command","builtins.claude-code.apiName.Edit": "Edit file",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "Inspect interrupted task","builtins.lobe-goal-supervisor.apiName.readArtifact": "Read goal artifact","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "Choose recovery action",- "builtins.lobe-goal.apiName.createGoal": "Start goal","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "Batch create agents","builtins.lobe-group-agent-builder.apiName.createAgent": "Create agent","builtins.lobe-group-agent-builder.apiName.createGroup": "Create group",diff --git a/locales/es-ES/plugin.json b/locales/es-ES/plugin.jsonindex 50148c3b329..b23c62257c2 100644--- a/locales/es-ES/plugin.json+++ b/locales/es-ES/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "{{count}} parámetros en total","arguments.title": "Argumentos",+ "builtins.builtin-goal.apiName.createGoal": "Iniciar objetivo","builtins.claude-code.apiName.Agent": "Ejecutar subagente","builtins.claude-code.apiName.Bash": "Ejecutar comando","builtins.claude-code.apiName.Edit": "Editar archivo",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "Inspeccionar tarea interrumpida","builtins.lobe-goal-supervisor.apiName.readArtifact": "Leer artefacto del objetivo","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "Elegir acción de recuperación",- "builtins.lobe-goal.apiName.createGoal": "Iniciar objetivo","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "Crear agentes en lote","builtins.lobe-group-agent-builder.apiName.createAgent": "Crear agente","builtins.lobe-group-agent-builder.apiName.createGroup": "Crear grupo",diff --git a/locales/fa-IR/plugin.json b/locales/fa-IR/plugin.jsonindex 04330b17e31..e94c6b2309d 100644--- a/locales/fa-IR/plugin.json+++ b/locales/fa-IR/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "{{count}} پارامتر در مجموع","arguments.title": "آرگومانها",+ "builtins.builtin-goal.apiName.createGoal": "شروع هدف","builtins.claude-code.apiName.Agent": "اجرای زیرعامل","builtins.claude-code.apiName.Bash": "اجرای فرمان","builtins.claude-code.apiName.Edit": "ویرایش فایل",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "بررسی وظیفه متوقفشده","builtins.lobe-goal-supervisor.apiName.readArtifact": "خواندن اثر هدف","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "انتخاب اقدام بازیابی",- "builtins.lobe-goal.apiName.createGoal": "شروع هدف","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "ایجاد گروهی عاملها","builtins.lobe-group-agent-builder.apiName.createAgent": "ایجاد عامل","builtins.lobe-group-agent-builder.apiName.createGroup": "ایجاد گروه",diff --git a/locales/fr-FR/plugin.json b/locales/fr-FR/plugin.jsonindex 96c99c1c45e..c22c09998e2 100644--- a/locales/fr-FR/plugin.json+++ b/locales/fr-FR/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "{{count}} paramètres au total","arguments.title": "Arguments",+ "builtins.builtin-goal.apiName.createGoal": "Démarrer l'objectif","builtins.claude-code.apiName.Agent": "Exécuter un sous-agent","builtins.claude-code.apiName.Bash": "Exécuter une commande","builtins.claude-code.apiName.Edit": "Modifier un fichier",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "Inspecter la tâche interrompue","builtins.lobe-goal-supervisor.apiName.readArtifact": "Lire l'artéfact de l'objectif","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "Choisir une action de récupération",- "builtins.lobe-goal.apiName.createGoal": "Démarrer l'objectif","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "Créer des agents en lot","builtins.lobe-group-agent-builder.apiName.createAgent": "Créer un agent","builtins.lobe-group-agent-builder.apiName.createGroup": "Créer un groupe",diff --git a/locales/it-IT/plugin.json b/locales/it-IT/plugin.jsonindex e4a8594ec48..753e6a0a82d 100644--- a/locales/it-IT/plugin.json+++ b/locales/it-IT/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "{{count}} parametri in totale","arguments.title": "Argomenti",+ "builtins.builtin-goal.apiName.createGoal": "Avvia obiettivo","builtins.claude-code.apiName.Agent": "Esegui subagente","builtins.claude-code.apiName.Bash": "Esegui comando","builtins.claude-code.apiName.Edit": "Modifica file",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "Ispeziona attività interrotta","builtins.lobe-goal-supervisor.apiName.readArtifact": "Leggi artefatto dell'obiettivo","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "Scegli azione di recupero",- "builtins.lobe-goal.apiName.createGoal": "Avvia obiettivo","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "Crea agenti in blocco","builtins.lobe-group-agent-builder.apiName.createAgent": "Crea agente","builtins.lobe-group-agent-builder.apiName.createGroup": "Crea gruppo",diff --git a/locales/ja-JP/plugin.json b/locales/ja-JP/plugin.jsonindex 6ebc4bcb1a4..be6368d21f0 100644--- a/locales/ja-JP/plugin.json+++ b/locales/ja-JP/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "合計で{{count}}個のパラメーターがあります","arguments.title": "パラメーター一覧",+ "builtins.builtin-goal.apiName.createGoal": "目標を開始","builtins.claude-code.apiName.Agent": "サブエージェントを実行","builtins.claude-code.apiName.Bash": "コマンドを実行","builtins.claude-code.apiName.Edit": "ファイルを編集",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "中断されたタスクを確認する","builtins.lobe-goal-supervisor.apiName.readArtifact": "目標アーティファクトを読む","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "回復アクションを選択する",- "builtins.lobe-goal.apiName.createGoal": "目標を開始","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "エージェントを一括作成","builtins.lobe-group-agent-builder.apiName.createAgent": "エージェントを作成","builtins.lobe-group-agent-builder.apiName.createGroup": "グループを作成",diff --git a/locales/ko-KR/plugin.json b/locales/ko-KR/plugin.jsonindex b9257808866..c892c41184c 100644--- a/locales/ko-KR/plugin.json+++ b/locales/ko-KR/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "총 {{count}}개의 매개변수가 있습니다","arguments.title": "매개변수 목록",+ "builtins.builtin-goal.apiName.createGoal": "목표 시작","builtins.claude-code.apiName.Agent": "하위 에이전트 실행","builtins.claude-code.apiName.Bash": "명령 실행","builtins.claude-code.apiName.Edit": "파일 편집",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "중단된 작업 검사","builtins.lobe-goal-supervisor.apiName.readArtifact": "목표 아티팩트 읽기","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "복구 작업 선택",- "builtins.lobe-goal.apiName.createGoal": "목표 시작","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "에이전트 일괄 생성","builtins.lobe-group-agent-builder.apiName.createAgent": "에이전트 생성","builtins.lobe-group-agent-builder.apiName.createGroup": "그룹 생성",diff --git a/locales/nl-NL/plugin.json b/locales/nl-NL/plugin.jsonindex b8cd30c535c..e6bfaa79a36 100644--- a/locales/nl-NL/plugin.json+++ b/locales/nl-NL/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "{{count}} parameters in totaal","arguments.title": "Argumenten",+ "builtins.builtin-goal.apiName.createGoal": "Doel starten","builtins.claude-code.apiName.Agent": "Subagent uitvoeren","builtins.claude-code.apiName.Bash": "Commando uitvoeren","builtins.claude-code.apiName.Edit": "Bestand bewerken",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "Onderbroken taak inspecteren","builtins.lobe-goal-supervisor.apiName.readArtifact": "Doelartefact lezen","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "Herstelactie kiezen",- "builtins.lobe-goal.apiName.createGoal": "Doel starten","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "Meerdere agenten aanmaken","builtins.lobe-group-agent-builder.apiName.createAgent": "Agent aanmaken","builtins.lobe-group-agent-builder.apiName.createGroup": "Groep aanmaken",diff --git a/locales/pl-PL/plugin.json b/locales/pl-PL/plugin.jsonindex fcf64aeeb8b..0ac537dc720 100644--- a/locales/pl-PL/plugin.json+++ b/locales/pl-PL/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "Łącznie {{count}} parametrów","arguments.title": "Argumenty",+ "builtins.builtin-goal.apiName.createGoal": "Rozpocznij cel","builtins.claude-code.apiName.Agent": "Uruchom subagent","builtins.claude-code.apiName.Bash": "Uruchom polecenie","builtins.claude-code.apiName.Edit": "Edytuj plik",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "Sprawdź przerwany zadanie","builtins.lobe-goal-supervisor.apiName.readArtifact": "Przeczytaj artefakt celu","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "Wybierz akcję odzyskiwania",- "builtins.lobe-goal.apiName.createGoal": "Rozpocznij cel","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "Utwórz wielu agentów","builtins.lobe-group-agent-builder.apiName.createAgent": "Utwórz agenta","builtins.lobe-group-agent-builder.apiName.createGroup": "Utwórz grupę",diff --git a/locales/pt-BR/plugin.json b/locales/pt-BR/plugin.jsonindex cf90ca45f8d..bb123621462 100644--- a/locales/pt-BR/plugin.json+++ b/locales/pt-BR/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "{{count}} parâmetros no total","arguments.title": "Argumentos",+ "builtins.builtin-goal.apiName.createGoal": "Iniciar meta","builtins.claude-code.apiName.Agent": "Executar subagente","builtins.claude-code.apiName.Bash": "Executar comando","builtins.claude-code.apiName.Edit": "Editar arquivo",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "Inspecionar tarefa interrompida","builtins.lobe-goal-supervisor.apiName.readArtifact": "Ler artefato do objetivo","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "Escolher ação de recuperação",- "builtins.lobe-goal.apiName.createGoal": "Iniciar meta","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "Criar agentes em lote","builtins.lobe-group-agent-builder.apiName.createAgent": "Criar agente","builtins.lobe-group-agent-builder.apiName.createGroup": "Criar grupo",diff --git a/locales/ru-RU/plugin.json b/locales/ru-RU/plugin.jsonindex 2f555622f4e..4b7c69860e0 100644--- a/locales/ru-RU/plugin.json+++ b/locales/ru-RU/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "Всего параметров: {{count}}","arguments.title": "Аргументы",+ "builtins.builtin-goal.apiName.createGoal": "Начать цель","builtins.claude-code.apiName.Agent": "Запустить субагента","builtins.claude-code.apiName.Bash": "Выполнить команду","builtins.claude-code.apiName.Edit": "Редактировать файл",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "Проверить прерванную задачу","builtins.lobe-goal-supervisor.apiName.readArtifact": "Прочитать артефакт цели","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "Выбрать действие для восстановления",- "builtins.lobe-goal.apiName.createGoal": "Начать цель","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "Массовое создание агентов","builtins.lobe-group-agent-builder.apiName.createAgent": "Создать агента","builtins.lobe-group-agent-builder.apiName.createGroup": "Создать группу",diff --git a/locales/tr-TR/plugin.json b/locales/tr-TR/plugin.jsonindex 26aec5c01db..5fe56648745 100644--- a/locales/tr-TR/plugin.json+++ b/locales/tr-TR/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "Toplam {{count}} parametre","arguments.title": "Argümanlar",+ "builtins.builtin-goal.apiName.createGoal": "Hedef başlat","builtins.claude-code.apiName.Agent": "Alt ajan çalıştır","builtins.claude-code.apiName.Bash": "Komut çalıştır","builtins.claude-code.apiName.Edit": "Dosyayı düzenle",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "Kesintiye uğramış görevi incele","builtins.lobe-goal-supervisor.apiName.readArtifact": "Hedef eserini oku","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "Kurtarma eylemini seç",- "builtins.lobe-goal.apiName.createGoal": "Hedef başlat","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "Toplu ajan oluştur","builtins.lobe-group-agent-builder.apiName.createAgent": "Ajan oluştur","builtins.lobe-group-agent-builder.apiName.createGroup": "Grup oluştur",diff --git a/locales/vi-VN/plugin.json b/locales/vi-VN/plugin.jsonindex b61b56275ee..49f99f3c0f9 100644--- a/locales/vi-VN/plugin.json+++ b/locales/vi-VN/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "Tổng cộng có {{count}} tham số","arguments.title": "Tham số",+ "builtins.builtin-goal.apiName.createGoal": "Bắt đầu mục tiêu","builtins.claude-code.apiName.Agent": "Chạy tác nhân phụ","builtins.claude-code.apiName.Bash": "Chạy lệnh","builtins.claude-code.apiName.Edit": "Chỉnh sửa tệp",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "Kiểm tra nhiệm vụ bị gián đoạn","builtins.lobe-goal-supervisor.apiName.readArtifact": "Đọc hiện vật mục tiêu","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "Chọn hành động khôi phục",- "builtins.lobe-goal.apiName.createGoal": "Bắt đầu mục tiêu","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "Tạo hàng loạt tác nhân","builtins.lobe-group-agent-builder.apiName.createAgent": "Tạo tác nhân","builtins.lobe-group-agent-builder.apiName.createGroup": "Tạo nhóm",diff --git a/locales/zh-CN/plugin.json b/locales/zh-CN/plugin.jsonindex 70947641d49..9f1984d7a6c 100644--- a/locales/zh-CN/plugin.json+++ b/locales/zh-CN/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "等 {{count}} 个参数","arguments.title": "参数列表",+ "builtins.builtin-goal.apiName.createGoal": "启动目标","builtins.claude-code.apiName.Agent": "运行子代理","builtins.claude-code.apiName.Bash": "执行命令","builtins.claude-code.apiName.Edit": "编辑文件",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "检查中断任务","builtins.lobe-goal-supervisor.apiName.readArtifact": "读取目标产物","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "选择恢复动作",- "builtins.lobe-goal.apiName.createGoal": "启动目标","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "批量创建 Agent","builtins.lobe-group-agent-builder.apiName.createAgent": "创建助理","builtins.lobe-group-agent-builder.apiName.createGroup": "创建群组",diff --git a/locales/zh-TW/plugin.json b/locales/zh-TW/plugin.jsonindex a2e184aaf33..9a9db186e7b 100644--- a/locales/zh-TW/plugin.json+++ b/locales/zh-TW/plugin.json@@ -1,6 +1,7 @@{"arguments.moreParams": "總共有 {{count}} 個參數","arguments.title": "參數清單",+ "builtins.builtin-goal.apiName.createGoal": "開始目標","builtins.claude-code.apiName.Agent": "執行子代理","builtins.claude-code.apiName.Bash": "執行指令","builtins.claude-code.apiName.Edit": "編輯檔案",@@ -351,7 +352,6 @@"builtins.lobe-goal-supervisor.apiName.inspectTask": "檢查中斷的任務","builtins.lobe-goal-supervisor.apiName.readArtifact": "閱讀目標工件","builtins.lobe-goal-supervisor.apiName.resolveInterruption": "選擇恢復操作",- "builtins.lobe-goal.apiName.createGoal": "開始目標","builtins.lobe-group-agent-builder.apiName.batchCreateAgents": "批次建立代理","builtins.lobe-group-agent-builder.apiName.createAgent": "建立代理","builtins.lobe-group-agent-builder.apiName.createGroup": "建立群組",diff --git a/packages/builtin-tool-goal/src/client/index.ts b/packages/builtin-tool-goal/src/client/index.tsindex b979d75a2f4..bb263a349ca 100644--- a/packages/builtin-tool-goal/src/client/index.ts+++ b/packages/builtin-tool-goal/src/client/index.ts@@ -5,7 +5,7 @@ import {} from '@lobechat/builtin-tool-task/client';import type { BuiltinInspector, BuiltinIntervention, BuiltinRender } from '@lobechat/types';-import { GoalIdentifier, GoalManifest } from '../manifest';+import { GoalIdentifier, GoalManifest, LegacyGoalIdentifier } from '../manifest';import { GoalApiName } from '../types';export const GoalInspectors: Record<string, BuiltinInspector> = {@@ -20,7 +20,7 @@ export const GoalRenders: Record<string, BuiltinRender> = {[GoalApiName.createGoal]: CreateGoalRender as BuiltinRender,};-export { GoalIdentifier, GoalManifest };+export { GoalIdentifier, GoalManifest, LegacyGoalIdentifier };export { GoalSupervisorManifest } from '../supervisor';export * from '../types';export { GoalSupervisorInspectors } from './supervisorInspector';diff --git a/packages/builtin-tool-goal/src/goalFollowUp.test.ts b/packages/builtin-tool-goal/src/goalFollowUp.test.tsnew file mode 100644index 00000000000..f5947fa8d9e--- /dev/null+++ b/packages/builtin-tool-goal/src/goalFollowUp.test.ts@@ -0,0 +1,36 @@+import { describe, expect, it } from 'vitest';++import { hasUnfinishedGoalProposal } from './goalFollowUp';++const goalCall = (pluginState?: Record<string, unknown>, identifier = 'builtin-goal') => ({+ plugin: { apiName: 'createGoal', identifier },+ pluginState,+ role: 'tool',+});++describe('hasUnfinishedGoalProposal', () => {+ it('is false without any createGoal call', () => {+ expect(hasUnfinishedGoalProposal([{ role: 'user' }, { role: 'assistant' }])).toBe(false);+ });++ it('is true when the latest proposal was rejected or blocked', () => {+ expect(hasUnfinishedGoalProposal([{ role: 'user' }, goalCall()])).toBe(true);+ expect(+ hasUnfinishedGoalProposal([goalCall({ reason: 'tool_name_unresolved', type: 'blocked' })]),+ ).toBe(true);+ });++ it('accepts calls persisted under the legacy identifier', () => {+ expect(hasUnfinishedGoalProposal([goalCall(undefined, 'lobe-goal')])).toBe(true);+ });++ it('is false once the latest proposal created a goal', () => {+ expect(+ hasUnfinishedGoalProposal([goalCall(), { role: 'user' }, goalCall({ goalId: 'goal_1' })]),+ ).toBe(false);+ });++ it('ignores createGoal on other tools', () => {+ expect(hasUnfinishedGoalProposal([goalCall(undefined, 'lobe-task')])).toBe(false);+ });+});diff --git a/packages/builtin-tool-goal/src/goalFollowUp.ts b/packages/builtin-tool-goal/src/goalFollowUp.tsnew file mode 100644index 00000000000..296619218c8--- /dev/null+++ b/packages/builtin-tool-goal/src/goalFollowUp.ts@@ -0,0 +1,31 @@+import { isGoalIdentifier } from './manifest';+import { GoalApiName } from './types';++interface GoalHistoryMessage {+ plugin?: { apiName?: string; identifier?: string } | null;+ pluginState?: { goalId?: unknown } | null;+ role?: string;+}++/**+ * Whether a conversation still has a goal proposal to finish: its latest+ * `createGoal` call did not create a goal — the user rejected the plan, it is+ * still awaiting approval, or it failed.+ *+ * The goal tool is otherwise only on a turn whose prompt starts with `/goal`,+ * so without this the turn resumed after "reject with feedback", or a plain+ * "try again", loses the tool and the model's retry is refused as an unknown+ * tool name. Once a goal is created the follow-up ends; starting another goal+ * goes back through `/goal` or the activator.+ */+export const hasUnfinishedGoalProposal = (messages: readonly GoalHistoryMessage[]): boolean => {+ for (let i = messages.length - 1; i >= 0; i--) {+ const { plugin, pluginState, role } = messages[i];+ if (role !== 'tool' || plugin?.apiName !== GoalApiName.createGoal) continue;+ if (!isGoalIdentifier(plugin.identifier)) continue;++ return !pluginState?.goalId;+ }++ return false;+};diff --git a/packages/builtin-tool-goal/src/index.ts b/packages/builtin-tool-goal/src/index.tsindex 07af3f92ba8..54edb79df90 100644--- a/packages/builtin-tool-goal/src/index.ts+++ b/packages/builtin-tool-goal/src/index.ts@@ -5,8 +5,9 @@ export {resolveGoalAttemptBudget,resolveGoalScheduleConfig,} from './createGoalInput';+export { hasUnfinishedGoalProposal } from './goalFollowUp';export { isGoalPrompt, stripGoalCommand } from './goalPrompt';-export { GoalIdentifier, GoalManifest } from './manifest';+export { GoalIdentifier, GoalManifest, isGoalIdentifier, LegacyGoalIdentifier } from './manifest';export * from './report';export * from './supervisor';export { systemPrompt } from './systemRole';diff --git a/packages/builtin-tool-goal/src/manifest.test.ts b/packages/builtin-tool-goal/src/manifest.test.tsindex f81420a4d1f..818345253f2 100644--- a/packages/builtin-tool-goal/src/manifest.test.ts+++ b/packages/builtin-tool-goal/src/manifest.test.ts@@ -5,7 +5,7 @@ import { GoalApiName } from './types';describe('GoalManifest', () => {it('exposes only the canonical createGoal workflow', () => {- expect(GoalManifest.identifier).toBe('lobe-goal');+ expect(GoalManifest.identifier).toBe('builtin-goal');expect(GoalManifest.api.map(({ name }) => name)).toEqual([GoalApiName.createGoal]);// 'always' cannot be bypassed by the user's auto-run approval mode —// launching a goal must always pause for the user to review the acceptance plandiff --git a/packages/builtin-tool-goal/src/manifest.ts b/packages/builtin-tool-goal/src/manifest.tsindex 68bfa58e9f0..4d9bfb4374f 100644--- a/packages/builtin-tool-goal/src/manifest.ts+++ b/packages/builtin-tool-goal/src/manifest.ts@@ -3,13 +3,24 @@ import type { BuiltinToolManifest } from '@lobechat/types';import { systemPrompt } from './systemRole';import { GoalApiName } from './types';-export const GoalIdentifier = 'lobe-goal';+export const GoalIdentifier = 'builtin-goal';++/**+ * The identifier the goal tool shipped under before it was renamed. Persisted+ * tool calls, pending approvals and agents that pinned the tool still carry it,+ * so renders, the server runtime and plugin resolution accept both.+ */+export const LegacyGoalIdentifier = 'lobe-goal';++/** Whether a tool identifier names the goal tool, under its current or legacy id. */+export const isGoalIdentifier = (identifier: unknown): boolean =>+ identifier === GoalIdentifier || identifier === LegacyGoalIdentifier;export const GoalManifest: BuiltinToolManifest = {api: [{description:- 'Create and immediately start a long-horizon goal with an editable acceptance plan. Use this only when the user explicitly starts their request with /goal. The call pauses for confirmation; after approval it creates the goal, records the acceptance criteria as its requirement, and advances its coordinator once — which dispatches the first task with its own verifier. Once it succeeds, do not execute or reproduce the work in the current conversation; the live result card is the progress and result entry point.',+ 'Create and immediately start a long-horizon goal with an editable acceptance plan. Use this when the user starts their request with /goal, explicitly asks to turn the work into a goal, or asks you to redo a goal proposal they rejected — fold their rejection feedback into the revised plan and call it again. Do not use it for ordinary requests the user did not ask to run as a goal. The call pauses for confirmation; after approval it creates the goal, records the acceptance criteria as its requirement, and advances its coordinator once — which dispatches the first task with its own verifier. Once it succeeds, do not execute or reproduce the work in the current conversation; the live result card is the progress and result entry point.',humanIntervention: 'always',name: GoalApiName.createGoal,parameters: {diff --git a/packages/builtin-tool-goal/src/systemRole.ts b/packages/builtin-tool-goal/src/systemRole.tsindex d9a4b9f927a..2f3699d2879 100644--- a/packages/builtin-tool-goal/src/systemRole.ts+++ b/packages/builtin-tool-goal/src/systemRole.ts@@ -1,3 +1,3 @@export const systemPrompt = `You have access to the Goal tool.-- **createGoal**: When — and only when — the user's message starts with \`/goal\`, turn the request into one editable goal plan and call createGoal before doing any substantive work. Use the current agent implicitly. Derive one concrete criterion per explicit requirement, default failed criteria to auto_repair, default maxIterations to 8, and omit maxTotalCost unless the user set one. The user confirms or edits the complete plan before the goal starts. After createGoal succeeds, the goal owns the work: its coordinator decomposes it and dispatches its own tasks, so do not perform, reproduce, preview, or self-check the requested work in the current conversation. End the turn with at most one brief sentence saying the goal is running and its live card shows progress.`;+- **createGoal**: When the user's message starts with \`/goal\`, explicitly asks to run the work as a goal, or asks you to redo a goal proposal they rejected, turn the request into one editable goal plan and call createGoal before doing any substantive work. If the user rejected an earlier createGoal with feedback, revise the plan to address every point of that feedback and call createGoal again — do not fall back to a plan or another tool. Do not start a goal for ordinary requests the user did not ask to run as a goal. Use the current agent implicitly. Derive one concrete criterion per explicit requirement, default failed criteria to auto_repair, default maxIterations to 8, and omit maxTotalCost unless the user set one. The user confirms or edits the complete plan before the goal starts. After createGoal succeeds, the goal owns the work: its coordinator decomposes it and dispatches its own tasks, so do not perform, reproduce, preview, or self-check the requested work in the current conversation. End the turn with at most one brief sentence saying the goal is running and its live card shows progress.`;diff --git a/packages/builtin-tool-task/src/client/Inspector/CreateGoal/index.tsx b/packages/builtin-tool-task/src/client/Inspector/CreateGoal/index.tsxindex 6996e2bbac1..a0e40f4c348 100644--- a/packages/builtin-tool-task/src/client/Inspector/CreateGoal/index.tsx+++ b/packages/builtin-tool-task/src/client/Inspector/CreateGoal/index.tsx@@ -17,7 +17,7 @@ const CreateGoalInspector = memo<BuiltinInspectorProps<CreateGoalParams, CreateGreturn (<div className={inspectorTextStyles.root}><span className={cx((isArgumentsStreaming || isLoading) && shinyTextStyles.shinyText)}>- {t('builtins.lobe-goal.apiName.createGoal')}+ {t('builtins.builtin-goal.apiName.createGoal')}</span>{name && <span> · {name}</span>}</div>diff --git a/packages/builtin-tools/src/index.ts b/packages/builtin-tools/src/index.tsindex f535becbce0..ade4ccd7224 100644--- a/packages/builtin-tools/src/index.ts+++ b/packages/builtin-tools/src/index.ts@@ -552,7 +552,9 @@ const builtinToolRegistry: LobeBuiltinTool[] = [type: 'builtin',},{- discoverable: false,+ // Hidden from the Tools popover (a goal starts from `/goal`), but+ // discoverable so the activator can enable it when the user asks for a goal+ // in plain words or wants a rejected goal proposal redone.hidden: true,identifier: GoalManifest.identifier,manifest: GoalManifest,diff --git a/packages/builtin-tools/src/register.ts b/packages/builtin-tools/src/register.tsindex 6fba58b55dd..83c2f0ec690 100644--- a/packages/builtin-tools/src/register.ts+++ b/packages/builtin-tools/src/register.ts@@ -64,6 +64,7 @@ import {GoalRenders,GoalSupervisorInspectors,GoalSupervisorManifest,+ LegacyGoalIdentifier,} from '@lobechat/builtin-tool-goal/client';import {GroupAgentBuilderInspectors,@@ -287,6 +288,8 @@ export const registerBuiltinToolSurfaces = (): void => {>,[GroupManagementManifest.identifier]: GroupManagementRenders as Record<string, BuiltinRender>,[GoalManifest.identifier]: GoalRenders as Record<string, BuiltinRender>,+ // Goal tool calls persisted before the rename to `builtin-goal`.+ [LegacyGoalIdentifier]: GoalRenders as Record<string, BuiltinRender>,[ImageGenerationManifest.identifier]: ImageGenerationRenders as Record<string, BuiltinRender>,[VideoGenerationManifest.identifier]: VideoGenerationRenders as Record<string, BuiltinRender>,[KnowledgeBaseManifest.identifier]: KnowledgeBaseRenders as Record<string, BuiltinRender>,@@ -351,6 +354,8 @@ export const registerBuiltinToolSurfaces = (): void => {BuiltinInspector>,[GoalManifest.identifier]: GoalInspectors as Record<string, BuiltinInspector>,+ // Goal tool calls persisted before the rename to `builtin-goal`.+ [LegacyGoalIdentifier]: GoalInspectors as Record<string, BuiltinInspector>,[GoalSupervisorManifest.identifier]: GoalSupervisorInspectors,[ImageGenerationManifest.identifier]: ImageGenerationInspectors as Record<string,@@ -450,6 +455,8 @@ export const registerBuiltinToolSurfaces = (): void => {BuiltinIntervention>,[GoalManifest.identifier]: GoalInterventions as Record<string, BuiltinIntervention>,+ // Goal tool calls persisted before the rename to `builtin-goal`.+ [LegacyGoalIdentifier]: GoalInterventions as Record<string, BuiltinIntervention>,[LobeAgentManifest.identifier]: LobeAgentInterventions as Record<string, BuiltinIntervention>,[LocalSystemIdentifier]: LocalSystemInterventions as Record<string, BuiltinIntervention>,[MemoryManifest.identifier]: MemoryInterventions as Record<string, BuiltinIntervention>,diff --git a/packages/database/src/models/work/__tests__/goalReport.test.ts b/packages/database/src/models/work/__tests__/goalReport.test.tsindex ff94249b6a9..4a2e91bb4d2 100644--- a/packages/database/src/models/work/__tests__/goalReport.test.ts+++ b/packages/database/src/models/work/__tests__/goalReport.test.ts@@ -50,7 +50,7 @@ const reportParams = (threadId,title: 'Wrap-up report',toolCallId: 'op:goal-report',- toolIdentifier: 'lobe-goal',+ toolIdentifier: 'builtin-goal',toolName: 'submitGoalReport',topicId,...overrides,diff --git a/packages/locales/src/default/plugin.ts b/packages/locales/src/default/plugin.tsindex 246c47d567d..cd896ebaa3d 100644--- a/packages/locales/src/default/plugin.ts+++ b/packages/locales/src/default/plugin.ts@@ -579,7 +579,7 @@ export default {'builtins.lobe-dashboard.title': 'Dashboards','builtins.lobe-task.apiName.createTask': 'Create task','builtins.lobe-task.apiName.createGoal': 'Start goal',- 'builtins.lobe-goal.apiName.createGoal': 'Start goal',+ 'builtins.builtin-goal.apiName.createGoal': 'Start goal','builtins.lobe-task.apiName.createTasks': 'Create tasks','builtins.lobe-task.apiName.addTaskComment': 'Add comment','builtins.lobe-task.apiName.deleteTask': 'Delete task',diff --git a/src/features/ChatInput/ActionBar/Plus/index.tsx b/src/features/ChatInput/ActionBar/Plus/index.tsxindex b87b377437a..ba767c0311c 100644--- a/src/features/ChatInput/ActionBar/Plus/index.tsx+++ b/src/features/ChatInput/ActionBar/Plus/index.tsx@@ -502,7 +502,7 @@ const usePlusMenuItems = ({ close }: { close: () => void }): ActionDropdownMenuI: uploadItems;// Goal creation has one canonical entry: drop the goal chip at the head of- // the composer. The agent then plans and calls lobe-goal.createGoal,+ // the composer. The agent then plans and calls builtin-goal.createGoal,// regardless of whether this conversation already has a topic.const acceptanceItems: ActionDropdownMenuItems = enableGoals? [diff --git a/src/features/Conversation/ChatInput/LinkedGoalTray/linkedGoals.test.ts b/src/features/Conversation/ChatInput/LinkedGoalTray/linkedGoals.test.tsindex 3f88bb2640d..a0c6f57c4bf 100644--- a/src/features/Conversation/ChatInput/LinkedGoalTray/linkedGoals.test.ts+++ b/src/features/Conversation/ChatInput/LinkedGoalTray/linkedGoals.test.ts@@ -23,7 +23,7 @@ const createGoalTurn = (goalId: string) =>apiName: 'createGoal',arguments: '{}',id: `call-${goalId}`,- identifier: 'lobe-goal',+ identifier: 'builtin-goal',result: { content: 'started', id: 'tool-1', state: { goalId, success: true } },type: 'builtin',},diff --git a/src/features/Conversation/Messages/GoalTaskCard/deriveOperationGoals.test.ts b/src/features/Conversation/Messages/GoalTaskCard/deriveOperationGoals.test.tsindex 05c5ae51454..122674ddaa3 100644--- a/src/features/Conversation/Messages/GoalTaskCard/deriveOperationGoals.test.ts+++ b/src/features/Conversation/Messages/GoalTaskCard/deriveOperationGoals.test.ts@@ -21,7 +21,7 @@ describe('deriveOperationGoals', () => {name: 'San Francisco night fog',}),id: 'call-1',- identifier: 'lobe-goal',+ identifier: 'builtin-goal',result: {content: 'started',id: 'tool-1',diff --git a/src/features/Conversation/Messages/GoalTaskCard/deriveOperationGoals.ts b/src/features/Conversation/Messages/GoalTaskCard/deriveOperationGoals.tsindex 470692ac144..91f6ed675b1 100644--- a/src/features/Conversation/Messages/GoalTaskCard/deriveOperationGoals.ts+++ b/src/features/Conversation/Messages/GoalTaskCard/deriveOperationGoals.ts@@ -1,3 +1,4 @@+import { isGoalIdentifier } from '@lobechat/builtin-tool-goal';import type { AssistantContentBlock, ChatToolPayloadWithResult } from '@lobechat/types';import { safeParseJSON } from '@lobechat/utils';@@ -21,7 +22,10 @@ const nonEmptyString = (value: unknown): string | undefined =>typeof value === 'string' && value.trim() ? value : undefined;const deriveBuiltinGoal = (tool: ChatToolPayloadWithResult): OperationGoal[] => {- if (!['lobe-goal', 'lobe-task'].includes(tool.identifier) || tool.apiName !== 'createGoal')+ if (+ !(isGoalIdentifier(tool.identifier) || tool.identifier === 'lobe-task') ||+ tool.apiName !== 'createGoal'+ )return [];if (tool.result?.error || !isRecord(tool.result?.state) || tool.result.state.success !== true)return [];diff --git a/src/features/DevPanel/RenderGallery/fixtures/lobe-task.ts b/src/features/DevPanel/RenderGallery/fixtures/lobe-task.tsindex 576ca65aaf8..2ac4096534d 100644--- a/src/features/DevPanel/RenderGallery/fixtures/lobe-task.ts+++ b/src/features/DevPanel/RenderGallery/fixtures/lobe-task.ts@@ -33,7 +33,7 @@ const goalArgs = {};export default defineFixtures({- identifier: 'lobe-goal',+ identifier: 'builtin-goal',fixtures: {createGoal: variants([{diff --git a/src/store/chat/slices/agentRun/actions/__tests__/conversationLifecycle.test.ts b/src/store/chat/slices/agentRun/actions/__tests__/conversationLifecycle.test.tsindex 8039cf6eba8..ce554f316ff 100644--- a/src/store/chat/slices/agentRun/actions/__tests__/conversationLifecycle.test.ts+++ b/src/store/chat/slices/agentRun/actions/__tests__/conversationLifecycle.test.ts@@ -3912,7 +3912,7 @@ describe('ConversationLifecycle actions', () => {});expect(executeGatewayAgentSpy).toHaveBeenCalledWith(- expect.objectContaining({ selectedToolIds: ['lobe-goal'] }),+ expect.objectContaining({ selectedToolIds: ['builtin-goal'] }),);});diff --git a/src/store/tool/slices/builtin/executors/index.ts b/src/store/tool/slices/builtin/executors/index.tsindex 15356c25ed8..ffec27c1e62 100644--- a/src/store/tool/slices/builtin/executors/index.ts+++ b/src/store/tool/slices/builtin/executors/index.ts@@ -6,6 +6,8 @@* the store does not pull every tool runtime into the initial SPA graph.*/+import { GoalIdentifier, LegacyGoalIdentifier } from '@lobechat/builtin-tool-goal';+import type { BuiltinToolContext, BuiltinToolResult, IBuiltinToolExecutor } from '../types';import { stashBuiltinToolWorkIntent } from './workRegistration';@@ -119,6 +121,10 @@ const registerExecutors = (executors: IBuiltinToolExecutor[]): void => {for (const executor of executors) {executorRegistry.set(executor.identifier, executor);}++ // Goal calls approved after the rename still name the tool `lobe-goal`.+ const goalExecutor = executorRegistry.get(GoalIdentifier);+ if (goalExecutor) executorRegistry.set(LegacyGoalIdentifier, goalExecutor);};export const registerBuiltinToolExecutors = async (): Promise<void> => {