๐คฏ 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
๐ fix: de-hardcode the brand from LLM system prompts and tool descriptions (#21930)
LiJian4cb20b19b793
diff --git a/apps/desktop/pnpm-lock.yaml b/apps/desktop/pnpm-lock.yamlindex f10cfc6615e..5b3bcb575ab 100644--- a/apps/desktop/pnpm-lock.yaml+++ b/apps/desktop/pnpm-lock.yaml@@ -637,6 +637,9 @@ importers:../../packages/prompts:dependencies:+ '@lobechat/business-const':+ specifier: workspace:*+ version: link:../business/const'@lobechat/const':specifier: workspace:*version: link:../constdiff --git a/apps/server/src/services/aiAgent/__tests__/execAgent.builtinRuntime.test.ts b/apps/server/src/services/aiAgent/__tests__/execAgent.builtinRuntime.test.tsindex 3043607aeba..e679dccb0df 100644--- a/apps/server/src/services/aiAgent/__tests__/execAgent.builtinRuntime.test.ts+++ b/apps/server/src/services/aiAgent/__tests__/execAgent.builtinRuntime.test.ts@@ -1,6 +1,7 @@import { GeneralChatAgent, GraphAgent } from '@lobechat/agent-runtime';import { PageAgentIdentifier } from '@lobechat/builtin-tool-page-agent';import { SELF_FEEDBACK_INTENT_IDENTIFIER } from '@lobechat/builtin-tool-self-iteration';+import { promptAssistantName } from '@lobechat/const';import { RequestTrigger } from '@lobechat/types';import type * as ModelBankModule from 'model-bank';import { beforeEach, describe, expect, it, vi } from 'vitest';@@ -447,7 +448,9 @@ describe('AiAgentService.execAgent - builtin agent runtime config', () => {// Verify createOperation was called with agentConfig containing the runtime systemRoleexpect(mockCreateOperation).toHaveBeenCalledTimes(1);const callArgs = mockCreateOperation.mock.calls[0][0];- expect(callArgs.agentConfig.systemRole).toContain('You are Lobe');+ // Derived, not a literal: the assistant's name comes from the branding slot,+ // so a hardcoded 'Lobe' here only passes on the upstream default.+ expect(callArgs.agentConfig.systemRole).toContain(`You are ${promptAssistantName('Lobe')}`);// Model identity is injected by ModelInfoProvider now, not the `{{model}}`// template placeholder; `{{date}}` still proves the runtime template merged.expect(callArgs.agentConfig.systemRole).toContain('{{date}}');diff --git a/packages/builtin-agents/src/agents/agent-builder/systemRole.ts b/packages/builtin-agents/src/agents/agent-builder/systemRole.tsindex ca0b8d04d5a..d6743d9ace6 100644--- a/packages/builtin-agents/src/agents/agent-builder/systemRole.ts+++ b/packages/builtin-agents/src/agents/agent-builder/systemRole.ts@@ -1,3 +1,6 @@+import { BRANDING_NAME } from '@lobechat/business-const';+import { promptAssistantName } from '@lobechat/const';+/*** Agent Builder System Role Template*@@ -9,7 +12,9 @@* (`@lobechat/builtin-tool-agent-builder`), which is injected alongside this one* whenever the tool is enabled. Duplicating it here is how the two drift apart.*/-export const systemRoleTemplate = `You are Lobe, an Agent Builder integrated into LobeHub. You help users create, configure and optimize their AI agents through natural conversation.+// Name and product both come from the branding slot, so a renamed deployment+// never hears the upstream ones; under default branding the text is unchanged.+export const systemRoleTemplate = `You are ${promptAssistantName('Lobe')}, an Agent Builder integrated into ${BRANDING_NAME}. You help users create, configure and optimize their AI agents through natural conversation.<role>You configure agents; you never become one. When a user's message could be read either as a request for domain help or as a description of an agent to build, always read it as the latter โ "ๅฅๅบทๅฉๆ๏ผๅจ่ฏขๅฅๅบท้ฎ้ข" means "build me a health assistant", not "answer my health question".diff --git a/packages/builtin-agents/src/agents/brandedPrompts.test.ts b/packages/builtin-agents/src/agents/brandedPrompts.test.tsnew file mode 100644index 00000000000..6f6122dd709--- /dev/null+++ b/packages/builtin-agents/src/agents/brandedPrompts.test.ts@@ -0,0 +1,77 @@+import type * as BusinessConst from '@lobechat/business-const';+import { afterEach, describe, expect, it, vi } from 'vitest';++vi.setConfig({ testTimeout: 30_000 });++/**+ * The built-in agents' prompts are what the assistant answers "who are you?"+ * with. Under default branding they must read exactly as upstream wrote them;+ * under a renamed brand no upstream name may survive.+ */+const loadPrompts = async (branding?: Partial<typeof BusinessConst>) => {+ vi.resetModules();+ if (branding) {+ vi.doMock('@lobechat/business-const', async (importOriginal) => ({+ ...(await importOriginal<typeof BusinessConst>()),+ ...branding,+ }));+ // Under vitest 5 a `doMock` only lands once the test file itself imports+ // something, so pull the mocked module in before the prompts.+ await import('@lobechat/business-const');+ }++ const [inbox, agentBuilder, supervisor] = await Promise.all([+ import('./inbox/systemRole'),+ import('./agent-builder/systemRole'),+ import('./group-supervisor/systemRole'),+ ]);++ return {+ agentBuilder: agentBuilder.systemRoleTemplate,+ inbox: inbox.createSystemRole(),+ inboxNamed: inbox.createSystemRole(undefined, { name: 'Mia' }),+ supervisor: supervisor.supervisorSystemRole,+ };+};++afterEach(() => {+ vi.doUnmock('@lobechat/business-const');+ vi.resetModules();+});++describe('built-in agent prompts', () => {+ it('keep upstream wording under default branding', async () => {+ const prompts = await loadPrompts();++ expect(prompts.inbox).toContain('You are Lobe, an AI Agent');+ expect(prompts.agentBuilder).toContain(+ 'You are Lobe, an Agent Builder integrated into LobeHub.',+ );+ expect(prompts.supervisor).toContain(+ 'You are LobeAI, an intelligent team coordinator developed by LobeHub,',+ );+ });++ it('introduce the renamed assistant and product under custom branding', async () => {+ const prompts = await loadPrompts({ BRANDING_INBOX_TITLE: 'Acme AI', BRANDING_NAME: 'Acme' });++ expect(prompts.inbox).toContain('You are Acme AI, an AI Agent');+ expect(prompts.agentBuilder).toContain(+ 'You are Acme AI, an Agent Builder integrated into Acme.',+ );+ expect(prompts.supervisor).toContain(+ 'You are Acme AI, an intelligent team coordinator developed by Acme,',+ );+ for (const prompt of [prompts.inbox, prompts.agentBuilder, prompts.supervisor]) {+ expect(prompt).not.toMatch(+ /You are Lobe\b|LobeAI|developed by LobeHub|integrated into LobeHub/,+ );+ }+ });++ it('still prefer the name the user gave the assistant', async () => {+ const prompts = await loadPrompts({ BRANDING_INBOX_TITLE: 'Acme AI', BRANDING_NAME: 'Acme' });++ expect(prompts.inboxNamed).toContain('You are Mia, an AI Agent');+ });+});diff --git a/packages/builtin-agents/src/agents/group-supervisor/systemRole.ts b/packages/builtin-agents/src/agents/group-supervisor/systemRole.tsindex cfc9ddc0e15..cb7c70d8902 100644--- a/packages/builtin-agents/src/agents/group-supervisor/systemRole.ts+++ b/packages/builtin-agents/src/agents/group-supervisor/systemRole.ts@@ -1,3 +1,6 @@+import { BRANDING_NAME } from '@lobechat/business-const';+import { promptAssistantName } from '@lobechat/const';+/*** System role template for Group Supervisor agent*@@ -9,7 +12,9 @@* - {{model}} - Current model ID (requires )* - {{provider}} - Current provider (requires )*/-export const supervisorSystemRole = `You are LobeAI, an intelligent team coordinator developed by LobeHub, powered by {{model}}. You are orchestrating the multi-agent group "{{GROUP_TITLE}}". Your primary responsibility is to facilitate productive, natural conversations by strategically coordinating when and how AI agents participate.+// Name and product both come from the branding slot โ `LobeAI` here leaked the+// upstream brand into every group conversation. Unchanged under default branding.+export const supervisorSystemRole = `You are ${promptAssistantName('LobeAI')}, an intelligent team coordinator developed by ${BRANDING_NAME}, powered by {{model}}. You are orchestrating the multi-agent group "{{GROUP_TITLE}}". Your primary responsibility is to facilitate productive, natural conversations by strategically coordinating when and how AI agents participate.<system_context>- Current date: {{date}}diff --git a/packages/builtin-agents/src/agents/inbox/systemRole.ts b/packages/builtin-agents/src/agents/inbox/systemRole.tsindex 61bf89573bb..f353007ab4c 100644--- a/packages/builtin-agents/src/agents/inbox/systemRole.ts+++ b/packages/builtin-agents/src/agents/inbox/systemRole.ts@@ -1,11 +1,18 @@+import { promptAssistantName } from '@lobechat/const';+/*** Inbox Agent System Role Template** This is the default assistant agent for general conversations.+ *+ * The fallback name comes from the branding slot, not a literal: this string is+ * what the assistant answers "who are you?" with, so a hardcoded name survives+ * every other rename and the assistant keeps introducing itself as the upstream+ * product.*/export interface InboxIdentity {- /** Personal name the user gave the assistant (falls back to "Lobe"). */+ /** Personal name the user gave the assistant (falls back to the branded default). */name?: string;/** Role title shown alongside the name. */title?: string;@@ -18,7 +25,7 @@ export interface InboxIdentity {* product default no matter what it is called.*/const buildSystemRole = ({ name, title }: InboxIdentity = {}) => {- const personalName = name?.trim() || 'Lobe';+ const personalName = name?.trim() || promptAssistantName('Lobe');const role = title?.trim();const identity = role ? `${personalName} (${role})` : personalName;diff --git a/packages/builtin-tool-activator/package.json b/packages/builtin-tool-activator/package.jsonindex c1b338f8ef3..1cfdc99691e 100644--- a/packages/builtin-tool-activator/package.json+++ b/packages/builtin-tool-activator/package.json@@ -10,6 +10,7 @@},"main": "./src/index.ts","dependencies": {+ "@lobechat/business-const": "workspace:*","ts-md5": "^2.0.1"},"devDependencies": {diff --git a/packages/builtin-tool-activator/src/systemRole.ts b/packages/builtin-tool-activator/src/systemRole.tsindex 8d790663cea..c5b57591165 100644--- a/packages/builtin-tool-activator/src/systemRole.ts+++ b/packages/builtin-tool-activator/src/systemRole.ts@@ -1,3 +1,5 @@+import { BRANDING_NAME } from '@lobechat/business-const';+const intro = `You have access to a Tools Activator that allows you to dynamically activate tools on demand. Not all tools are loaded by default โ you must activate them before use.`;const howItWorksSkill = `7. To activate a skill, use the \`activateSkill\` tool from lobe-skills โ it returns instructions to follow@@ -92,7 +94,7 @@ const credentialsManagement = `<credentials_management>2. Check if the required credential already exists using the credentials list in context3. If credential exists and the sandbox is reachable โ use \`injectCredsToSandbox\` (see \`<credential_usage_by_runtime>\` below)4. If credential doesn't exist:- - For LobeHub OAuth services (GitHub, Linear, Microsoft, Notion, Twitter) โ use \`initiateOAuthConnect\`+ - For ${BRANDING_NAME} OAuth services (GitHub, Linear, Microsoft, Notion, Twitter) โ use \`initiateOAuthConnect\`- For Composio-managed services (Slack, Google Drive, Airtable, Jira, etc.)โ use \`connectComposioService\` after activating \`lobe-creds\`. The full list ofavailable Composio services is shown in \`<composio_integrations>\` inside thediff --git a/packages/builtin-tool-agent-management/package.json b/packages/builtin-tool-agent-management/package.jsonindex a4701218e20..31464c52090 100644--- a/packages/builtin-tool-agent-management/package.json+++ b/packages/builtin-tool-agent-management/package.json@@ -14,6 +14,7 @@"dependencies": {"@lobechat/agent-manager-runtime": "workspace:*","@lobechat/builtin-tool-agent-builder": "workspace:*",+ "@lobechat/business-const": "workspace:*","@lobechat/const": "workspace:*","@lobechat/heterogeneous-agents": "workspace:*","lucide-react": "^1.22.0",diff --git a/packages/builtin-tool-agent-management/src/systemRole.ts b/packages/builtin-tool-agent-management/src/systemRole.tsindex 2cc4a7456d7..13a40637567 100644--- a/packages/builtin-tool-agent-management/src/systemRole.ts+++ b/packages/builtin-tool-agent-management/src/systemRole.ts@@ -1,3 +1,5 @@+import { BRANDING_NAME } from '@lobechat/business-const';+/*** System role for Agent Management tool*@@ -283,9 +285,9 @@ You are a [role] specialized in [domain].When selecting a model, follow this priority order:-1. **First Priority - LobeHub Provider Models**:+1. **First Priority - ${BRANDING_NAME} Provider Models**:- If available, prioritize models from the "lobehub" provider- - These are optimized for the LobeHub ecosystem+ - These are optimized for the ${BRANDING_NAME} ecosystem2. **Second Priority - Premium Frontier Models**:- **Anthropic**: Claude Sonnet 4.5, Claude Opus 4.5, or newer Opus/Sonnet seriesdiff --git a/packages/builtin-tool-creds/package.json b/packages/builtin-tool-creds/package.jsonindex f6a50f57cf7..a9efc496e3b 100644--- a/packages/builtin-tool-creds/package.json+++ b/packages/builtin-tool-creds/package.json@@ -11,6 +11,7 @@},"main": "./src/index.ts","dependencies": {+ "@lobechat/business-const": "workspace:*","@lobechat/shared-tool-ui": "workspace:*"},"devDependencies": {diff --git a/packages/builtin-tool-creds/src/manifest.ts b/packages/builtin-tool-creds/src/manifest.tsindex b64c9cc50b9..35e8f1a1265 100644--- a/packages/builtin-tool-creds/src/manifest.ts+++ b/packages/builtin-tool-creds/src/manifest.ts@@ -1,3 +1,4 @@+import { BRANDING_NAME } from '@lobechat/business-const';import type { BuiltinToolManifest } from '@lobechat/types';import type { JSONSchema7 } from 'json-schema';@@ -26,8 +27,7 @@ export const CredsManifest: BuiltinToolManifest = {} satisfies JSONSchema7,},{- description:- 'Initiate OAuth connection flow for a LobeHub Skill provider (e.g., GitHub, Linear, Microsoft Outlook, Notion, Twitter/X). Returns an authorization URL that the user must click to authorize. After authorization, the credential will be automatically saved.',+ description: `Initiate OAuth connection flow for a ${BRANDING_NAME} Skill provider (e.g., GitHub, Linear, Microsoft Outlook, Notion, Twitter/X). Returns an authorization URL that the user must click to authorize. After authorization, the credential will be automatically saved.`,name: CredsApiName.initiateOAuthConnect,parameters: {additionalProperties: false,diff --git a/packages/builtin-tool-creds/src/systemRole.ts b/packages/builtin-tool-creds/src/systemRole.tsindex 01873466608..8b2f86853aa 100644--- a/packages/builtin-tool-creds/src/systemRole.ts+++ b/packages/builtin-tool-creds/src/systemRole.ts@@ -1,4 +1,6 @@-export const systemPrompt = `You have access to a LobeHub Credentials Tool. This tool helps you securely manage and use credentials (API keys, tokens, secrets) for various services.+import { BRANDING_NAME } from '@lobechat/business-const';++export const systemPrompt = `You have access to a ${BRANDING_NAME} Credentials Tool. This tool helps you securely manage and use credentials (API keys, tokens, secrets) for various services.<session_context>Current user: {{username}}@@ -37,7 +39,7 @@ Cloud sandbox reachable for credential injection: {{creds_sandbox_reachable}}</tooling><oauth_providers>-LobeHub provides built-in OAuth integrations for the following services:+${BRANDING_NAME} provides built-in OAuth integrations for the following services:- **github**: GitHub repository and code management. Connect to access repositories, create issues, manage pull requests.- **linear**: Linear issue tracking and project management. Connect to create/manage issues, track projects.- **microsoft**: Microsoft Outlook Calendar. Connect to view/create calendar events, manage meetings.diff --git a/packages/builtin-tool-group-agent-builder/package.json b/packages/builtin-tool-group-agent-builder/package.jsonindex 23c0bc5084c..007d476034b 100644--- a/packages/builtin-tool-group-agent-builder/package.json+++ b/packages/builtin-tool-group-agent-builder/package.json@@ -11,7 +11,8 @@"main": "./src/index.ts","dependencies": {"@lobechat/agent-manager-runtime": "workspace:*",- "@lobechat/builtin-tool-agent-builder": "workspace:*"+ "@lobechat/builtin-tool-agent-builder": "workspace:*",+ "@lobechat/business-const": "workspace:*"},"devDependencies": {"@lobechat/types": "workspace:*"diff --git a/packages/builtin-tool-group-agent-builder/src/systemRole.ts b/packages/builtin-tool-group-agent-builder/src/systemRole.tsindex bc2d1e82b3b..c77e77e1b5c 100644--- a/packages/builtin-tool-group-agent-builder/src/systemRole.ts+++ b/packages/builtin-tool-group-agent-builder/src/systemRole.ts@@ -1,10 +1,12 @@+import { BRANDING_NAME } from '@lobechat/business-const';+/*** System role for Group Agent Builder tool** This provides guidance on how to effectively use the group agent builder tools* for configuring group chats and managing group members.*/-export const systemPrompt = `You are a Group Configuration Assistant integrated into LobeHub. Your role is to help users configure and optimize their multi-agent group chats through natural conversation.+export const systemPrompt = `You are a Group Configuration Assistant integrated into ${BRANDING_NAME}. Your role is to help users configure and optimize their multi-agent group chats through natural conversation.<context_awareness>**Important**: The current group's configuration, metadata, member agents, and available tools are automatically injected into the conversation context as \`<current_group_context>\`. You can reference this information directly without calling any read APIs.diff --git a/packages/builtin-tool-memory/package.json b/packages/builtin-tool-memory/package.jsonindex 45c2c532f6f..449fdee455b 100644--- a/packages/builtin-tool-memory/package.json+++ b/packages/builtin-tool-memory/package.json@@ -12,6 +12,7 @@"main": "./src/index.ts","scripts": {},"dependencies": {+ "@lobechat/business-const": "workspace:*","@lobechat/memory-user-memory": "workspace:*","@lobechat/prompts": "workspace:*"},diff --git a/packages/builtin-tool-memory/src/systemRole.ts b/packages/builtin-tool-memory/src/systemRole.tsindex af549a2ff71..a5c8d49a643 100644--- a/packages/builtin-tool-memory/src/systemRole.ts+++ b/packages/builtin-tool-memory/src/systemRole.ts@@ -1,4 +1,6 @@-export const systemPrompt = `You have a LobeHub Memory Tool. This tool is to recognise, retrieve, and coordinate high-quality user memories so downstream extractors can persist them accurately.+import { BRANDING_NAME } from '@lobechat/business-const';++export const systemPrompt = `You have a ${BRANDING_NAME} Memory Tool. This tool is to recognise, retrieve, and coordinate high-quality user memories so downstream extractors can persist them accurately.<session_context>Current user: {{username}}diff --git a/packages/builtin-tool-message/package.json b/packages/builtin-tool-message/package.jsonindex 661b80ce5c2..35def4b7a9d 100644--- a/packages/builtin-tool-message/package.json+++ b/packages/builtin-tool-message/package.json@@ -15,6 +15,9 @@"test:coverage": "vitest --coverage --silent='passed-only'","test:update": "vitest -u"},+ "dependencies": {+ "@lobechat/business-const": "workspace:*"+ },"devDependencies": {"@lobechat/types": "workspace:*"},diff --git a/packages/builtin-tool-message/src/manifest.ts b/packages/builtin-tool-message/src/manifest.tsindex fb3143ea6b0..78a65483f1e 100644--- a/packages/builtin-tool-message/src/manifest.ts+++ b/packages/builtin-tool-message/src/manifest.ts@@ -1,3 +1,4 @@+import { BRANDING_NAME } from '@lobechat/business-const';import type { BuiltinToolManifest } from '@lobechat/types';import { systemPrompt } from './systemRole';@@ -1027,8 +1028,7 @@ export const MessageManifest: BuiltinToolManifest = {// ==================== System Bot Messenger Management ===================={- description:- "List the current user's LobeHub System Bot connections (Slack workspaces, Discord guilds, Telegram, and user-owned WeChat accounts). Each entry returns an `id` to pass back as `installationId` on `getMessengerDetail` / `uninstallMessenger`, or as `messengerInstallationId` on send APIs. Use this when the user asks about connected messengers, or as the fallback when `listBots` has no entry for the target platform.",+ description: `List the current user's ${BRANDING_NAME} System Bot connections (Slack workspaces, Discord guilds, Telegram, and user-owned WeChat accounts). Each entry returns an \`id\` to pass back as \`installationId\` on \`getMessengerDetail\` / \`uninstallMessenger\`, or as \`messengerInstallationId\` on send APIs. Use this when the user asks about connected messengers, or as the fallback when \`listBots\` has no entry for the target platform.`,name: MessageApiName.listMessengers,parameters: {additionalProperties: false,@@ -1069,8 +1069,7 @@ export const MessageManifest: BuiltinToolManifest = {},},{- description:- 'List the platforms where the user can connect the LobeHub System Bot. Returns `appId` / `botUsername` when relevant. Use when guiding the user through `Settings โ Messenger`; browser OAuth and QR setup flows cannot be initiated from this tool.',+ description: `List the platforms where the user can connect the ${BRANDING_NAME} System Bot. Returns \`appId\` / \`botUsername\` when relevant. Use when guiding the user through \`Settings โ Messenger\`; browser OAuth and QR setup flows cannot be initiated from this tool.`,name: MessageApiName.listMessengerPlatforms,parameters: {additionalProperties: false,@@ -1137,7 +1136,11 @@ export const MessageManifest: BuiltinToolManifest = {},{description:- 'Proactively push a message to the CURRENT USER\'s own DM with the LobeHub System Bot โ THE api for "send me a message on <platform>", "DM me", "notify me when done". Unlike `sendDirectMessage` it needs no bot discovery, channel id, or platform user id: the server resolves the user\'s own account link. Availability comes from that account link, NOT from `listBots` / `listMessengers` โ a platform missing there can still be pushable, so never refuse based on those lists. Call `listMessengerLinks` when unsure which platforms are linked; when the user named one, just push and let an `unlinked` status tell you. Telegram / Discord / iMessage-SMS (`linq`) deliver immediately. Slack with several linked workspaces returns `needs_workspace_selection` โ ask the user to pick, then retry with that `tenantId`. WeChat can only deliver inside the send window opened by the user\'s last inbound message; outside it the push is `queued` and you must tell the user to message the LobeHub WeChat bot first so the queued push gets delivered.',+ "Proactively push a message to the CURRENT USER's own DM with the " ++ BRANDING_NAME ++ ' System Bot โ THE api for "send me a message on <platform>", "DM me", "notify me when done". Unlike `sendDirectMessage` it needs no bot discovery, channel id, or platform user id: the server resolves the user\'s own account link. Availability comes from that account link, NOT from `listBots` / `listMessengers` โ a platform missing there can still be pushable, so never refuse based on those lists. Call `listMessengerLinks` when unsure which platforms are linked; when the user named one, just push and let an `unlinked` status tell you. Telegram / Discord / iMessage-SMS (`linq`) deliver immediately. Slack with several linked workspaces returns `needs_workspace_selection` โ ask the user to pick, then retry with that `tenantId`. WeChat can only deliver inside the send window opened by the user\'s last inbound message; outside it the push is `queued` and you must tell the user to message the ' ++ BRANDING_NAME ++ ' WeChat bot first so the queued push gets delivered.',name: MessageApiName.sendMessengerPush,ordered: true,parameters: {diff --git a/packages/builtin-tool-message/src/systemRole.ts b/packages/builtin-tool-message/src/systemRole.tsindex e414d66a98a..38261dfe4be 100644--- a/packages/builtin-tool-message/src/systemRole.ts+++ b/packages/builtin-tool-message/src/systemRole.ts@@ -1,3 +1,5 @@+import { BRANDING_NAME } from '@lobechat/business-const';+export const systemPrompt = `You have access to a Message tool that provides unified messaging and bot management capabilities across multiple platforms.<supported_platforms>@@ -29,14 +31,14 @@ The rest of this section is for sending to **someone else**, to a channel, or inThe send APIs (\`sendMessage\`, \`sendDirectMessage\`, \`replyToThread\`) can deliver through **two sources** โ both use the same underlying platform clients (so attachments / formatting / rate behavior are identical), but they come from different lists:- **Per-agent bot** (pass \`botId\`) โ the agent's own credentials, configured via \`createBot\`. Listed by \`listBots\`. Messages appear with the per-agent bot's identity.-- **System Bot installation** (pass \`messengerInstallationId\`) โ the LobeHub shared bot, connected by the user via Settings โ Messenger. Listed by \`listMessengers\`. Messages appear with the LobeHub System Bot identity.+- **System Bot installation** (pass \`messengerInstallationId\`) โ the ${BRANDING_NAME} shared bot, connected by the user via Settings โ Messenger. Listed by \`listMessengers\`. Messages appear with the ${BRANDING_NAME} System Bot identity.**Routing rule โ apply in order:**0. **The target is the conversation you are in right now** (you're running inside an IM conversation โ there is a \`<current_conversation>\` block โ and you're sending into it, e.g. delivering a generated file): pass **neither** \`botId\` nor \`messengerInstallationId\`. The runtime sends through the exact connection this conversation arrived on. Skip discovery entirely โ another bot on the same platform is a different identity and may have a dead session.1. **Call \`listBots\`.** If an entry has \`platform: "<target>"\` and its \`status\` is NOT \`failed\` โ use its \`botId\` on the send API. Done. A \`failed\` bot's credentials are broken (e.g. an expired WeChat login accepts text but rejects every file); never auto-pick it โ continue to step 2, and mention to the user that the bot needs reconnecting.2. **Otherwise call \`listMessengers\`.** If any entry has \`platform: "<target>"\` โ use its \`id\` as \`messengerInstallationId\` on the send API. Done.-3. **Neither has a usable connection for the platform โ do NOT pick a different platform.** Tell the user: "I can't reach <platform> for you yet. You can either provision a dedicated bot for this agent with \`createBot\`, or install the LobeHub System Bot via Settings โ Messenger." Stop. (A self-targeted send should never reach this step โ it goes through \`sendMessengerPush\`, which these two lists do not govern.)+3. **Neither has a usable connection for the platform โ do NOT pick a different platform.** Tell the user: "I can't reach <platform> for you yet. You can either provision a dedicated bot for this agent with \`createBot\`, or install the ${BRANDING_NAME} System Bot via Settings โ Messenger." Stop. (A self-targeted send should never reach this step โ it goes through \`sendMessengerPush\`, which these two lists do not govern.)For sends elsewhere, healthy per-agent bots come first because they're purpose-built for the current agent and use identity the user explicitly configured. If the user **explicitly** asks to route through their System Bot install even when a per-agent bot exists, honor that and call \`listMessengers\` directly.@@ -46,7 +48,7 @@ When a send reports a WeChat \`errcode -14\` (session expired), the error names</outbound_routing><system_bot_management>-The **System Bot** is the LobeHub-owned shared bot the user connects via \`Settings โ Messenger\`. It's separate from per-agent bots (\`createBot\` / \`listBots\`). This API surface mirrors the per-agent CRUD but operates on \`messenger_installations\` (workspace installs) and \`messenger_account_links\` (per-user routing plus user-owned WeChat credentials).+The **System Bot** is the ${BRANDING_NAME}-owned shared bot the user connects via \`Settings โ Messenger\`. It's separate from per-agent bots (\`createBot\` / \`listBots\`). This API surface mirrors the per-agent CRUD but operates on \`messenger_installations\` (workspace installs) and \`messenger_account_links\` (per-user routing plus user-owned WeChat credentials).**Platform coverage** โ System Bot supports **Slack, Discord, Telegram, and WeChat**. Slack / Discord use workspace install flows, Telegram uses a global bot, and WeChat uses a user-owned QR connection. For Feishu / Lark / QQ the user must use a per-agent bot via \`createBot\`. \`listMessengerPlatforms\` returns the currently-enabled subset on this deployment.@@ -62,8 +64,8 @@ The **System Bot** is the LobeHub-owned shared bot the user connects via \`Setti7. **setMessengerActiveAgent** โ Change which agent receives inbound IM on a link. Pass \`agentId: null\` to clear the active agent. Scope to one workspace via \`tenantId\`; omit for single-link platforms (Telegram / WeChat). The agent must belong to the current user โ server rejects cross-user ids.**Critical disambiguation โ \`uninstallMessenger\` vs \`unlinkMessenger\`:**-- "remove my account from Slack" / "stop receiving DMs from this workspace on my LobeHub" โ \`unlinkMessenger\`-- "uninstall the LobeHub bot from my workspace" / "remove the integration for everyone" โ \`uninstallMessenger\` (workspace-admin level decision)+- "remove my account from Slack" / "stop receiving DMs from this workspace on my ${BRANDING_NAME}" โ \`unlinkMessenger\`+- "uninstall the ${BRANDING_NAME} bot from my workspace" / "remove the integration for everyone" โ \`uninstallMessenger\` (workspace-admin level decision)When in doubt, ask. Defaulting to the destructive option (\`uninstallMessenger\`) when the user only wanted \`unlinkMessenger\` will affect colleagues.@@ -71,7 +73,7 @@ When in doubt, ask. Defaulting to the destructive option (\`uninstallMessenger\`</system_bot_management><proactive_push>-**sendMessengerPush** โ proactively push a message to the **current user's own DM** with the LobeHub System Bot. This is THE api for "notify me on Telegram/Slack/Discord/WeChat/iMessage", "remind me when done", "push the result to my WeChat" โ any time you need to reach the user on their linked chat platform rather than reply in the current conversation.+**sendMessengerPush** โ proactively push a message to the **current user's own DM** with the ${BRANDING_NAME} System Bot. This is THE api for "notify me on Telegram/Slack/Discord/WeChat/iMessage", "remind me when done", "push the result to my WeChat" โ any time you need to reach the user on their linked chat platform rather than reply in the current conversation.How it differs from the other send APIs:- \`sendMessage\` / \`sendDirectMessage\` deliver to arbitrary channels / platform users and need bot discovery (\`listBots\` / \`listMessengers\`) plus a channel or platform user id.@@ -82,7 +84,7 @@ How it differs from the other send APIs:Platform semantics:- **Telegram / Discord** โ always deliverable; the message lands in the user's DM immediately.- **Slack** โ if the user linked several workspaces and you omit \`tenantId\`, the call returns \`needs_workspace_selection\` with the candidate list. Present the choices, let the user pick, then call again with that \`tenantId\`. Never guess a workspace.-- **WeChat** โ deliverable only inside the send window opened by the user's last inbound message (limited sends per window). Outside the window or with quota exhausted the push returns \`queued\`: the message is NOT lost โ it's delivered right after the user next messages the bot. **Always relay this to the user**: "I've queued the message โ send anything to the LobeHub WeChat bot and it will arrive."+- **WeChat** โ deliverable only inside the send window opened by the user's last inbound message (limited sends per window). Outside the window or with quota exhausted the push returns \`queued\`: the message is NOT lost โ it's delivered right after the user next messages the bot. **Always relay this to the user**: "I've queued the message โ send anything to the ${BRANDING_NAME} WeChat bot and it will arrive."Status handling:- \`sent\` โ done; for WeChat mention the remaining window quota only if the user asks.diff --git a/packages/builtin-tool-self-iteration/package.json b/packages/builtin-tool-self-iteration/package.jsonindex 7c6dd345012..15e3e8dee44 100644--- a/packages/builtin-tool-self-iteration/package.json+++ b/packages/builtin-tool-self-iteration/package.json@@ -9,6 +9,9 @@"./executionRuntime": "./src/ExecutionRuntime/index.ts"},"main": "./src/index.ts",+ "dependencies": {+ "@lobechat/business-const": "workspace:*"+ },"devDependencies": {"@lobechat/context-engine": "workspace:*","@lobechat/types": "workspace:*"diff --git a/packages/builtin-tool-self-iteration/src/systemRole.ts b/packages/builtin-tool-self-iteration/src/systemRole.tsindex 8fafc5bb97a..f9a23dace2a 100644--- a/packages/builtin-tool-self-iteration/src/systemRole.ts+++ b/packages/builtin-tool-self-iteration/src/systemRole.ts@@ -1,4 +1,6 @@-export const systemPrompt = `You have access to the Self Feedback Intent tool. It is a high-recall side channel for telling LobeHub that the running agent has found a concrete opportunity to improve its future memory, skills, workflow, or system behavior.+import { BRANDING_NAME } from '@lobechat/business-const';++export const systemPrompt = `You have access to the Self Feedback Intent tool. It is a high-recall side channel for telling ${BRANDING_NAME} that the running agent has found a concrete opportunity to improve its future memory, skills, workflow, or system behavior.<core_contract>- **declareSelfFeedbackIntent** records advisory intent only. It does not directly mutate user memory, skills, prompts, documents, or product configuration.diff --git a/packages/builtin-tool-skills/package.json b/packages/builtin-tool-skills/package.jsonindex b2a98c0596a..eaf0a79e879 100644--- a/packages/builtin-tool-skills/package.json+++ b/packages/builtin-tool-skills/package.json@@ -10,6 +10,7 @@},"main": "./src/index.ts","dependencies": {+ "@lobechat/business-const": "workspace:*","@lobechat/const": "workspace:*","@lobechat/prompts": "workspace:*","@lobechat/shared-tool-ui": "workspace:*"diff --git a/packages/builtin-tool-skills/src/systemRole.ts b/packages/builtin-tool-skills/src/systemRole.tsindex 4200d2bae94..19d80bf5347 100644--- a/packages/builtin-tool-skills/src/systemRole.ts+++ b/packages/builtin-tool-skills/src/systemRole.ts@@ -1,3 +1,5 @@+import { BRANDING_NAME } from '@lobechat/business-const';+export const systemPrompt = `You have access to a Skills tool that can activate skills and execute their instructions. Skills are reusable instruction packages that extend your capabilities.<core_capabilities>@@ -31,7 +33,7 @@ export const systemPrompt = `You have access to a Skills tool that can activate- **runCommand**: Call this to execute shell commands in the cloud sandbox- Use for general CLI commands, platform tools (e.g., \`lh\` CLI), and ad-hoc operations- - If \`lobe-local-system\` runCommand is also available, default shell execution to it โ use this sandbox runCommand only when the task needs LobeHub-managed credentials, isolation, or a tool missing on the local device+ - If \`lobe-local-system\` runCommand is also available, default shell execution to it โ use this sandbox runCommand only when the task needs ${BRANDING_NAME}-managed credentials, isolation, or a tool missing on the local device- Provide the command to execute and a clear description of what it does- Returns the command output (stdout/stderr) and exit code- Requires user confirmation before executiondiff --git a/packages/const/src/meta.ts b/packages/const/src/meta.tsindex 468b76a44f6..bee728de14f 100644--- a/packages/const/src/meta.ts+++ b/packages/const/src/meta.ts@@ -8,6 +8,17 @@ export const DEFAULT_SUPERVISOR_ID = 'supervisor';export const DEFAULT_BACKGROUND_COLOR = undefined;export const DEFAULT_AGENT_META: MetaData = {};export const DEFAULT_INBOX_TITLE = BRANDING_INBOX_TITLE;++/**+ * The assistant's name as a built-in prompt spells it.+ *+ * Upstream prompts call the default assistant by shorter forms than the UI+ * title ("Lobe", "LobeAI"). Under the default title those stay exactly as they+ * are; a deployment that renamed the assistant gets its own title everywhere,+ * so the model never introduces itself by the upstream name.+ */+export const promptAssistantName = (upstreamForm: string): string =>+ (BRANDING_INBOX_TITLE as string) === 'Lobe AI' ? upstreamForm : BRANDING_INBOX_TITLE;export const DEFAULT_INBOX_AVATAR = BRANDING_LOGO_URL || '/avatars/lobe-ai.png';export const DEFAULT_USER_AVATAR_URL = BRANDING_LOGO_URL || '/app-icons/icon-192x192.png';diff --git a/packages/prompts/package.json b/packages/prompts/package.jsonindex ab1fb679dd8..3f44fa5ad8a 100644--- a/packages/prompts/package.json+++ b/packages/prompts/package.json@@ -16,6 +16,7 @@"test:update": "vitest -u"},"dependencies": {+ "@lobechat/business-const": "workspace:*","@lobechat/const": "workspace:*"},"devDependencies": {diff --git a/packages/prompts/src/prompts/agentSkillManager/consolidate.ts b/packages/prompts/src/prompts/agentSkillManager/consolidate.tsindex fa7255ccfc3..ed486179c14 100644--- a/packages/prompts/src/prompts/agentSkillManager/consolidate.ts+++ b/packages/prompts/src/prompts/agentSkillManager/consolidate.ts@@ -1,3 +1,5 @@+import { BRANDING_NAME } from '@lobechat/business-const';+/*** Input used by the focused skill consolidation prompt.*/@@ -64,7 +66,7 @@ Writing quality:Examples:Input: two skills both describe PR review, one covers locale placement and one covers cloud override checks.Output:-{"bodyMarkdown":"# LobeHub Cloud PR Review\\n\\n## Workflow\\n- Check cloud override paths before reviewing the submodule implementation.\\n- Verify locale keys are added in the canonical submodule locale files.\\n- Cite concrete files and lines for every finding.\\n\\n## Pitfalls\\n- Do not treat submodule-only code as authoritative when a cloud override exists.","description":"Use when reviewing LobeHub Cloud PRs that may involve cloud overrides, locale keys, or submodule behavior.","rename":{"newName":"cloud-pr-review","newTitle":"Cloud PR Review"},"reason":"The source skills overlap and should activate as one review procedure.","confidence":0.88}+{"bodyMarkdown":"# ${BRANDING_NAME} Cloud PR Review\\n\\n## Workflow\\n- Check cloud override paths before reviewing the submodule implementation.\\n- Verify locale keys are added in the canonical submodule locale files.\\n- Cite concrete files and lines for every finding.\\n\\n## Pitfalls\\n- Do not treat submodule-only code as authoritative when a cloud override exists.","description":"Use when reviewing ${BRANDING_NAME} Cloud PRs that may involve cloud overrides, locale keys, or submodule behavior.","rename":{"newName":"cloud-pr-review","newTitle":"Cloud PR Review"},"reason":"The source skills overlap and should activate as one review procedure.","confidence":0.88}Input: sources discuss unrelated workflows.Output:diff --git a/packages/prompts/src/prompts/agentSkillManager/create.ts b/packages/prompts/src/prompts/agentSkillManager/create.tsindex 0c498497f1c..bbd035adfc3 100644--- a/packages/prompts/src/prompts/agentSkillManager/create.ts+++ b/packages/prompts/src/prompts/agentSkillManager/create.ts@@ -1,3 +1,5 @@+import { BRANDING_NAME } from '@lobechat/business-const';+/*** Input used by the skill creation authoring prompt.*/@@ -72,7 +74,7 @@ Writing quality:Examples:Input: feedback says future PR reviews should always inspect locale key placement and existing cloud overrides; evidence includes the exact files to check.Output:-{"name":"cloud-pr-review-checks","title":"Cloud PR Review Checks","description":"Use when reviewing LobeHub Cloud PRs that may touch locale keys, cloud overrides, or submodule behavior.","bodyMarkdown":"# Cloud PR Review Checks\\n\\n## Workflow\\n- Check cloud override paths before judging submodule code.\\n- Verify new locale keys live in the submodule locale defaults and zh-CN preview files.\\n- Confirm PR feedback cites exact files and lines.\\n\\n## Verification\\n- Run the focused tests or explain why they were not run.","reason":"The feedback describes a reusable review procedure with concrete checks.","confidence":0.86}+{"name":"cloud-pr-review-checks","title":"Cloud PR Review Checks","description":"Use when reviewing ${BRANDING_NAME} Cloud PRs that may touch locale keys, cloud overrides, or submodule behavior.","bodyMarkdown":"# Cloud PR Review Checks\\n\\n## Workflow\\n- Check cloud override paths before judging submodule code.\\n- Verify new locale keys live in the submodule locale defaults and zh-CN preview files.\\n- Confirm PR feedback cites exact files and lines.\\n\\n## Verification\\n- Run the focused tests or explain why they were not run.","reason":"The feedback describes a reusable review procedure with concrete checks.","confidence":0.86}Input: feedback says thanks, that answer was helpful.Output:diff --git a/packages/prompts/src/prompts/task/taskManagerDefaults.ts b/packages/prompts/src/prompts/task/taskManagerDefaults.tsindex 13e1be064c7..0965e331a0e 100644--- a/packages/prompts/src/prompts/task/taskManagerDefaults.ts+++ b/packages/prompts/src/prompts/task/taskManagerDefaults.ts@@ -1,3 +1,5 @@+import { DEFAULT_INBOX_TITLE } from '@lobechat/const';+export interface TaskManagerPromptDefaults {defaultAssigneeAgentId?: string;}@@ -9,9 +11,9 @@ export const buildTaskManagerDefaultsBlock = ({return ['<task_manager_defaults>',- `Default Lobe AI agent id: ${defaultAssigneeAgentId}`,- 'Use this id as assigneeAgentId when you decide a task should be assigned to the default Lobe AI assistant.',- "Do not use it as a listTasks filter unless the user asks for Lobe AI's tasks.",+ `Default ${DEFAULT_INBOX_TITLE} agent id: ${defaultAssigneeAgentId}`,+ `Use this id as assigneeAgentId when you decide a task should be assigned to the default ${DEFAULT_INBOX_TITLE} assistant.`,+ `Do not use it as a listTasks filter unless the user asks for ${DEFAULT_INBOX_TITLE}'s tasks.`,'</task_manager_defaults>','',];diff --git a/src/components/ModelSelect/index.tsx b/src/components/ModelSelect/index.tsxindex a35fc13e6b9..31e1769d478 100644--- a/src/components/ModelSelect/index.tsx+++ b/src/components/ModelSelect/index.tsx@@ -1,3 +1,4 @@+import { BRANDING_PROVIDER } from '@lobechat/business-const';import { type ChatModelCard } from '@lobechat/types';import { type IconAvatarProps } from '@lobehub/icons';import { LobeHub } from '@lobehub/icons';@@ -27,7 +28,9 @@ import { type CSSProperties, type FC, type ReactNode } from 'react';import { memo } from 'react';import { useTranslation } from 'react-i18next';+import { ProductLogo } from '@/components/Branding/ProductLogo';import { ModelIcon, ProviderIcon } from '@/components/LobeIcons';+import { isCustomBranding } from '@/const/version';import { type AiProviderSourceType } from '@/types/aiProvider';import { formatTokenNumber } from '@/utils/format';@@ -394,6 +397,8 @@ export const ProviderItemRender = memo<ProviderItemRenderProps>(style={isMono ? { filter: 'grayscale(1)' } : {}}title={name}/>+ ) : isCustomBranding && provider === BRANDING_PROVIDER ? (+ <ProductLogo size={size} type={isMono ? 'mono' : 'flat'} />) : provider === 'lobehub' ? (<LobeHub.Morden size={size} />) : (