Skip to content

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

🐛 fix(agent): complete two-state tool and skill activation migration (#23555)

AmAzing-c5d79a355d4a
diff --git a/.agents/skills/agent-work/SKILL.md b/.agents/skills/agent-work/SKILL.md
index 91c02b9c771..9c67c0864ae 100644
--- a/.agents/skills/agent-work/SKILL.md
+++ b/.agents/skills/agent-work/SKILL.md
@@ -112,7 +112,7 @@ The whole scan returns `{attempted, failed}` and the completion backstop (`Compl
## Key decisions (from the Work PRs)
- **Only successful create/edit results become Works** (LOBE-10967). Read-only queries, comments, merges/closes, and branch/repo operations are excluded — `gh pr view` printing an entity URL must NOT register.
-- **`owner/repo#number` is the canonical github identity**, not node_id: the gh CLI surface never returns node_id, and the same entity touched via REST tools and CLI must land on one Work row.
+- **`owner/repo#number` is the canonical github identity**, not node\_id: the gh CLI surface never returns node\_id, and the same entity touched via REST tools and CLI must land on one Work row.
- **stdout is the source of truth for identity** on the CLI path (`gh … create/edit` prints the entity URL); the command's edit target is the fallback. The LAST gh create/edit segment of a chained command owns the trailing URL.
- **Persisted URLs are http(s)-allowlisted** (`sanitizeExternalUrl`): gh stdout / tool results are member-controlled and the URL reaches `shell.openExternal` on desktop.
- **Partial registrations merge version metadata too.** With `patchFields`, `registerWorkVersion` spreads the new `metadata` over the current version's, so a GitHub PR's `headBranch` / `baseBranch` (from `--head` / `--base` or REST `head.ref` / `base.ref`) survive an edit that names neither. A key cannot be cleared on that path; a provider that needs to unset one must send a complete registration.
diff --git a/apps/cli/src/commands/app.ts b/apps/cli/src/commands/app.ts
index e792adf4904..d34bbc218a1 100644
--- a/apps/cli/src/commands/app.ts
+++ b/apps/cli/src/commands/app.ts
@@ -5,8 +5,8 @@ import type { Command } from 'commander';
import pc from 'picocolors';
import {
- type DesktopChannel,
type DesktopAppLocation,
+ type DesktopChannel,
installShim,
isDesktopChannel,
launchDesktopApp,
diff --git a/apps/cli/src/utils/desktopApp.test.ts b/apps/cli/src/utils/desktopApp.test.ts
index 316ea940217..5347f64ca6e 100644
--- a/apps/cli/src/utils/desktopApp.test.ts
+++ b/apps/cli/src/utils/desktopApp.test.ts
@@ -5,8 +5,8 @@ import path from 'node:path';
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import {
- type DesktopAppLocation,
CLI_SHIM_NAME,
+ type DesktopAppLocation,
installShim,
isDesktopChannel,
platformExecutableNames,
diff --git a/apps/server/src/modules/Mecha/ContextEngineering/providers/index.ts b/apps/server/src/modules/Mecha/ContextEngineering/providers/index.ts
index be9a93149da..2ddec1095d7 100644
--- a/apps/server/src/modules/Mecha/ContextEngineering/providers/index.ts
+++ b/apps/server/src/modules/Mecha/ContextEngineering/providers/index.ts
@@ -16,7 +16,7 @@ import {
import type { ContextFactProviders, ContextFactRequest } from '@lobechat/mecha';
import {
agentShareDocumentAccessScope,
- getActivePluginIds,
+ getOptedInPluginIds,
isLiveAgentAccount,
ordinaryDocumentAccessScope,
} from '@lobechat/types';
@@ -191,7 +191,7 @@ export const createServerContextFactProviders = ({
if (!config) return null;
return {
...config,
- plugins: getActivePluginIds(Array.isArray(config.plugins) ? config.plugins : undefined),
+ plugins: getOptedInPluginIds(Array.isArray(config.plugins) ? config.plugins : undefined),
};
},
diff --git a/apps/server/src/routers/lambda/__tests__/agentShare.test.ts b/apps/server/src/routers/lambda/__tests__/agentShare.test.ts
index cadbde4df9c..0f1088554e3 100644
--- a/apps/server/src/routers/lambda/__tests__/agentShare.test.ts
+++ b/apps/server/src/routers/lambda/__tests__/agentShare.test.ts
@@ -129,6 +129,40 @@ vi.mock('@/server/featureFlags', () => ({
mockGetFeatureFlagsState(...args),
}));
+const mockGetAgentConfigById = vi.fn();
+vi.mock('@/database/models/agent', () => ({
+ AgentModel: vi.fn(function () {
+ return { getAgentConfigById: mockGetAgentConfigById };
+ }),
+}));
+
+const mockFindAllAgentSkills = vi.fn(async () => ({ data: [], total: 0 }));
+vi.mock('@/database/models/agentSkill', () => ({
+ AgentSkillModel: vi.fn(function () {
+ return { findAll: mockFindAllAgentSkills };
+ }),
+}));
+
+const mockGetAgentSkills = vi.fn(async () => []);
+vi.mock('@/server/services/agentDocuments', () => ({
+ AgentDocumentsService: vi.fn(function () {
+ return { getAgentSkills: mockGetAgentSkills };
+ }),
+}));
+
+const mockGetUserSettings = vi.fn(async () => ({}));
+vi.mock('@/database/models/user', () => ({
+ UserModel: vi.fn(function () {
+ return { getUserSettings: mockGetUserSettings };
+ }),
+}));
+
+vi.mock('@/server/services/userSkill', () => ({
+ UserSkillService: vi.fn(function () {
+ return { listCatalog: async () => [] };
+ }),
+}));
+
const { agentShareConfigPatchSchema, agentShareConfigSchema, agentShareRouter } =
await import('../agentShare');
@@ -762,4 +796,53 @@ describe('agentShareRouter', () => {
});
});
});
+
+ describe('listGrantableSkills', () => {
+ beforeEach(() => {
+ mockGetByAgentId.mockResolvedValue({
+ agentId: 'agent-1',
+ id: 'share-1',
+ shareConfig: {},
+ });
+ mockFindAllAgentSkills.mockResolvedValue({ data: [], total: 0 });
+ mockGetAgentSkills.mockResolvedValue([]);
+ mockGetUserSettings.mockResolvedValue({});
+ });
+
+ it('includes implicit builtin skills for legacy agents and honors legacy library uninstalls', async () => {
+ mockGetAgentConfigById.mockResolvedValue({
+ chatConfig: {},
+ createdAt: new Date('2026-11-01T00:00:00Z'),
+ plugins: [],
+ });
+ mockGetUserSettings.mockResolvedValue({
+ tool: { uninstalledBuiltinTools: ['lobe-artifacts'] },
+ });
+
+ const caller = agentShareRouter.createCaller(await createContextInner({ userId: 'user-1' }));
+ const skills = await caller.listGrantableSkills({ agentId: 'agent-1' });
+ const ids = skills.map((s) => s.identifier);
+
+ expect(ids).toContain('lobehub');
+ expect(ids).not.toContain('lobe-artifacts');
+ });
+
+ it('omits implicit builtin skills for post-opt-in agents unless explicitly enabled', async () => {
+ mockGetAgentConfigById.mockResolvedValue({
+ chatConfig: {},
+ createdAt: new Date('2026-11-20T00:00:00Z'),
+ plugins: [{ builtinOverride: true, identifier: 'lobe-artifacts', mode: 'auto' }],
+ });
+ mockGetUserSettings.mockResolvedValue({
+ tool: { uninstalledBuiltinTools: ['lobe-artifacts'] },
+ });
+
+ const caller = agentShareRouter.createCaller(await createContextInner({ userId: 'user-1' }));
+ const skills = await caller.listGrantableSkills({ agentId: 'agent-1' });
+ const ids = skills.map((s) => s.identifier);
+
+ expect(ids).toContain('lobe-artifacts');
+ expect(ids).not.toContain('lobehub');
+ });
+ });
});
diff --git a/apps/server/src/routers/lambda/agentShare.ts b/apps/server/src/routers/lambda/agentShare.ts
index 227075f2b31..b94358f540d 100644
--- a/apps/server/src/routers/lambda/agentShare.ts
+++ b/apps/server/src/routers/lambda/agentShare.ts
@@ -434,6 +434,7 @@ export const agentShareRouter = router({
agentConfig,
agentId: input.agentId,
db: ctx.serverDB,
+ includeLegacyBuiltinSkills: true,
userId: ctx.userId,
workspaceId,
});
diff --git a/apps/server/src/services/agentDocumentVfs/mounts/skills/providers/ProviderSkillsInstalledActive.ts b/apps/server/src/services/agentDocumentVfs/mounts/skills/providers/ProviderSkillsInstalledActive.ts
index 9e42ac6e618..a99e8c2195d 100644
--- a/apps/server/src/services/agentDocumentVfs/mounts/skills/providers/ProviderSkillsInstalledActive.ts
+++ b/apps/server/src/services/agentDocumentVfs/mounts/skills/providers/ProviderSkillsInstalledActive.ts
@@ -1,5 +1,5 @@
import {
- getActivePluginIds,
+ getOptedInPluginIds,
type SkillItem,
type SkillListItem,
type SkillResourceMeta,
@@ -40,7 +40,7 @@ export class ProviderSkillsInstalledActive implements SkillMountProvider {
private async getEnabledIdentifiers(agentId: string) {
const agent = await this.deps.agentModel.getAgentConfigById(agentId);
- return new Set(getActivePluginIds(agent?.plugins ?? undefined));
+ return new Set(getOptedInPluginIds(agent?.plugins ?? undefined));
}
private async findSkillByIdentifier(
diff --git a/apps/server/src/services/agentDocumentVfs/mounts/skills/providers/ProviderSkillsReadonly.test.ts b/apps/server/src/services/agentDocumentVfs/mounts/skills/providers/ProviderSkillsReadonly.test.ts
index 50a1c8c3fb8..23ba8169b55 100644
--- a/apps/server/src/services/agentDocumentVfs/mounts/skills/providers/ProviderSkillsReadonly.test.ts
+++ b/apps/server/src/services/agentDocumentVfs/mounts/skills/providers/ProviderSkillsReadonly.test.ts
@@ -237,16 +237,22 @@ describe('readonly skill providers', () => {
vi.clearAllMocks();
});
- it('filters installed skills by the agent plugin identifiers', async () => {
+ it('filters installed skills by the agent plugin identifiers (auto + legacy pinned, excluding disabled)', async () => {
agentModel.getAgentConfigById.mockResolvedValue({
- plugins: ['skill.one'],
+ plugins: [
+ 'skill.one',
+ { identifier: 'skill.auto', mode: 'auto' },
+ { identifier: 'skill.disabled', mode: 'disabled' },
+ ],
});
skillModel.findAll.mockResolvedValue({
data: [
{ id: 'skill-1', identifier: 'skill.one', name: 'Skill One' },
- { id: 'skill-2', identifier: 'skill.two', name: 'Skill Two' },
+ { id: 'skill-2', identifier: 'skill.auto', name: 'Skill Auto' },
+ { id: 'skill-3', identifier: 'skill.disabled', name: 'Skill Disabled' },
+ { id: 'skill-4', identifier: 'skill.two', name: 'Skill Two' },
],
- total: 2,
+ total: 4,
});
const provider = new ProviderSkillsInstalledActive({
@@ -264,6 +270,12 @@ describe('readonly skill providers', () => {
});
expect(result).toEqual([
+ expect.objectContaining({
+ name: 'skill.auto',
+ namespace: 'installed-active',
+ path: './lobe/skills/installed/active/skills/skill.auto',
+ type: 'directory',
+ }),
expect.objectContaining({
name: 'skill.one',
namespace: 'installed-active',
diff --git a/apps/server/src/services/agentEvalRun/__tests__/agentEvalRunService.caseAgent.test.ts b/apps/server/src/services/agentEvalRun/__tests__/agentEvalRunService.caseAgent.test.ts
index 93f8916f295..cbcf3030a70 100644
--- a/apps/server/src/services/agentEvalRun/__tests__/agentEvalRunService.caseAgent.test.ts
+++ b/apps/server/src/services/agentEvalRun/__tests__/agentEvalRunService.caseAgent.test.ts
@@ -255,6 +255,37 @@ describe('AgentEvalRunService case Agents', () => {
);
});
+ it('preserves base agent auto skills and disabled opt-outs when cloning a case Agent', async () => {
+ const basePlugins = [
+ { identifier: 'my-skill', mode: 'auto' as const },
+ { identifier: 'github', mode: 'disabled' as const },
+ ];
+ const [target] = await serverDB
+ .insert(agents)
+ .values({
+ model: 'gpt-4.1-mini',
+ plugins: basePlugins,
+ provider: 'openai',
+ systemRole: 'Base role',
+ userId,
+ })
+ .returning();
+ const { dataset, testCases } = await createDataset([
+ { agent: { systemRole: 'Case override' }, input: 'Check orders' },
+ ]);
+
+ const service = new AgentEvalRunService(serverDB, userId);
+ const run = await service.createRun({
+ datasetId: dataset.id,
+ targetAgentId: target.id,
+ });
+
+ const created = await hiddenAgents();
+ const caseAgentId = await topicAgentOf(run.id, testCases[0].id);
+ const cloned = created.find((item) => item.id === caseAgentId)!;
+ expect(cloned.plugins).toEqual(basePlugins);
+ });
+
it('deletes the hidden Agents with the run', async () => {
const { dataset } = await createDataset([
{ agent: { systemRole: 'You run a store.' }, input: 'Check orders' },
diff --git a/apps/server/src/services/agentEvalRun/caseAgent.ts b/apps/server/src/services/agentEvalRun/caseAgent.ts
index 627d99ede03..2b879926d43 100644
--- a/apps/server/src/services/agentEvalRun/caseAgent.ts
+++ b/apps/server/src/services/agentEvalRun/caseAgent.ts
@@ -1,7 +1,6 @@
import { DEFAULT_AGENT_CONFIG } from '@lobechat/const';
import type { LobeChatDatabase } from '@lobechat/database';
import type { EvalCaseEnvironment, EvalRunConfig } from '@lobechat/types';
-import { getActivePluginIds } from '@lobechat/types';
import { and, eq, sql } from 'drizzle-orm';
import { AgentModel } from '@/database/models/agent';
@@ -100,7 +99,8 @@ const buildCaseAgent = (
fewShots: base?.fewShots,
model,
params: { ...(base?.params ?? DEFAULT_AGENT_CONFIG.params), ...run.config?.params },
- plugins: caseAgent?.plugins ?? (base ? getActivePluginIds(base.plugins) : []),
+ // Preserve full AgentPluginEntry[] (auto skills/connectors and disabled opt-outs) from base.
+ plugins: caseAgent?.plugins ?? base?.plugins ?? [],
provider,
// Name and title reach the prompt (`<agent_identity>`), so the Agent carries
// only what the case or the target Agent declares; the eval label lives in
diff --git a/apps/server/src/services/agentEvalRun/caseFromTopic.ts b/apps/server/src/services/agentEvalRun/caseFromTopic.ts
index 6b8f8a9357d..62650236b9a 100644
--- a/apps/server/src/services/agentEvalRun/caseFromTopic.ts
+++ b/apps/server/src/services/agentEvalRun/caseFromTopic.ts
@@ -1,4 +1,4 @@
-import { getActivePluginIds } from '@lobechat/types';
+import { getOptedInPluginIds } from '@lobechat/types';
import { initModelRuntimeForRequest } from '@/server/modules/AgentRuntime/llmRelay/oneShot';
@@ -160,7 +160,7 @@ export async function draftCaseFromTopic(
agent = {
model: config.model ?? undefined,
name: (config as { name?: string | null }).name ?? null,
- plugins: getActivePluginIds(config.plugins as any),
+ plugins: getOptedInPluginIds(config.plugins as any),
provider: config.provider ?? undefined,
systemRole: config.systemRole ?? undefined,
title: config.title ?? null,
diff --git a/apps/server/src/services/agentEvalRun/createRun.ts b/apps/server/src/services/agentEvalRun/createRun.ts
index 70ec5bc24c1..930be0fb9fc 100644
--- a/apps/server/src/services/agentEvalRun/createRun.ts
+++ b/apps/server/src/services/agentEvalRun/createRun.ts
@@ -7,7 +7,7 @@ import type {
ImportedMessage,
ToolIntervention,
} from '@lobechat/types';
-import { evalCaseVersionOf, getActivePluginIds } from '@lobechat/types';
+import { evalCaseVersionOf, getOptedInPluginIds } from '@lobechat/types';
import { clampToolIdentifier } from '@lobechat/utils/clampToolIdentifier';
import { eq, inArray, sql } from 'drizzle-orm';
@@ -413,10 +413,8 @@ async function snapshotAgentConfig(
fewShots: agentConfig.fewShots,
model: agentConfig.model,
params: agentConfig.params as Record<string, unknown>,
- // Pinned identifiers only — this snapshot is a display-only DTO
- // (EvalRunAgentSnapshot.plugins stays string[]), and a disabled entry
- // isn't part of what actually ran.
- plugins: getActivePluginIds(agentConfig.plugins),
+ // Opted-in identifiers (`auto` + legacy `pinned`) — excludes explicitly disabled entries.
+ plugins: getOptedInPluginIds(agentConfig.plugins),
provider: agentConfig.provider,
systemRole: agentConfig.systemRole,
title: agentConfig.title,
diff --git a/apps/server/src/services/agentShare/grantableSkills.test.ts b/apps/server/src/services/agentShare/grantableSkills.test.ts
index a85cfafdfe1..c1b9337e20a 100644
--- a/apps/server/src/services/agentShare/grantableSkills.test.ts
+++ b/apps/server/src/services/agentShare/grantableSkills.test.ts
@@ -4,11 +4,14 @@ import { listShareGrantableSkills } from './grantableSkills';
const mocks = vi.hoisted(() => ({
getAgentVisibility: vi.fn(),
+ getUserSettings: vi.fn(),
listCatalog: vi.fn(),
userSkillScope: vi.fn(),
}));
-vi.mock('@lobechat/builtin-skills', () => ({ builtinSkills: [] }));
+vi.mock('@lobechat/builtin-skills', () => ({
+ builtinSkills: [{ description: 'LobeHub', identifier: 'lobehub', name: 'LobeHub' }],
+}));
// Constructor mocks must be `function`s: `new` on an arrow-function mock throws.
vi.mock('@/database/models/agentSkill', () => ({
AgentSkillModel: vi.fn(function () {
@@ -20,6 +23,11 @@ vi.mock('@/database/models/agent', () => ({
return { getAgentVisibility: mocks.getAgentVisibility };
}),
}));
+vi.mock('@/database/models/user', () => ({
+ UserModel: vi.fn(function () {
+ return { getUserSettings: mocks.getUserSettings };
+ }),
+}));
vi.mock('@/server/services/agentDocuments', () => ({
AgentDocumentsService: vi.fn(function () {
return { getAgentSkills: async () => [] };
@@ -70,4 +78,38 @@ describe('listShareGrantableSkills', () => {
expect(mocks.getAgentVisibility).toHaveBeenCalledWith('agent-1');
expect(mocks.userSkillScope).toHaveBeenCalledWith({}, 'owner', 'ws-1', 'public');
});
+
+ describe('legacy builtin skills', () => {
+ const legacyAgent = {
+ chatConfig: {},
+ createdAt: new Date('2026-11-01T00:00:00Z'),
+ plugins: [],
+ };
+
+ it('offers implicit builtin skills in the share picker', async () => {
+ mocks.getUserSettings.mockResolvedValue({});
+
+ const skills = await listShareGrantableSkills({
+ agentConfig: legacyAgent,
+ agentId: 'agent-1',
+ db: {} as any,
+ includeLegacyBuiltinSkills: true,
+ userId: 'owner',
+ });
+
+ expect(skills.map((skill) => skill.identifier)).toContain('lobehub');
+ });
+
+ it('does not auto-grant implicit builtin skills to a visitor run', async () => {
+ const skills = await listShareGrantableSkills({
+ agentConfig: legacyAgent,
+ agentId: 'agent-1',
+ db: {} as any,
+ userId: 'owner',
+ });
+
+ expect(skills.map((skill) => skill.identifier)).not.toContain('lobehub');
+ expect(mocks.getUserSettings).not.toHaveBeenCalled();
+ });
+ });
});
diff --git a/apps/server/src/services/agentShare/grantableSkills.ts b/apps/server/src/services/agentShare/grantableSkills.ts
index a59e7f4439a..97a816c85af 100644
--- a/apps/server/src/services/agentShare/grantableSkills.ts
+++ b/apps/server/src/services/agentShare/grantableSkills.ts
@@ -1,14 +1,26 @@
import { builtinSkills } from '@lobechat/builtin-skills';
+import {
+ resolveUninstalledBuiltinTools,
+ type UninstalledBuiltinToolsScope,
+} from '@lobechat/builtin-tools';
import { assembleSkillPool } from '@lobechat/mecha';
+import {
+ getImplicitBuiltinSkillIds,
+ getLegacyDisabledBuiltinSkillIds,
+ legacyBuiltinSkillIds,
+ type SkillDiscoveryChatConfig,
+} from '@lobechat/mecha/builtinSkillGate';
import {
type AgentPluginEntry,
getActivePluginIds,
getAutoPluginIds,
+ getBuiltinOverrides,
getDisabledPluginIds,
} from '@lobechat/types';
import { AgentModel } from '@/database/models/agent';
import { AgentSkillModel } from '@/database/models/agentSkill';
+import { UserModel } from '@/database/models/user';
import type { LobeChatDatabase } from '@/database/type';
import { AgentDocumentsService } from '@/server/services/agentDocuments';
import { UserSkillService } from '@/server/services/userSkill';
@@ -22,7 +34,8 @@ export interface ShareGrantableSkill {
interface GrantableSkillsInput {
agentConfig:
| {
- chatConfig?: { skillActivateMode?: 'auto' | 'manual' } | null;
+ chatConfig?: SkillDiscoveryChatConfig | null;
+ createdAt?: Date | string;
plugins?: AgentPluginEntry[] | null;
}
| null
@@ -35,10 +48,41 @@ interface GrantableSkillsInput {
*/
canExecuteOnDevice?: boolean;
db: LobeChatDatabase;
+ /**
+ * Apply the owner-run legacy builtin rules: implicit builtin skills for a
+ * pre-opt-in Agent, minus legacy library uninstalls. On for the share picker
+ * only. A visitor run assembles neither, so its automatic grants must not
+ * open a skill the Agent never explicitly turned on.
+ */
+ includeLegacyBuiltinSkills?: boolean;
userId: string;
workspaceId?: string;
}
+const resolveLegacyBuiltinSkills = async ({
+ agentConfig,
+ db,
+ userId,
+ workspaceId,
+}: Pick<GrantableSkillsInput, 'agentConfig' | 'db' | 'userId' | 'workspaceId'>) => {
+ const userSettings = await new UserModel(db, userId).getUserSettings().catch(() => null);
+ // Unknown settings fail closed: no legacy builtin is offered as installed.
+ const uninstalledBuiltinIds = userSettings
+ ? resolveUninstalledBuiltinTools(
+ userSettings.tool as UninstalledBuiltinToolsScope | undefined,
+ workspaceId,
+ )
+ : legacyBuiltinSkillIds;
+
+ return {
+ disabledIds: getLegacyDisabledBuiltinSkillIds(
+ uninstalledBuiltinIds,
+ getBuiltinOverrides(agentConfig?.plugins),
+ ),
+ implicitIds: getImplicitBuiltinSkillIds(agentConfig?.createdAt, agentConfig?.chatConfig),
+ };
+};
+
/**
* Skills this Agent could offer a visitor: the share settings skill picker's
* list, and the skills `autoGrantAgentTools` opens.
@@ -56,10 +100,9 @@ interface GrantableSkillsInput {
* The user's skill library is listed as a run lists it: its catalog without
* generated skills, and none at all for a workspace-public Agent.
*
- * Skills are NOT filtered to the agent's pinned set: a skill is on-demand by
- * default, so an unpinned skill is exactly the normal case. `manual` mode is
- * the one exception, and `assembleSkillPool` applies it from
- * `enabledPluginIds` on its own.
+ * Skills are opt-in per Agent (`auto` or legacy `pinned`). With
+ * `includeLegacyBuiltinSkills`, legacy Agents also keep their implicit builtin
+ * skills (minus legacy library uninstalls), as their owner's run assembles them.
*
* Reads the creator's whole skill catalog: callers must have authorized the
* Agent's share first.
@@ -69,11 +112,12 @@ export const listShareGrantableSkills = async ({
agentId,
canExecuteOnDevice = false,
db,
+ includeLegacyBuiltinSkills = false,
userId,
workspaceId,
}: GrantableSkillsInput): Promise<ShareGrantableSkill[]> => {
const plugins = agentConfig?.plugins ?? undefined;
- const [dbSkills, agentSkills, userSkills] = await Promise.all([
+ const [dbSkills, agentSkills, userSkills, legacyBuiltinSkills] = await Promise.all([
new AgentSkillModel(db, userId, workspaceId).findAll().then((result) => result.data),
// A bundle-less agent is the common case and throws nothing; a genuine
// failure here must not take the whole list down with it — the DB and
@@ -88,6 +132,9 @@ export const listShareGrantableSkills = async ({
? await new AgentModel(db, userId, workspaceId).getAgentVisibility(agentId)
: undefined,
).listCatalog({ includeGenerated: false }))(),
+ includeLegacyBuiltinSkills
+ ? resolveLegacyBuiltinSkills({ agentConfig, db, userId, workspaceId })
+ : undefined,
]);
const { skills } = assembleSkillPool(
@@ -111,8 +158,9 @@ export const listShareGrantableSkills = async ({
{
autoSkillIds: getAutoPluginIds(plugins),
canExecuteOnDevice,
- disabledIds: getDisabledPluginIds(plugins),
+ disabledIds: [...getDisabledPluginIds(plugins), ...(legacyBuiltinSkills?.disabledIds ?? [])],
enabledPluginIds: getActivePluginIds(plugins),
+ implicitBuiltinSkillIds: legacyBuiltinSkills?.implicitIds,
skillActivateMode: agentConfig?.chatConfig?.skillActivateMode,
},
);
diff --git a/apps/server/src/services/aiAgent/pipeline/toolDiscovery/index.ts b/apps/server/src/services/aiAgent/pipeline/toolDiscovery/index.ts
index 20af491520d..0d5d9f72412 100644
--- a/apps/server/src/services/aiAgent/pipeline/toolDiscovery/index.ts
+++ b/apps/server/src/services/aiAgent/pipeline/toolDiscovery/index.ts
@@ -34,7 +34,12 @@ import {
resolveInvocationToolIds,
} from '@lobechat/mecha';
import type { BuiltinToolResolveContext, FrozenCredentialFacts } from '@lobechat/types';
-import { getActivePluginIds, manifestBaseIdentifier, resolveToolMode } from '@lobechat/types';
+import {
+ getActivePluginIds,
+ getOptedInPluginIds,
+ manifestBaseIdentifier,
+ resolveToolMode,
+} from '@lobechat/types';
import debug from 'debug';
import { loadModels } from '@/business/client/model-bank/loadModels';
@@ -183,19 +188,24 @@ export const discoverTools = async (
let connectorManifests: ReturnType<typeof buildConnectorManifests> = [];
// `selectedToolIds` are the user's @-mention picks for this turn; merged in
- // (deduped) alongside the agent's pinned plugins and any internal
- // `additionalPluginIds` so a mentioned-but-not-pinned tool (e.g. a custom MCP
+ // (deduped) alongside the agent's configured plugins and any internal
+ // `additionalPluginIds` so a mentioned-but-not-enabled tool (e.g. a custom MCP
// connector) is both queried for manifests and enabled by the tools engine.
const isGoalTurn = isGoalPrompt(prompt);
+ const toolMode = resolveToolMode(agentConfig.chatConfig);
+ const configuredPluginIds =
+ toolMode === 'agent'
+ ? getActivePluginIds(agentConfig?.plugins)
+ : getOptedInPluginIds(agentConfig?.plugins);
let agentPlugins: string[] = exclusivePluginIds
? [...new Set(exclusivePluginIds)]
: isGoalTurn
? [GoalIdentifier]
: [
...new Set([
- // An agent that pinned the goal or dashboard tool before its
+ // An agent that enabled the goal or dashboard tool before its
// rename still carries the legacy id; resolve it to the current one.
- ...getActivePluginIds(agentConfig?.plugins).map((id) =>
+ ...configuredPluginIds.map((id) =>
isGoalIdentifier(id)
? GoalIdentifier
: isDashboardIdentifier(id)
@@ -225,9 +235,8 @@ export const discoverTools = async (
// Connected tools are discoverable by default in ordinary agent runs.
// An exact toolset (verify agent, goal supervisor) names
// its tools itself, so the agent's switches do not apply to it.
- const optedInIds = [...getActivePluginIds(agentConfig?.plugins), ...(ctx.autoSkillIds ?? [])];
- const discoverByDefault =
- resolveToolMode(agentConfig.chatConfig) === 'agent' && !evalConnectorSnapshots;
+ const optedInIds = [...getOptedInPluginIds(agentConfig?.plugins), ...(ctx.autoSkillIds ?? [])];
+ const discoverByDefault = toolMode === 'agent' && !evalConnectorSnapshots;
const connectorActivation =
exclusivePluginIds || isGoalTurn
? undefined
diff --git a/apps/server/src/services/toolExecution/serverRuntimes/__tests__/agentBuilder.test.ts b/apps/server/src/services/toolExecution/serverRuntimes/__tests__/agentBuilder.test.ts
index 64cd5cd5072..41e6cf4daac 100644
--- a/apps/server/src/services/toolExecution/serverRuntimes/__tests__/agentBuilder.test.ts
+++ b/apps/server/src/services/toolExecution/serverRuntimes/__tests__/agentBuilder.test.ts
@@ -179,7 +179,7 @@ describe('agentBuilderRuntime', () => {
});
describe('updateConfig - togglePlugin', () => {
- it('appends a new pinned entry when enabling an absent identifier', async () => {
+ it('appends a new auto entry when enabling an absent identifier', async () => {
mockGetAgentConfigById.mockResolvedValue({ id: 'agent-1', plugins: ['plugin-a'] });
mockFindById.mockResolvedValue({ identifier: 'plugin-b', manifest: { api: [] } });
@@ -192,11 +192,11 @@ describe('agentBuilderRuntime', () => {
expect(result.success).toBe(true);
expect(result.state).toMatchObject({ agentId: 'agent-1' });
expect(mockUpdateConfig).toHaveBeenCalledWith('agent-1', {
- plugins: ['plugin-a', { identifier: 'plugin-b', mode: 'pinned' }],
+ plugins: ['plugin-a', { identifier: 'plugin-b', mode: 'auto' }],
});
});
- it('flips an existing disabled object entry back to pinned in place, without duplicating it', async () => {
+ it('flips an existing disabled object entry back to auto in place, without duplicating it', async () => {
mockGetAgentConfigById.mockResolvedValue({
id: 'agent-1',
plugins: ['plugin-a', { identifier: 'plugin-b', mode: 'disabled' }],
@@ -212,11 +212,11 @@ describe('agentBuilderRuntime', () => {
expect(result.success).toBe(true);
expect(result.state).toMatchObject({ agentId: 'agent-1' });
expect(mockUpdateConfig).toHaveBeenCalledWith('agent-1', {
- plugins: ['plugin-a', { identifier: 'plugin-b', mode: 'pinned' }],
+ plugins: ['plugin-a', { identifier: 'plugin-b', mode: 'auto' }],
});
});
- it('disabling (enabled: false) reverts the entry to auto, removing it from the array', async () => {
+ it('disabling (enabled: false) writes an explicit disabled entry so the tool stays off in Agent mode', async () => {
mockGetAgentConfigById.mockResolvedValue({
id: 'agent-1',
plugins: ['plugin-a', 'plugin-b'],
@@ -230,7 +230,9 @@ describe('agentBuilderRuntime', () => {
expect(result.success).toBe(true);
expect(result.state).toMatchObject({ agentId: 'agent-1' });
- expect(mockUpdateConfig).toHaveBeenCalledWith('agent-1', { plugins: ['plugin-a'] });
+ expect(mockUpdateConfig).toHaveBeenCalledWith('agent-1', {
+ plugins: ['plugin-a', { identifier: 'plugin-b', mode: 'disabled' }],
+ });
});
// Vent msg_3TSVUmdD8G68gRPPKH: `tg_mcp` was reported enabled while the
@@ -271,7 +273,7 @@ describe('agentBuilderRuntime', () => {
expect(result.success).toBe(true);
expect(mockUpdateConfig).toHaveBeenCalledWith('agent-1', {
- plugins: [{ identifier: 'tg-mcp', mode: 'pinned' }],
+ plugins: [{ identifier: 'tg-mcp', mode: 'auto' }],
});
});
@@ -304,7 +306,7 @@ describe('agentBuilderRuntime', () => {
expect(mockUpdateConfig).not.toHaveBeenCalled();
});
- it('still disables an id that no longer resolves, so stale entries can be removed', async () => {
+ it('still disables an id that no longer resolves, so stale entries can be turned off', async () => {
mockGetAgentConfigById.mockResolvedValue({ id: 'agent-1', plugins: ['tg_mcp'] });
const result = await createRuntime().updateConfig(
@@ -313,7 +315,9 @@ describe('agentBuilderRuntime', () => {
);
expect(result.success).toBe(true);
- expect(mockUpdateConfig).toHaveBeenCalledWith('agent-1', { plugins: [] });
+ expect(mockUpdateConfig).toHaveBeenCalledWith('agent-1', {
+ plugins: [{ identifier: 'tg_mcp', mode: 'disabled' }],
+ });
});
it('returns the invocation target for a successful no-op', async () => {
@@ -420,7 +424,7 @@ describe('agentBuilderRuntime', () => {
});
describe('installPlugin', () => {
- it('flips an existing disabled builtin-tool entry back to pinned, without duplicating it', async () => {
+ it('flips an existing disabled builtin-tool entry back to auto, without duplicating it', async () => {
mockGetAgentConfigById.mockResolvedValue({
id: 'agent-1',
plugins: [{ identifier: 'lobe-web-browsing', mode: 'disabled' }],
@@ -435,11 +439,29 @@ describe('agentBuilderRuntime', () => {
expect(result.success).toBe(true);
expect(result.state).toMatchObject({ agentId: 'agent-1' });
expect(mockUpdateConfig).toHaveBeenCalledWith('agent-1', {
- plugins: [{ identifier: 'lobe-web-browsing', mode: 'pinned' }],
+ plugins: [{ identifier: 'lobe-web-browsing', mode: 'auto' }],
+ });
+ });
+
+ it('writes builtinOverride when enabling an on-demand builtin tool', async () => {
+ mockGetAgentConfigById.mockResolvedValue({
+ id: 'agent-1',
+ plugins: [],
+ });
+
+ const runtime = createRuntime();
+ const result = await runtime.installPlugin(
+ { identifier: 'lobe-calculator', source: 'official' },
+ { editingAgentId: 'agent-1', toolManifestMap: {} },
+ );
+
+ expect(result.success).toBe(true);
+ expect(mockUpdateConfig).toHaveBeenCalledWith('agent-1', {
+ plugins: [{ builtinOverride: true, identifier: 'lobe-calculator', mode: 'auto' }],
});
});
- it('is a no-op write when the builtin-tool identifier is already pinned', async () => {
+ it('is a no-op write when the builtin-tool identifier is already enabled', async () => {
mockGetAgentConfigById.mockResolvedValue({
id: 'agent-1',
plugins: ['lobe-web-browsing'],
@@ -456,7 +478,7 @@ describe('agentBuilderRuntime', () => {
expect(mockUpdateConfig).not.toHaveBeenCalled();
});
- it('flips an existing disabled market-plugin entry back to pinned, without duplicating it', async () => {
+ it('flips an existing disabled market-plugin entry back to auto, without duplicating it', async () => {
mockGetAgentConfigById.mockResolvedValue({
id: 'agent-1',
plugins: [{ identifier: 'market-plugin', mode: 'disabled' }],
@@ -472,7 +494,7 @@ describe('agentBuilderRuntime', () => {
expect(result.success).toBe(true);
expect(result.state).toMatchObject({ agentId: 'agent-1' });
expect(mockUpdateConfig).toHaveBeenCalledWith('agent-1', {
- plugins: [{ identifier: 'market-plugin', mode: 'pinned' }],
+ plugins: [{ identifier: 'market-plugin', mode: 'auto' }],
});
});
});
@@ -537,7 +559,7 @@ describe('agentBuilderRuntime', () => {
expect(mockCreatePlugin).not.toHaveBeenCalled();
expect(mockUpdatePlugin).not.toHaveBeenCalled();
expect(mockUpdateConfig).toHaveBeenCalledWith('agent-1', {
- plugins: [{ identifier: 'ads-mcp', mode: 'pinned' }],
+ plugins: [{ identifier: 'ads-mcp', mode: 'auto' }],
});
});
@@ -594,7 +616,7 @@ describe('agentBuilderRuntime', () => {
expect(result.success).toBe(true);
expect(result.content).not.toContain('next run');
expect(mockUpdateConfig).toHaveBeenCalledWith('agent-1', {
- plugins: [{ identifier: 'ads-mcp', mode: 'pinned' }],
+ plugins: [{ identifier: 'ads-mcp', mode: 'auto' }],
});
});
diff --git a/apps/server/src/services/toolExecution/serverRuntimes/__tests__/agentManagement.test.ts b/apps/server/src/services/toolExecution/serverRuntimes/__tests__/agentManagement.test.ts
index 1fb0534efde..8199b945f06 100644
--- a/apps/server/src/services/toolExecution/serverRuntimes/__tests__/agentManagement.test.ts
+++ b/apps/server/src/services/toolExecution/serverRuntimes/__tests__/agentManagement.test.ts
@@ -657,7 +657,7 @@ describe('agentManagementRuntime', () => {
expect(mockCreatePlugin).not.toHaveBeenCalled();
expect(mockUpdatePlugin).not.toHaveBeenCalled();
expect(mockUpdateConfig).toHaveBeenCalledWith('agent-1', {
- plugins: ['plugin-a', { identifier: 'plugin-b', mode: 'pinned' }],
+ plugins: ['plugin-a', { identifier: 'plugin-b', mode: 'auto' }],
});
});
@@ -749,7 +749,7 @@ describe('agentManagementRuntime', () => {
expect(result.content).not.toContain('next run');
expect(mockCreatePlugin).not.toHaveBeenCalled();
expect(mockUpdateConfig).toHaveBeenCalledWith('agent-1', {
- plugins: [{ identifier: 'lobe-web-browsing', mode: 'pinned' }],
+ plugins: [{ identifier: 'lobe-web-browsing', mode: 'auto' }],
});
});
@@ -765,7 +765,7 @@ describe('agentManagementRuntime', () => {
expect(result.success).toBe(true);
expect(mockUpdateConfig).toHaveBeenCalledWith('agent-1', {
- plugins: ['plugin-a', { identifier: 'plugin-b', mode: 'pinned' }],
+ plugins: ['plugin-a', { identifier: 'plugin-b', mode: 'auto' }],
});
});
diff --git a/apps/server/src/services/toolExecution/serverRuntimes/agentBuilder.ts b/apps/server/src/services/toolExecution/serverRuntimes/agentBuilder.ts
index ca2886720c0..279723c77cc 100644
--- a/apps/server/src/services/toolExecution/serverRuntimes/agentBuilder.ts
+++ b/apps/server/src/services/toolExecution/serverRuntimes/agentBuilder.ts
@@ -7,10 +7,11 @@ import {
type UpdateAgentConfigParams,
type UpdatePromptParams,
} from '@lobechat/builtin-tool-agent-builder';
-import { builtinTools } from '@lobechat/builtin-tools';
+import { builtinTools, isOnDemandBuiltinTool } from '@lobechat/builtin-tools';
import { BRANDING_PROVIDER } from '@lobechat/business-const';
+import { legacyBuiltinSkillIds } from '@lobechat/mecha/builtinSkillGate';
import { modelsResultsPrompt } from '@lobechat/prompts';
-import { getPluginMode, upsertPluginMode } from '@lobechat/types';
+import { parsePluginEntry, setBuiltinPluginMode, upsertConnectorEnabled } from '@lobechat/types';
import { getHiddenBuiltinModelsForUser } from '@/business/server/aiProvider';
import { AgentModel } from '@/database/models/agent';
@@ -199,13 +200,16 @@ export const agentBuilderRuntime: ServerRuntimeRegistration = {
if (params.togglePlugin) {
const { pluginId, enabled } = params.togglePlugin;
- const isEnabled = getPluginMode(agent.plugins ?? undefined, pluginId) === 'pinned';
+ const existing = agent.plugins?.find(
+ (entry) => parsePluginEntry(entry).identifier === pluginId,
+ );
+ const isEnabled = existing ? parsePluginEntry(existing).mode !== 'disabled' : false;
const shouldEnable = enabled !== undefined ? enabled : !isEnabled;
- // Enabling pins the id into the agent's config; an id that resolves
- // to no loadable tool would be reported as enabled yet never load.
+ // Enabling writes an opt-in entry; an id that resolves to no
+ // loadable tool would be reported as enabled yet never load.
// Checked before any write so a rejected call changes nothing.
- // Disabling stays unvalidated so stale entries can always be removed.
+ // Disabling stays unvalidated so stale entries can always be turned off.
if (shouldEnable) {
const resolution = await resolvePluginIdentifier(
pluginId,
@@ -216,14 +220,14 @@ export const agentBuilderRuntime: ServerRuntimeRegistration = {
return unresolvablePluginResult(pluginId, resolution);
}
- // upsertPluginMode preserves an already-matching entry as-is and
- // flips a disabled entry back to pinned in place, instead of
- // blindly pushing a duplicate bare-string identifier.
- const newPlugins = upsertPluginMode(
- agent.plugins ?? undefined,
- pluginId,
- shouldEnable ? 'pinned' : 'auto',
- );
+ const newPlugins =
+ isOnDemandBuiltinTool(pluginId) || legacyBuiltinSkillIds.includes(pluginId)
+ ? setBuiltinPluginMode(
+ agent.plugins ?? undefined,
+ pluginId,
+ shouldEnable ? 'auto' : 'disabled',
+ )
+ : upsertConnectorEnabled(agent.plugins ?? undefined, pluginId, shouldEnable);
finalConfig = { ...finalConfig, plugins: newPlugins };
updatedParts.push(`plugin ${pluginId} ${shouldEnable ? 'enabled' : 'disabled'}`);
@@ -315,13 +319,25 @@ export const agentBuilderRuntime: ServerRuntimeRegistration = {
const agent = await agentModel.getAgentConfigById(agentId);
if (!agent) return { content: `Agent "${agentId}" not found.`, success: false };
- if (getPluginMode(agent.plugins ?? undefined, identifier) !== 'pinned') {
+ const existing = agent.plugins?.find(
+ (entry) => parsePluginEntry(entry).identifier === identifier,
+ );
+ const needsBuiltinOverride =
+ isOnDemandBuiltinTool(identifier) &&
+ (!existing || typeof existing === 'string' || !existing.builtinOverride);
+ if (
+ !existing ||
+ parsePluginEntry(existing).mode === 'disabled' ||
+ needsBuiltinOverride
+ ) {
await agentModel.updateConfig(agentId, {
- plugins: upsertPluginMode(
- agent.plugins ?? undefined,
- identifier,
- 'pinned',
- ) as unknown as string[],
+ plugins: (isOnDemandBuiltinTool(identifier)
+ ? setBuiltinPluginMode(agent.plugins ?? undefined, identifier, 'auto')
+ : upsertConnectorEnabled(
+ agent.plugins ?? undefined,
+ identifier,
+ true,
+ )) as unknown as string[],
});
}
return {
@@ -357,12 +373,15 @@ export const agentBuilderRuntime: ServerRuntimeRegistration = {
if (resolution.status !== 'loadable')
return unresolvablePluginResult(identifier, resolution);
- if (getPluginMode(agent.plugins ?? undefined, identifier) !== 'pinned') {
+ const existing = agent.plugins?.find(
+ (entry) => parsePluginEntry(entry).identifier === identifier,
+ );
+ if (!existing || parsePluginEntry(existing).mode === 'disabled') {
await agentModel.updateConfig(agentId, {
- plugins: upsertPluginMode(
+ plugins: upsertConnectorEnabled(
agent.plugins ?? undefined,
identifier,
- 'pinned',
+ true,
) as unknown as string[],
});
}
diff --git a/apps/server/src/services/toolExecution/serverRuntimes/agentManagement.ts b/apps/server/src/services/toolExecution/serverRuntimes/agentManagement.ts
index 2b8773edc76..0fd22056f30 100644
--- a/apps/server/src/services/toolExecution/serverRuntimes/agentManagement.ts
+++ b/apps/server/src/services/toolExecution/serverRuntimes/agentManagement.ts
@@ -12,12 +12,13 @@ import {
type UpdatePromptParams,
} from '@lobechat/builtin-tool-agent-management';
import { buildBackgroundSubAgentReceipt } from '@lobechat/builtin-tool-lobe-agent';
+import { isOnDemandBuiltinTool } from '@lobechat/builtin-tools';
import { searchAgentsResultsPrompt } from '@lobechat/prompts';
import {
- getPluginMode,
type HeterogeneousProviderConfig,
parsePluginEntry,
- upsertPluginMode,
+ setBuiltinPluginMode,
+ upsertConnectorEnabled,
} from '@lobechat/types';
import debug from 'debug';
@@ -339,16 +340,21 @@ export const agentManagementRuntime: ServerRuntimeRegistration = {
if (resolution.status !== 'loadable')
return unresolvablePluginResult(identifier, resolution);
- // upsertPluginMode preserves an already-pinned entry (string or
- // object) as-is and flips a disabled entry back to pinned in place,
- // instead of blindly pushing a duplicate bare-string identifier.
- if (getPluginMode(agent.plugins ?? undefined, identifier) !== 'pinned') {
+ const existing = agent.plugins?.find(
+ (entry) => parsePluginEntry(entry).identifier === identifier,
+ );
+ const needsBuiltinOverride =
+ isOnDemandBuiltinTool(identifier) &&
+ (!existing || typeof existing === 'string' || !existing.builtinOverride);
+ if (!existing || parsePluginEntry(existing).mode === 'disabled' || needsBuiltinOverride) {
await agentModel.updateConfig(agentId, {
- plugins: upsertPluginMode(
- agent.plugins ?? undefined,
- identifier,
- 'pinned',
- ) as unknown as string[],
+ plugins: (isOnDemandBuiltinTool(identifier)
+ ? setBuiltinPluginMode(agent.plugins ?? undefined, identifier, 'auto')
+ : upsertConnectorEnabled(
+ agent.plugins ?? undefined,
+ identifier,
+ true,
+ )) as unknown as string[],
});
}
diff --git a/locales/ar/setting.json b/locales/ar/setting.json
index 4d5818f91b3..20f7ebc218e 100644
--- a/locales/ar/setting.json
+++ b/locales/ar/setting.json
@@ -2110,7 +2110,6 @@
"tools.builtins.lobe-group-management.description": "تنظيم وإدارة المحادثات الجماعية لوكلاء متعددين",
"tools.builtins.lobe-group-management.title": "إدارة المجموعات",
"tools.builtins.lobe-image-generation.description": "إنشاء الصور من خلال مزودي LobeHub عندما لا يحتوي نموذج الدردشة الحالي على إخراج صور أصلي.",
- "tools.builtins.lobe-image-generation.readme": "إنشاء الصور بشكل اختياري للنماذج التي لا تحتوي على إخراج صور أصلي. قم بتثبيت هذه الأداة لتمكينها في وضع الدردشة أو الوكيل؛ اتركها غير مثبتة لتجنب تكلفة مخطط الأداة.",
"tools.builtins.lobe-image-generation.title": "إنشاء الصور",
"tools.builtins.lobe-knowledge-base.description": "البحث في المستندات المرفوعة والمعرفة المتخصصة عبر البحث الدلالي — للرجوع الدائم والقابل لإعادة الاستخدام",
"tools.builtins.lobe-knowledge-base.title": "قاعدة المعرفة",
@@ -2141,7 +2140,6 @@
"tools.builtins.lobe-user-memory.readme": "أنشئ قاعدة معرفة مخصصة عنك. تذكّر التفضيلات، وتتبع الأنشطة والتجارب، واحتفظ بمعلومات الهوية، واسترجع السياق المناسب في المحادثات المستقبلية.",
"tools.builtins.lobe-user-memory.title": "الذاكرة",
"tools.builtins.lobe-video-generation.description": "إنشاء مقاطع فيديو من خلال مزودي LobeHub من النصوص أو الصور المرجعية.",
- "tools.builtins.lobe-video-generation.readme": "إنشاء الفيديو اختياري. قم بتثبيت هذه الأداة لتمكينها في وضع الدردشة أو الوكيل؛ اتركها غير مثبتة لتجنب تكلفة مخطط الأداة.",
"tools.builtins.lobe-video-generation.title": "إنشاء الفيديو",
"tools.builtins.lobe-web-browsing.description": "البحث في الويب للحصول على معلومات حديثة وزحف الصفحات لاستخراج المحتوى. يدعم عدة محركات بحث، فئات، ونطاقات زمنية.",
"tools.builtins.lobe-web-browsing.readme": "البحث في الويب وجمع المعلومات الحديثة وزحف الصفحات لاستخراج المحتوى. يدعم محركات بحث متعددة، فئات، ونطاقات زمنية للبحث الشامل.",
diff --git a/locales/bg-BG/setting.json b/locales/bg-BG/setting.json
index 7dbf5bbc79e..f597f3a568f 100644
--- a/locales/bg-BG/setting.json
+++ b/locales/bg-BG/setting.json
@@ -2110,7 +2110,6 @@
"tools.builtins.lobe-group-management.description": "Оркестрирайте и управлявайте разговори в групи от агенти",
"tools.builtins.lobe-group-management.title": "Групово управление",
"tools.builtins.lobe-image-generation.description": "Генерирайте изображения чрез доставчици на LobeHub, когато текущият модел за чат няма вграден изход за изображения.",
- "tools.builtins.lobe-image-generation.readme": "Генериране на изображения по избор за модели без вграден изход за изображения. Закачете този инструмент, за да го активирате в режим на чат или агент; оставете го незакрепен, за да избегнете разходите за схемата на инструмента.",
"tools.builtins.lobe-image-generation.title": "Генериране на изображения",
"tools.builtins.lobe-knowledge-base.description": "Търсене в качени документи и специализирани знания чрез семантично векторно търсене — за постоянно и многократно използване",
"tools.builtins.lobe-knowledge-base.title": "База знания",
@@ -2141,7 +2140,6 @@
"tools.builtins.lobe-user-memory.readme": "Изградете персонализирана база знания за себе си. Запомняйте предпочитания, следете дейности и преживявания, съхранявайте информация за идентичност и извличайте релевантен контекст в бъдещи разговори.",
"tools.builtins.lobe-user-memory.title": "Памет",
"tools.builtins.lobe-video-generation.description": "Генерирайте видеоклипове чрез доставчици на LobeHub от текст или референтни изображения.",
- "tools.builtins.lobe-video-generation.readme": "Генериране на видеоклипове с опция за включване. Закачете този инструмент, за да го активирате в режим на чат или агент; оставете го незакрепен, за да избегнете разходите за схемата на инструмента.",
"tools.builtins.lobe-video-generation.title": "Генериране на видеоклипове",
"tools.builtins.lobe-web-browsing.description": "Търсене в уеб пространството за актуална информация и обхождане на страници за извличане на съдържание. Поддържа множество търсачки, категории и времеви диапазони.",
"tools.builtins.lobe-web-browsing.readme": "Търсете актуална информация в мрежата и обхождайте уеб страници за извличане на съдържание. Поддръжка на множество търсачки, категории и времеви диапазони за цялостно изследване.",
diff --git a/locales/de-DE/setting.json b/locales/de-DE/setting.json
index cd9b60fae84..3d0644e4419 100644
--- a/locales/de-DE/setting.json
+++ b/locales/de-DE/setting.json
@@ -2110,7 +2110,6 @@
"tools.builtins.lobe-group-management.description": "Unterhaltungen von Multi‑Agenten‑Gruppen orchestrieren und verwalten",
"tools.builtins.lobe-group-management.title": "Gruppenverwaltung",
"tools.builtins.lobe-image-generation.description": "Generieren Sie Bilder über LobeHub-Anbieter, wenn das aktuelle Chat-Modell keine native Bildausgabe hat.",
- "tools.builtins.lobe-image-generation.readme": "Opt-in-Bilderzeugung für Modelle ohne native Bildausgabe. Pinnen Sie dieses Tool, um es im Chat- oder Agentenmodus zu aktivieren; lassen Sie es unfixiert, um die Tool-Schema-Kosten zu vermeiden.",
"tools.builtins.lobe-image-generation.title": "Bilderzeugung",
"tools.builtins.lobe-knowledge-base.description": "Hochgeladene Dokumente und Domainwissen per semantischer Vektorsuche durchsuchen – für persistente, wiederverwendbare Referenzen",
"tools.builtins.lobe-knowledge-base.title": "Wissensdatenbank",
@@ -2141,7 +2140,6 @@
"tools.builtins.lobe-user-memory.readme": "Erstellen Sie eine personalisierte Wissensdatenbank über sich selbst. Merken Sie sich Vorlieben, verfolgen Sie Aktivitäten und Erfahrungen, speichern Sie Identitätsinformationen und erinnern Sie sich an relevante Kontexte in zukünftigen Gesprächen.",
"tools.builtins.lobe-user-memory.title": "Gedächtnis",
"tools.builtins.lobe-video-generation.description": "Erstellen Sie Videos über LobeHub-Anbieter aus Text oder Referenzbildern.",
- "tools.builtins.lobe-video-generation.readme": "Opt-in-Videoerstellung. Heften Sie dieses Werkzeug an, um es im Chat- oder Agentenmodus zu aktivieren; lassen Sie es ungepinnt, um die Werkzeug-Schema-Kosten zu vermeiden.",
"tools.builtins.lobe-video-generation.title": "Videoerstellung",
"tools.builtins.lobe-web-browsing.description": "Web durchsuchen, um aktuelle Informationen zu finden, und Webseiten crawlen, um Inhalte zu extrahieren. Unterstützt mehrere Suchmaschinen, Kategorien und Zeiträume.",
"tools.builtins.lobe-web-browsing.readme": "Web nach aktuellen Informationen durchsuchen und Webseiten crawlen, um Inhalte zu extrahieren. Unterstützt mehrere Suchmaschinen, Kategorien und Zeiträume für umfassende Recherche.",
diff --git a/locales/en-US/setting.json b/locales/en-US/setting.json
index fe9336d0bb2..5913e7eeed5 100644
--- a/locales/en-US/setting.json
+++ b/locales/en-US/setting.json
@@ -2523,14 +2523,6 @@
"taskLabels.tabs.agent": "Agent labels",
"taskLabels.tabs.task": "Task labels",
"taskLabels.usage": "{{count}} tasks",
- "tools.activation.action.auto": "Auto",
- "tools.activation.action.pin": "Pin",
- "tools.activation.auto": "Auto",
- "tools.activation.auto.desc": "Smart",
- "tools.activation.disabled.desc": "Turned Off",
- "tools.activation.fixed.hint": "Always on — managed by the app and can’t be turned off",
- "tools.activation.pinned": "Pinned",
- "tools.activation.pinned.desc": "Always On",
"tools.add": "Add Skill",
"tools.builtins.builtin-dashboard.description": "Build live monitoring widgets from sandboxed scripts, preview them with real data and put them on dashboards",
"tools.builtins.builtin-dashboard.title": "Dashboards",
@@ -2575,7 +2567,7 @@
"tools.builtins.lobe-group-management.description": "Orchestrate and manage multi-agent group conversations",
"tools.builtins.lobe-group-management.title": "Group Management",
"tools.builtins.lobe-image-generation.description": "Generate images through LobeHub providers when the current chat model has no native image output.",
- "tools.builtins.lobe-image-generation.readme": "Opt-in image generation for models without native image output. Pin this tool to enable it in chat or agent mode; leave unpinned to avoid the tool schema cost.",
+ "tools.builtins.lobe-image-generation.readme": "Opt-in image generation for models without native image output. Enable this tool to use it in chat or agent mode; disable it to avoid exposing the tool.",
"tools.builtins.lobe-image-generation.title": "Image Generation",
"tools.builtins.lobe-knowledge-base.description": "Find, browse, and read your uploaded files, and search organized knowledge bases via semantic vector search",
"tools.builtins.lobe-knowledge-base.title": "Knowledge Base",
@@ -2606,7 +2598,7 @@
"tools.builtins.lobe-user-memory.readme": "Build a personalized knowledge base about you. Remember preferences, track activities and experiences, store identity information, and recall relevant context in future conversations.",
"tools.builtins.lobe-user-memory.title": "Memory",
"tools.builtins.lobe-video-generation.description": "Generate videos through LobeHub providers from text or reference images.",
- "tools.builtins.lobe-video-generation.readme": "Opt-in video generation. Pin this tool to enable it in chat or agent mode; leave unpinned to avoid the tool schema cost.",
+ "tools.builtins.lobe-video-generation.readme": "Opt-in video generation. Enable this tool to use it in chat or agent mode; disable it to avoid exposing the tool.",
"tools.builtins.lobe-video-generation.title": "Video Generation",
"tools.builtins.lobe-web-browsing.description": "Search the web for current information and crawl web pages to extract content. Supports multiple search engines, categories, and time ranges.",
"tools.builtins.lobe-web-browsing.readme": "Search the web for current information and crawl web pages to extract content. Supports multiple search engines, categories, and time ranges for comprehensive research.",
@@ -2752,10 +2744,6 @@
"tools.privateConnector.tag": "Private",
"tools.privateConnector.tooltip": "Your private connector: only you can see it, and only your private agents load it.",
"tools.search": "Search skills...",
- "tools.skillActivateMode.auto.desc": "AI can autonomously activate tools, run skills, and install new skills from the store",
- "tools.skillActivateMode.auto.title": "Auto",
- "tools.skillActivateMode.manual.desc": "Only user-selected tools and skills are available to AI",
- "tools.skillActivateMode.manual.title": "Manual",
"tools.skillActivateMode.title": "Activate Mode",
"tools.tabs.all": "All",
"tools.tabs.installed": "Enabled",
diff --git a/locales/es-ES/setting.json b/locales/es-ES/setting.json
index 5be0966bf90..ace57f38ecd 100644
--- a/locales/es-ES/setting.json
+++ b/locales/es-ES/setting.json
@@ -2110,7 +2110,6 @@
"tools.builtins.lobe-group-management.description": "Orquesta y gestiona conversaciones de grupos multiagente",
"tools.builtins.lobe-group-management.title": "Gestión de Grupos",
"tools.builtins.lobe-image-generation.description": "Genera imágenes a través de proveedores de LobeHub cuando el modelo de chat actual no tiene salida de imagen nativa.",
- "tools.builtins.lobe-image-generation.readme": "Generación de imágenes opcional para modelos sin salida de imagen nativa. Fija esta herramienta para habilitarla en el chat o en el modo agente; déjala sin fijar para evitar el costo del esquema de la herramienta.",
"tools.builtins.lobe-image-generation.title": "Generación de Imágenes",
"tools.builtins.lobe-knowledge-base.description": "Busca documentos cargados y conocimiento de dominio mediante búsqueda semántica vectorial — para referencia persistente y reutilizable",
"tools.builtins.lobe-knowledge-base.title": "Base de Conocimiento",
@@ -2141,7 +2140,6 @@
"tools.builtins.lobe-user-memory.readme": "Construye una base de conocimiento personalizada sobre ti. Recuerda preferencias, registra actividades y experiencias, almacena información de identidad y recupera contexto relevante en futuras conversaciones.",
"tools.builtins.lobe-user-memory.title": "Memoria",
"tools.builtins.lobe-video-generation.description": "Genera videos a través de proveedores de LobeHub a partir de texto o imágenes de referencia.",
- "tools.builtins.lobe-video-generation.readme": "Generación de videos opcional. Fija esta herramienta para habilitarla en el chat o en el modo agente; déjala sin fijar para evitar el costo del esquema de la herramienta.",
"tools.builtins.lobe-video-generation.title": "Generación de Videos",
"tools.builtins.lobe-web-browsing.description": "Busca en la web información actual y rastrea páginas web para extraer contenido. Compatible con múltiples motores de búsqueda, categorías y rangos de tiempo.",
"tools.builtins.lobe-web-browsing.readme": "Busca en la web información actual y rastrea páginas web para extraer contenido. Admite múltiples motores de búsqueda, categorías y rangos de tiempo para una investigación completa.",
diff --git a/locales/fa-IR/setting.json b/locales/fa-IR/setting.json
index b171e510cd8..1f6a8b13484 100644
--- a/locales/fa-IR/setting.json
+++ b/locales/fa-IR/setting.json
@@ -2110,7 +2110,6 @@
"tools.builtins.lobe-group-management.description": "هماهنگ‌سازی و مدیریت گفتگوهای گروه‌های چندعاملی",
"tools.builtins.lobe-group-management.title": "مدیریت گروه",
"tools.builtins.lobe-image-generation.description": "تولید تصاویر از طریق ارائه‌دهندگان LobeHub زمانی که مدل چت فعلی خروجی تصویری بومی ندارد.",
- "tools.builtins.lobe-image-generation.readme": "تولید تصویر اختیاری برای مدل‌هایی که خروجی تصویری بومی ندارند. این ابزار را برای فعال‌سازی در حالت چت یا عامل پین کنید؛ برای جلوگیری از هزینه ساختار ابزار، آن را پین نکنید.",
"tools.builtins.lobe-image-generation.title": "تولید تصویر",
"tools.builtins.lobe-knowledge-base.description": "جستجوی اسناد بارگذاری‌شده و دانش حوزه‌ای از طریق جستجوی برداری معنایی — برای مرجع دائمی و قابل استفاده مجدد",
"tools.builtins.lobe-knowledge-base.title": "پایگاه دانش",
@@ -2141,7 +2140,6 @@
"tools.builtins.lobe-user-memory.readme": "پایگاه دانشی شخصی درباره خودتان بسازید. ترجیحات را به خاطر بسپارید، فعالیت‌ها و تجربیات را پیگیری کنید، اطلاعات هویتی را ذخیره کرده و در گفتگوهای آینده زمینه مرتبط را به یاد آورید.",
"tools.builtins.lobe-user-memory.title": "حافظه",
"tools.builtins.lobe-video-generation.description": "تولید ویدیو از طریق ارائه‌دهندگان LobeHub از متن یا تصاویر مرجع.",
- "tools.builtins.lobe-video-generation.readme": "تولید ویدیو با رضایت. این ابزار را پین کنید تا در حالت چت یا عامل فعال شود؛ بدون پین کردن، هزینه طرح ابزار را اجتناب کنید.",
"tools.builtins.lobe-video-generation.title": "تولید ویدیو",
"tools.builtins.lobe-web-browsing.description": "جستجوی وب برای اطلاعات به‌روز و خزش صفحات وب برای استخراج محتوا. پشتیبانی از چندین موتور جستجو، دسته‌بندی‌ها و بازه‌های زمانی.",
"tools.builtins.lobe-web-browsing.readme": "جستجوی وب برای اطلاعات به‌روز و خزش صفحات وب برای استخراج محتوا. پشتیبانی از چندین موتور جستجو، دسته‌بندی‌ها و بازه‌های زمانی برای تحقیقات جامع.",
diff --git a/locales/fr-FR/setting.json b/locales/fr-FR/setting.json
index c5da536b590..5dc1bbc4eed 100644
--- a/locales/fr-FR/setting.json
+++ b/locales/fr-FR/setting.json
@@ -2110,7 +2110,6 @@
"tools.builtins.lobe-group-management.description": "Orchestrer et gérer les conversations de groupes multi-agents",
"tools.builtins.lobe-group-management.title": "Gestion de Groupe",
"tools.builtins.lobe-image-generation.description": "Générer des images via les fournisseurs LobeHub lorsque le modèle de chat actuel n'a pas de sortie d'image native.",
- "tools.builtins.lobe-image-generation.readme": "Génération d'images en option pour les modèles sans sortie d'image native. Épinglez cet outil pour l'activer en mode chat ou agent ; laissez-le non épinglé pour éviter le coût du schéma de l'outil.",
"tools.builtins.lobe-image-generation.title": "Génération d'images",
"tools.builtins.lobe-knowledge-base.description": "Rechercher dans les documents importés et la base de connaissances via la recherche vectorielle sémantique — pour une référence persistante et réutilisable",
"tools.builtins.lobe-knowledge-base.title": "Base de Connaissances",
@@ -2141,7 +2140,6 @@
"tools.builtins.lobe-user-memory.readme": "Créez une base de connaissances personnalisée à votre sujet. Mémorisez vos préférences, suivez vos activités et expériences, stockez des informations d'identité et retrouvez le contexte pertinent lors de futures conversations.",
"tools.builtins.lobe-user-memory.title": "Mémoire",
"tools.builtins.lobe-video-generation.description": "Générez des vidéos via les fournisseurs LobeHub à partir de texte ou d'images de référence.",
- "tools.builtins.lobe-video-generation.readme": "Génération de vidéos sur inscription. Épinglez cet outil pour l'activer en mode chat ou agent ; laissez-le non épinglé pour éviter le coût du schéma de l'outil.",
"tools.builtins.lobe-video-generation.title": "Génération de vidéos",
"tools.builtins.lobe-web-browsing.description": "Rechercher des informations à jour sur le web et explorer des pages pour en extraire du contenu. Prend en charge plusieurs moteurs de recherche, catégories et plages temporelles.",
"tools.builtins.lobe-web-browsing.readme": "Rechercher des informations à jour sur le web et explorer des pages pour en extraire du contenu. Prise en charge de plusieurs moteurs de recherche, catégories et plages temporelles pour une recherche complète.",
diff --git a/locales/it-IT/setting.json b/locales/it-IT/setting.json
index b5d479a75e0..f884c125ea7 100644
--- a/locales/it-IT/setting.json
+++ b/locales/it-IT/setting.json
@@ -2110,7 +2110,6 @@
"tools.builtins.lobe-group-management.description": "Organizza e gestisci conversazioni di gruppi multi‑agente",
"tools.builtins.lobe-group-management.title": "Gestione Gruppo",
"tools.builtins.lobe-image-generation.description": "Genera immagini tramite i provider LobeHub quando il modello di chat corrente non ha un output di immagini nativo.",
- "tools.builtins.lobe-image-generation.readme": "Generazione di immagini opzionale per modelli senza output di immagini nativo. Fissa questo strumento per abilitarlo in modalità chat o agente; lascialo non fissato per evitare il costo dello schema dello strumento.",
"tools.builtins.lobe-image-generation.title": "Generazione di Immagini",
"tools.builtins.lobe-knowledge-base.description": "Cerca documenti caricati e conoscenze di dominio tramite ricerca vettoriale semantica — per riferimenti persistenti e riutilizzabili",
"tools.builtins.lobe-knowledge-base.title": "Base di Conoscenza",
@@ -2141,7 +2140,6 @@
"tools.builtins.lobe-user-memory.readme": "Costruisci una base di conoscenza personalizzata su di te. Ricorda preferenze, traccia attività ed esperienze, memorizza informazioni sull'identità e richiama contesti rilevanti nelle conversazioni future.",
"tools.builtins.lobe-user-memory.title": "Memoria",
"tools.builtins.lobe-video-generation.description": "Genera video tramite i provider di LobeHub da testo o immagini di riferimento.",
- "tools.builtins.lobe-video-generation.readme": "Generazione video opzionale. Fissa questo strumento per abilitarlo in modalità chat o agente; lascialo non fissato per evitare il costo dello schema dello strumento.",
"tools.builtins.lobe-video-generation.title": "Generazione Video",
"tools.builtins.lobe-web-browsing.description": "Cerca informazioni aggiornate sul web ed esplora pagine per estrarre contenuti. Supporta più motori di ricerca, categorie e intervalli temporali.",
"tools.builtins.lobe-web-browsing.readme": "Cerca informazioni aggiornate sul web ed esplora pagine per estrarre contenuti. Supporta diversi motori di ricerca, categorie e intervalli temporali per ricerche approfondite.",
diff --git a/locales/ja-JP/setting.json b/locales/ja-JP/setting.json
index b0c75293465..e552a8b4d25 100644
--- a/locales/ja-JP/setting.json
+++ b/locales/ja-JP/setting.json
@@ -2110,7 +2110,6 @@
"tools.builtins.lobe-group-management.description": "マルチエージェントグループの会話をオーケストレーションおよび管理します",
"tools.builtins.lobe-group-management.title": "グループ管理",
"tools.builtins.lobe-image-generation.description": "現在のチャットモデルにネイティブの画像出力がない場合、LobeHubプロバイダーを通じて画像を生成します。",
- "tools.builtins.lobe-image-generation.readme": "ネイティブ画像出力がないモデル向けのオプトイン画像生成。チャットまたはエージェントモードでこのツールを有効にするにはピン留めしてください。ツールスキーマコストを避けるにはピン留めを解除してください。",
"tools.builtins.lobe-image-generation.title": "画像生成",
"tools.builtins.lobe-knowledge-base.description": "アップロードしたドキュメントやドメイン知識を、セマンティックベクター検索を通じて検索します。永続的で再利用可能なリファレンスとして利用できます。",
"tools.builtins.lobe-knowledge-base.title": "ナレッジベース",
@@ -2141,7 +2140,6 @@
"tools.builtins.lobe-user-memory.readme": "あなたに関するパーソナライズされたナレッジベースを構築します。好みを記憶し、活動や体験を追跡し、個人情報を保存し、将来の会話で関連するコンテキストを呼び出せます。",
"tools.builtins.lobe-user-memory.title": "メモリー",
"tools.builtins.lobe-video-generation.description": "LobeHubプロバイダーを通じて、テキストまたは参照画像から動画を生成します。",
- "tools.builtins.lobe-video-generation.readme": "オプトインの動画生成。このツールをピン留めしてチャットまたはエージェントモードで有効にします。ピン留めしない場合、ツールスキーマのコストを回避します。",
"tools.builtins.lobe-video-generation.title": "動画生成",
"tools.builtins.lobe-web-browsing.description": "最新情報の Web 検索や Web ページのクロールを行い、コンテンツを抽出します。複数の検索エンジン、カテゴリ、期間をサポートします。",
"tools.builtins.lobe-web-browsing.readme": "最新情報の Web 検索や Web ページのクロールを実行します。複数検索エンジン、カテゴリ、期間指定をサポートし、包括的なリサーチが可能です。",
diff --git a/locales/ko-KR/setting.json b/locales/ko-KR/setting.json
index 880faf72740..c43d787e0e4 100644
--- a/locales/ko-KR/setting.json
+++ b/locales/ko-KR/setting.json
@@ -2110,7 +2110,6 @@
"tools.builtins.lobe-group-management.description": "멀티 에이전트 그룹 대화를 오케스트레이션하고 관리합니다",
"tools.builtins.lobe-group-management.title": "그룹 관리",
"tools.builtins.lobe-image-generation.description": "현재 채팅 모델에 기본 이미지 출력 기능이 없을 때 LobeHub 제공자를 통해 이미지를 생성합니다.",
- "tools.builtins.lobe-image-generation.readme": "기본 이미지 출력 기능이 없는 모델을 위한 선택적 이미지 생성. 이 도구를 고정하여 채팅 또는 에이전트 모드에서 활성화하거나, 고정 해제하여 도구 스키마 비용을 피하세요.",
"tools.builtins.lobe-image-generation.title": "이미지 생성",
"tools.builtins.lobe-knowledge-base.description": "업로드된 문서와 도메인 지식을 시맨틱 벡터 검색으로 탐색합니다 — 지속적이고 재사용 가능한 참고 자료 제공",
"tools.builtins.lobe-knowledge-base.title": "지식 베이스",
@@ -2141,7 +2140,6 @@
"tools.builtins.lobe-user-memory.readme": "당신에 대한 개인화된 지식 베이스를 구축하세요. 선호도 기억, 활동 및 경험 추적, 신원 정보 저장, 향후 대화에서 관련 맥락을 기억할 수 있습니다.",
"tools.builtins.lobe-user-memory.title": "메모리",
"tools.builtins.lobe-video-generation.description": "텍스트 또는 참조 이미지를 통해 LobeHub 제공업체를 사용하여 비디오를 생성합니다.",
- "tools.builtins.lobe-video-generation.readme": "비디오 생성 옵트인. 이 도구를 고정하여 채팅 또는 에이전트 모드에서 활성화하세요. 도구 스키마 비용을 피하려면 고정하지 마세요.",
"tools.builtins.lobe-video-generation.title": "비디오 생성",
"tools.builtins.lobe-web-browsing.description": "웹에서 최신 정보를 검색하고 웹페이지를 크롤링해 콘텐츠를 추출합니다. 다중 검색 엔진, 카테고리, 기간을 지원합니다.",
"tools.builtins.lobe-web-browsing.readme": "웹에서 최신 정보를 검색하고 웹페이지를 크롤링해 콘텐츠를 추출합니다. 다양한 검색 엔진, 카테고리, 시간 범위를 지원하여 폭넓은 리서치를 수행할 수 있습니다.",
diff --git a/locales/nl-NL/setting.json b/locales/nl-NL/setting.json
index ea5a0a4351f..dc2e70dbef9 100644
--- a/locales/nl-NL/setting.json
+++ b/locales/nl-NL/setting.json
@@ -2110,7 +2110,6 @@
"tools.builtins.lobe-group-management.description": "Orkestreer en beheer conversaties in multi‑agentgroepen",
"tools.builtins.lobe-group-management.title": "Groepsbeheer",
"tools.builtins.lobe-image-generation.description": "Genereer afbeeldingen via LobeHub-providers wanneer het huidige chatmodel geen native afbeeldingsuitvoer heeft.",
- "tools.builtins.lobe-image-generation.readme": "Opt-in afbeeldingsgeneratie voor modellen zonder native afbeeldingsuitvoer. Pin deze tool om deze in chat- of agentmodus in te schakelen; laat niet vastpinnen om de toolschemas kosten te vermijden.",
"tools.builtins.lobe-image-generation.title": "Afbeeldingsgeneratie",
"tools.builtins.lobe-knowledge-base.description": "Doorzoek geüploade documenten en domeinkennis via semantische vectorzoekopdrachten — voor blijvende, herbruikbare referentie",
"tools.builtins.lobe-knowledge-base.title": "Kennisbank",
@@ -2141,7 +2140,6 @@
"tools.builtins.lobe-user-memory.readme": "Bouw een gepersonaliseerde kennisbank over jezelf. Onthoud voorkeuren, houd activiteiten en ervaringen bij, sla identiteitsinformatie op en herinner relevante context in toekomstige gesprekken.",
"tools.builtins.lobe-user-memory.title": "Geheugen",
"tools.builtins.lobe-video-generation.description": "Genereer video's via LobeHub-providers vanuit tekst of referentieafbeeldingen.",
- "tools.builtins.lobe-video-generation.readme": "Opt-in videoproductie. Pin deze tool om deze in chat- of agentmodus in te schakelen; laat niet vastgepind om de toolschema-kosten te vermijden.",
"tools.builtins.lobe-video-generation.title": "Videoproductie",
"tools.builtins.lobe-web-browsing.description": "Zoek op het web naar actuele informatie en crawl webpagina’s om inhoud te extraheren. Ondersteunt meerdere zoekmachines, categorieën en tijdsbereiken.",
"tools.builtins.lobe-web-browsing.readme": "Zoek op het web naar actuele informatie en crawl webpagina’s om inhoud te extraheren. Ondersteunt meerdere zoekmachines, categorieën en tijdsbereiken voor uitgebreid onderzoek.",
diff --git a/locales/pl-PL/setting.json b/locales/pl-PL/setting.json
index b303c0206b5..f0b0c9915ea 100644
--- a/locales/pl-PL/setting.json
+++ b/locales/pl-PL/setting.json
@@ -2110,7 +2110,6 @@
"tools.builtins.lobe-group-management.description": "Orkiestruj i zarządzaj rozmowami grup wieloagentowych",
"tools.builtins.lobe-group-management.title": "Zarządzanie Grupami",
"tools.builtins.lobe-image-generation.description": "Generuj obrazy za pomocą dostawców LobeHub, gdy bieżący model czatu nie ma natywnego wyjścia obrazów.",
- "tools.builtins.lobe-image-generation.readme": "Opcjonalne generowanie obrazów dla modeli bez natywnego wyjścia obrazów. Przypnij to narzędzie, aby włączyć je w trybie czatu lub agenta; pozostaw nieprzypięte, aby uniknąć kosztów schematu narzędzia.",
"tools.builtins.lobe-image-generation.title": "Generowanie Obrazów",
"tools.builtins.lobe-knowledge-base.description": "Przeszukuj przesłane dokumenty i wiedzę domenową za pomocą semantycznego wyszukiwania wektorowego — jako trwałe, wielokrotnego użytku źródło informacji",
"tools.builtins.lobe-knowledge-base.title": "Baza Wiedzy",
@@ -2141,7 +2140,6 @@
"tools.builtins.lobe-user-memory.readme": "Buduj spersonalizowaną bazę wiedzy o sobie. Zapamiętuj preferencje, śledź aktywności i doświadczenia, przechowuj informacje tożsamościowe i przywołuj istotny kontekst w przyszłych rozmowach.",
"tools.builtins.lobe-user-memory.title": "Pamięć",
"tools.builtins.lobe-video-generation.description": "Generuj filmy za pomocą dostawców LobeHub z tekstu lub obrazów referencyjnych.",
- "tools.builtins.lobe-video-generation.readme": "Generowanie filmów na żądanie. Przypnij to narzędzie, aby włączyć je w trybie czatu lub agenta; pozostaw nieprzypięte, aby uniknąć kosztów schematu narzędzia.",
"tools.builtins.lobe-video-generation.title": "Generowanie filmów",
"tools.builtins.lobe-web-browsing.description": "Wyszukuj aktualne informacje w sieci i przeglądaj strony internetowe, aby wyodrębniać treści. Obsługuje wiele wyszukiwarek, kategorii i zakresów czasowych.",
"tools.builtins.lobe-web-browsing.readme": "Wyszukuj aktualne informacje w sieci i przeglądaj strony internetowe w celu wyodrębniania treści. Obsługuje wiele wyszukiwarek, kategorii i zakresów czasowych dla kompleksowych badań.",
diff --git a/locales/pt-BR/setting.json b/locales/pt-BR/setting.json
index 22dab4922a3..afdf9482347 100644
--- a/locales/pt-BR/setting.json
+++ b/locales/pt-BR/setting.json
@@ -2110,7 +2110,6 @@
"tools.builtins.lobe-group-management.description": "Orquestre e gerencie conversas de grupos multiagentes",
"tools.builtins.lobe-group-management.title": "Gerenciamento de Grupo",
"tools.builtins.lobe-image-generation.description": "Gere imagens por meio de provedores do LobeHub quando o modelo de chat atual não tiver saída de imagem nativa.",
- "tools.builtins.lobe-image-generation.readme": "Geração de imagens opcional para modelos sem saída de imagem nativa. Fixe esta ferramenta para habilitá-la no modo de chat ou agente; deixe desfixada para evitar o custo do esquema da ferramenta.",
"tools.builtins.lobe-image-generation.title": "Geração de Imagens",
"tools.builtins.lobe-knowledge-base.description": "Pesquise documentos enviados e conhecimento de domínio via busca semântica por vetores — para referência persistente e reutilizável",
"tools.builtins.lobe-knowledge-base.title": "Base de Conhecimento",
@@ -2141,7 +2140,6 @@
"tools.builtins.lobe-user-memory.readme": "Construa uma base de conhecimento personalizada sobre você. Lembre preferências, acompanhe atividades e experiências, armazene informações de identidade e recupere contextos relevantes em conversas futuras.",
"tools.builtins.lobe-user-memory.title": "Memória",
"tools.builtins.lobe-video-generation.description": "Gere vídeos através de provedores do LobeHub a partir de texto ou imagens de referência.",
- "tools.builtins.lobe-video-generation.readme": "Geração de vídeo opcional. Fixe esta ferramenta para habilitá-la no modo de chat ou agente; deixe-a não fixada para evitar o custo do esquema da ferramenta.",
"tools.builtins.lobe-video-generation.title": "Geração de Vídeo",
"tools.builtins.lobe-web-browsing.description": "Pesquise na web por informações atualizadas e rastreie páginas para extrair conteúdo. Suporta vários mecanismos de busca, categorias e intervalos de tempo.",
"tools.builtins.lobe-web-browsing.readme": "Pesquise na web por informações atualizadas e rastreie páginas para extrair conteúdo. Suporta múltiplos mecanismos de busca, categorias e intervalos de tempo para pesquisas completas.",
diff --git a/locales/ru-RU/setting.json b/locales/ru-RU/setting.json
index f76661ded75..25366e38e78 100644
--- a/locales/ru-RU/setting.json
+++ b/locales/ru-RU/setting.json
@@ -2110,7 +2110,6 @@
"tools.builtins.lobe-group-management.description": "Оркестрация и управление групповыми беседами нескольких агентов",
"tools.builtins.lobe-group-management.title": "Управление группами",
"tools.builtins.lobe-image-generation.description": "Создавайте изображения через провайдеров LobeHub, если текущая модель чата не поддерживает нативный вывод изображений.",
- "tools.builtins.lobe-image-generation.readme": "Опциональная генерация изображений для моделей без нативного вывода изображений. Закрепите этот инструмент, чтобы включить его в режиме чата или агента; оставьте незакрепленным, чтобы избежать затрат на схему инструмента.",
"tools.builtins.lobe-image-generation.title": "Генерация изображений",
"tools.builtins.lobe-knowledge-base.description": "Поиск по загруженным документам и доменным знаниям с помощью семантического векторного поиска — для постоянного и повторного использования",
"tools.builtins.lobe-knowledge-base.title": "База знаний",
@@ -2141,7 +2140,6 @@
"tools.builtins.lobe-user-memory.readme": "Создайте персонализированную базу знаний о себе. Запоминайте предпочтения, отслеживайте действия и события, сохраняйте информацию о личности и вспоминайте важный контекст в будущих беседах.",
"tools.builtins.lobe-user-memory.title": "Память",
"tools.builtins.lobe-video-generation.description": "Создавайте видео через провайдеров LobeHub из текста или эталонных изображений.",
- "tools.builtins.lobe-video-generation.readme": "Создание видео по выбору. Закрепите этот инструмент, чтобы включить его в режиме чата или агента; оставьте незакрепленным, чтобы избежать затрат на схему инструмента.",
"tools.builtins.lobe-video-generation.title": "Создание видео",
"tools.builtins.lobe-web-browsing.description": "Поиск актуальной информации в интернете и обход веб‑страниц для извлечения контента. Поддержка различных поисковых систем, категорий и временных диапазонов.",
"tools.builtins.lobe-web-browsing.readme": "Ищите актуальную информацию в интернете и извлекайте данные с веб‑страниц. Поддерживаются несколько поисковых систем, категории и временные диапазоны для комплексных исследований.",
diff --git a/locales/tr-TR/setting.json b/locales/tr-TR/setting.json
index 4ce3809402c..a6bf18c2470 100644
--- a/locales/tr-TR/setting.json
+++ b/locales/tr-TR/setting.json
@@ -2110,7 +2110,6 @@
"tools.builtins.lobe-group-management.description": "Çoklu ajan grup konuşmalarını yönetin ve düzenleyin",
"tools.builtins.lobe-group-management.title": "Grup Yönetimi",
"tools.builtins.lobe-image-generation.description": "Mevcut sohbet modelinin yerel görsel çıktısı olmadığında LobeHub sağlayıcıları aracılığıyla görseller oluşturun.",
- "tools.builtins.lobe-image-generation.readme": "Yerel görsel çıktısı olmayan modeller için isteğe bağlı görsel oluşturma. Bu aracı sohbet veya ajan modunda etkinleştirmek için sabitleyin; araç şeması maliyetinden kaçınmak için sabitlemeyin.",
"tools.builtins.lobe-image-generation.title": "Görsel Oluşturma",
"tools.builtins.lobe-knowledge-base.description": "Yüklenen belgeleri ve alan bilgilerini semantik vektör aramasıyla arayın — kalıcı ve yeniden kullanılabilir başvuru için",
"tools.builtins.lobe-knowledge-base.title": "Bilgi Bankası",
@@ -2141,7 +2140,6 @@
"tools.builtins.lobe-user-memory.readme": "Size özel bir bilgi tabanı oluşturun. Tercihlerinizi hatırlayın, etkinlikleri ve deneyimleri takip edin, kimlik bilgilerini saklayın ve gelecekteki konuşmalarda ilgili bağlamı hatırlayın.",
"tools.builtins.lobe-user-memory.title": "Hafıza",
"tools.builtins.lobe-video-generation.description": "Metin veya referans görüntülerden LobeHub sağlayıcıları aracılığıyla videolar oluşturun.",
- "tools.builtins.lobe-video-generation.readme": "Video oluşturmayı tercih edin. Bu aracı sohbet veya ajan modunda etkinleştirmek için sabitleyin; araç şema maliyetinden kaçınmak için sabitlemeden bırakın.",
"tools.builtins.lobe-video-generation.title": "Video Oluşturma",
"tools.builtins.lobe-web-browsing.description": "Güncel bilgiler için web'de arama yapın ve içerik çıkarmak için web sayfalarını tarayın. Birden fazla arama motorunu, kategoriyi ve zaman aralığını destekler.",
"tools.builtins.lobe-web-browsing.readme": "Güncel bilgiler için web'de arama yapın ve içerik çıkarmak için web sayfalarını tarayın. Kapsamlı araştırma için birden fazla arama motoru, kategori ve zaman aralığını destekler.",
diff --git a/locales/vi-VN/setting.json b/locales/vi-VN/setting.json
index b78157dd172..8a194ed467b 100644
--- a/locales/vi-VN/setting.json
+++ b/locales/vi-VN/setting.json
@@ -2110,7 +2110,6 @@
"tools.builtins.lobe-group-management.description": "Điều phối và quản lý hội thoại nhóm đa tác nhân",
"tools.builtins.lobe-group-management.title": "Quản Lý Nhóm",
"tools.builtins.lobe-image-generation.description": "Tạo hình ảnh thông qua các nhà cung cấp LobeHub khi mô hình trò chuyện hiện tại không có đầu ra hình ảnh gốc.",
- "tools.builtins.lobe-image-generation.readme": "Tùy chọn tạo hình ảnh cho các mô hình không có đầu ra hình ảnh gốc. Ghim công cụ này để kích hoạt trong chế độ trò chuyện hoặc agent; để không ghim để tránh chi phí cấu trúc công cụ.",
"tools.builtins.lobe-image-generation.title": "Tạo Hình Ảnh",
"tools.builtins.lobe-knowledge-base.description": "Tìm kiếm tài liệu đã tải lên và kiến thức theo miền thông qua tìm kiếm vector ngữ nghĩa — dùng cho tham chiếu lâu dài và tái sử dụng",
"tools.builtins.lobe-knowledge-base.title": "Cơ Sở Kiến Thức",
@@ -2141,7 +2140,6 @@
"tools.builtins.lobe-user-memory.readme": "Xây dựng cơ sở kiến thức cá nhân hóa về bạn. Ghi nhớ sở thích, theo dõi hoạt động và trải nghiệm, lưu trữ thông tin nhận dạng và gợi nhớ ngữ cảnh phù hợp trong các cuộc trò chuyện sau này.",
"tools.builtins.lobe-user-memory.title": "Bộ nhớ",
"tools.builtins.lobe-video-generation.description": "Tạo video thông qua các nhà cung cấp LobeHub từ văn bản hoặc hình ảnh tham chiếu.",
- "tools.builtins.lobe-video-generation.readme": "Tùy chọn tạo video. Ghim công cụ này để kích hoạt trong chế độ chat hoặc agent; không ghim để tránh chi phí lược đồ công cụ.",
"tools.builtins.lobe-video-generation.title": "Tạo Video",
"tools.builtins.lobe-web-browsing.description": "Tìm kiếm thông tin mới nhất trên web và thu thập nội dung từ trang web. Hỗ trợ nhiều công cụ tìm kiếm, danh mục và phạm vi thời gian.",
"tools.builtins.lobe-web-browsing.readme": "Tìm kiếm thông tin mới nhất trên web và thu thập nội dung từ trang web. Hỗ trợ nhiều công cụ tìm kiếm, danh mục và phạm vi thời gian để nghiên cứu toàn diện.",
diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.json
index 8d62481642c..832b47b68da 100644
--- a/locales/zh-CN/setting.json
+++ b/locales/zh-CN/setting.json
@@ -2523,14 +2523,6 @@
"taskLabels.tabs.agent": "助理标签",
"taskLabels.tabs.task": "任务标签",
"taskLabels.usage": "{{count}} 个任务",
- "tools.activation.action.auto": "自动",
- "tools.activation.action.pin": "固定",
- "tools.activation.auto": "自动",
- "tools.activation.auto.desc": "智能调用",
- "tools.activation.disabled.desc": "不会启用",
- "tools.activation.fixed.hint": "由应用强制开启,始终可用,无法关闭",
- "tools.activation.pinned": "固定启用",
- "tools.activation.pinned.desc": "始终注入",
"tools.add": "集成技能",
"tools.builtins.builtin-dashboard.description": "用沙箱脚本构建实时监控组件,用真实数据试运行预览,并添加到看板",
"tools.builtins.builtin-dashboard.title": "看板",
@@ -2575,7 +2567,7 @@
"tools.builtins.lobe-group-management.description": "编排并管理多助手群组对话",
"tools.builtins.lobe-group-management.title": "群组管理",
"tools.builtins.lobe-image-generation.description": "在当前对话模型没有原生出图能力时,通过 LobeHub 的图片生成通道生成图片。",
- "tools.builtins.lobe-image-generation.readme": "可选的图片生成能力,适用于没有原生出图的模型。固定(Pin)后可在对话/Agent 模式使用;不固定则不注入工具 schema,避免额外 token 消耗。",
+ "tools.builtins.lobe-image-generation.readme": "可选的图片生成能力,适用于没有原生出图的模型。开启后可在对话或 Agent 模式下使用;关闭后不会向模型提供该工具。",
"tools.builtins.lobe-image-generation.title": "图片生成",
"tools.builtins.lobe-knowledge-base.description": "查找、浏览并读取您上传的文件,并通过语义向量检索搜索已整理的知识库",
"tools.builtins.lobe-knowledge-base.title": "知识库",
@@ -2606,7 +2598,7 @@
"tools.builtins.lobe-user-memory.readme": "构建关于你的个性化知识库。记住偏好、追踪活动和经历、存储身份信息,并在未来对话中回忆相关上下文。",
"tools.builtins.lobe-user-memory.title": "记忆",
"tools.builtins.lobe-video-generation.description": "通过 LobeHub 的视频生成通道,根据文字或参考图片生成视频。",
- "tools.builtins.lobe-video-generation.readme": "可选的视频生成能力。固定(Pin)后可在对话/Agent 模式使用;不固定则不注入工具 schema,避免额外 token 消耗。",
+ "tools.builtins.lobe-video-generation.readme": "可选的视频生成能力。开启后可在对话或 Agent 模式下使用;关闭后不会向模型提供该工具。",
"tools.builtins.lobe-video-generation.title": "视频生成",
"tools.builtins.lobe-web-browsing.description": "搜索网页获取最新信息,并抓取网页内容。支持多种搜索引擎、分类和时间范围。",
"tools.builtins.lobe-web-browsing.readme": "搜索网页获取最新信息,并抓取网页内容。支持多种搜索引擎、分类和时间范围,满足全面的研究需求。",
@@ -2752,10 +2744,6 @@
"tools.privateConnector.tag": "私人",
"tools.privateConnector.tooltip": "你的私人连接器:只有你能看到,也只有你的私人助理会加载它。",
"tools.search": "搜索技能...",
- "tools.skillActivateMode.auto.desc": "AI 可自主激活工具、运行技能,并从商店安装新技能",
- "tools.skillActivateMode.auto.title": "自动",
- "tools.skillActivateMode.manual.desc": "仅用户选择的工具和技能对 AI 可用",
- "tools.skillActivateMode.manual.title": "手动",
"tools.skillActivateMode.title": "激活方式",
"tools.tabs.all": "全部",
"tools.tabs.installed": "已启用",
diff --git a/locales/zh-TW/setting.json b/locales/zh-TW/setting.json
index 89bb25c469b..f2ac55fd473 100644
--- a/locales/zh-TW/setting.json
+++ b/locales/zh-TW/setting.json
@@ -2110,7 +2110,6 @@
"tools.builtins.lobe-group-management.description": "協作並管理多代理的群組對話",
"tools.builtins.lobe-group-management.title": "群組管理",
"tools.builtins.lobe-image-generation.description": "當當前聊天模型沒有原生圖像輸出時,通過LobeHub提供商生成圖像。",
- "tools.builtins.lobe-image-generation.readme": "為沒有原生圖像輸出的模型提供選擇性圖像生成。將此工具固定以在聊天或代理模式中啟用;未固定則避免工具架構成本。",
"tools.builtins.lobe-image-generation.title": "圖像生成",
"tools.builtins.lobe-knowledge-base.description": "透過語意向量搜尋檢索上傳文件與領域知識 — 適用於長期、可重複使用的參考內容",
"tools.builtins.lobe-knowledge-base.title": "知識庫",
@@ -2141,7 +2140,6 @@
"tools.builtins.lobe-user-memory.readme": "建立關於您的個人化知識庫。記住偏好、追蹤活動與經歷、儲存身份資訊,並在未來對話中回憶相關背景。",
"tools.builtins.lobe-user-memory.title": "記憶庫",
"tools.builtins.lobe-video-generation.description": "通過 LobeHub 提供商從文字或參考圖像生成影片。",
- "tools.builtins.lobe-video-generation.readme": "選擇性影片生成。將此工具釘選以在聊天或代理模式中啟用;未釘選則避免工具架構成本。",
"tools.builtins.lobe-video-generation.title": "影片生成",
"tools.builtins.lobe-web-browsing.description": "搜尋網路上的最新資訊並爬取網頁以擷取內容。支援多種搜尋引擎、分類與時間範圍。",
"tools.builtins.lobe-web-browsing.readme": "搜尋網路上的最新資訊並爬取網頁以擷取內容。支援多種搜尋引擎、分類與時間範圍,適用於全面性的研究。",
diff --git a/packages/agent-manager-runtime/src/AgentManagerRuntime/index.installPlugin.test.ts b/packages/agent-manager-runtime/src/AgentManagerRuntime/index.installPlugin.test.ts
index 4007fbc27fd..7b7d23d55a2 100644
--- a/packages/agent-manager-runtime/src/AgentManagerRuntime/index.installPlugin.test.ts
+++ b/packages/agent-manager-runtime/src/AgentManagerRuntime/index.installPlugin.test.ts
@@ -81,7 +81,7 @@ const installThroughPopup = async (identifier: string) => {
const enabledPinned = (identifier: string) =>
expect(mocks.agentState.optimisticUpdateAgentConfig).toHaveBeenCalledWith('agent-1', {
- plugins: [{ identifier, mode: 'pinned' }],
+ plugins: [{ identifier, mode: 'auto' }],
});
beforeEach(() => {
diff --git a/packages/agent-manager-runtime/src/AgentManagerRuntime/index.test.ts b/packages/agent-manager-runtime/src/AgentManagerRuntime/index.test.ts
index 6ad717854c8..d27bd0728c0 100644
--- a/packages/agent-manager-runtime/src/AgentManagerRuntime/index.test.ts
+++ b/packages/agent-manager-runtime/src/AgentManagerRuntime/index.test.ts
@@ -240,7 +240,7 @@ describe('AgentManagerRuntime', () => {
expect(result.content).toBe('No fields to update.');
});
- it('flips an existing disabled object entry back to pinned, without duplicating it', async () => {
+ it('flips an existing disabled object entry back to auto, without duplicating it', async () => {
const originalPlugins = mockAgentConfig.plugins;
mockAgentConfig.plugins = [
'plugin-1',
@@ -260,7 +260,30 @@ describe('AgentManagerRuntime', () => {
expect(result.state).toMatchObject({
config: {
newValues: {
- plugins: ['plugin-1', { identifier: 'plugin-2', mode: 'pinned' }],
+ plugins: ['plugin-1', { identifier: 'plugin-2', mode: 'auto' }],
+ },
+ },
+ });
+ } finally {
+ mockAgentConfig.plugins = originalPlugins;
+ }
+ });
+
+ it('writes an explicit disabled entry when togglePlugin sets enabled=false', async () => {
+ const originalPlugins = mockAgentConfig.plugins;
+ mockAgentConfig.plugins = [{ identifier: 'plugin-2', mode: 'auto' } as any] as any;
+
+ try {
+ const result = await runtime.updateAgentConfig('agent-id', {
+ config: { model: 'gpt-4o' },
+ togglePlugin: { pluginId: 'plugin-2', enabled: false },
+ });
+
+ expect(result.success).toBe(true);
+ expect(result.state).toMatchObject({
+ config: {
+ newValues: {
+ plugins: [{ identifier: 'plugin-2', mode: 'disabled' }],
},
},
});
@@ -968,7 +991,7 @@ describe('AgentManagerRuntime', () => {
expect(result.content).toContain('not found');
});
- it('flips an existing disabled object entry back to pinned, without duplicating it', async () => {
+ it('flips an existing disabled object entry back to auto with builtinOverride, without duplicating it', async () => {
const originalPlugins = mockAgentConfig.plugins;
mockAgentConfig.plugins = [
{ identifier: 'lobe-web-browsing', mode: 'disabled' } as any,
@@ -983,7 +1006,9 @@ describe('AgentManagerRuntime', () => {
expect(result.success).toBe(true);
expect(getLastOptimisticConfigUpdateCall()).toEqual([
'agent-id',
- { plugins: [{ identifier: 'lobe-web-browsing', mode: 'pinned' }] },
+ {
+ plugins: [{ builtinOverride: true, identifier: 'lobe-web-browsing', mode: 'auto' }],
+ },
]);
} finally {
mockAgentConfig.plugins = originalPlugins;
diff --git a/packages/agent-manager-runtime/src/AgentManagerRuntime/index.ts b/packages/agent-manager-runtime/src/AgentManagerRuntime/index.ts
index 1eec737a33e..fa8f65f714d 100644
--- a/packages/agent-manager-runtime/src/AgentManagerRuntime/index.ts
+++ b/packages/agent-manager-runtime/src/AgentManagerRuntime/index.ts
@@ -22,9 +22,8 @@ import {
import {
type BuiltinToolResult,
type DiscoverAssistantDetail,
- getPluginMode,
parsePluginEntry,
- upsertPluginMode,
+ upsertConnectorEnabled,
} from '@lobechat/types';
import { getAgentStoreState } from '@/store/agent';
@@ -176,17 +175,15 @@ export class AgentManagerRuntime {
// Handle togglePlugin - merge into config.plugins
if (params.togglePlugin) {
const { pluginId, enabled } = params.togglePlugin;
- const isCurrentlyEnabled = getPluginMode(previousConfig?.plugins, pluginId) === 'pinned';
+ const existing = previousConfig?.plugins?.find(
+ (entry) => parsePluginEntry(entry).identifier === pluginId,
+ );
+ const isCurrentlyEnabled = existing
+ ? parsePluginEntry(existing).mode !== 'disabled'
+ : false;
const shouldEnable = enabled !== undefined ? enabled : !isCurrentlyEnabled;
- // upsertPluginMode preserves an already-matching entry as-is and
- // flips a disabled entry back to pinned in place, instead of
- // blindly pushing a duplicate bare-string identifier.
- const newPlugins = upsertPluginMode(
- previousConfig?.plugins,
- pluginId,
- shouldEnable ? 'pinned' : 'auto',
- );
+ const newPlugins = upsertConnectorEnabled(previousConfig?.plugins, pluginId, shouldEnable);
finalConfig = { ...finalConfig, plugins: newPlugins };
diff --git a/packages/agent-manager-runtime/src/AgentManagerRuntime/installPlugin.ts b/packages/agent-manager-runtime/src/AgentManagerRuntime/installPlugin.ts
index 51618b80e2e..bcf4fb406b9 100644
--- a/packages/agent-manager-runtime/src/AgentManagerRuntime/installPlugin.ts
+++ b/packages/agent-manager-runtime/src/AgentManagerRuntime/installPlugin.ts
@@ -1,6 +1,11 @@
import type { ComposioAppType, LobehubSkillProviderType } from '@lobechat/const';
import { resolveConnectorCatalogItem } from '@lobechat/const';
-import { type BuiltinToolResult, getPluginMode, upsertPluginMode } from '@lobechat/types';
+import {
+ type BuiltinToolResult,
+ parsePluginEntry,
+ setBuiltinPluginMode,
+ upsertConnectorEnabled,
+} from '@lobechat/types';
import { getAgentStoreState } from '@/store/agent';
import { agentSelectors } from '@/store/agent/selectors/selectors';
@@ -81,7 +86,7 @@ export const installPlugin = async (
const builtinTool = builtinTools.find((t) => t.identifier === identifier);
if (builtinTool) {
- await enablePluginForAgent(agentService, agentId, identifier);
+ await enablePluginForAgent(agentService, agentId, identifier, { builtin: true });
return {
content: `Successfully enabled builtin tool: ${builtinTool.meta?.title || identifier}`,
@@ -407,17 +412,20 @@ export const enablePluginForAgent = async (
agentService: IAgentService,
agentId: string,
pluginId: string,
+ options?: { builtin?: boolean },
): Promise<void> => {
await ensureAgentLoaded(agentService, agentId);
const agentState = getAgentStoreState();
const currentPlugins = agentSelectors.getAgentConfigById(agentId)(agentState)?.plugins;
- // upsertPluginMode preserves an already-matching entry as-is and flips a
- // disabled entry back to pinned in place, instead of blindly pushing a
- // duplicate bare-string identifier.
- if (getPluginMode(currentPlugins, pluginId) !== 'pinned') {
+ const existing = currentPlugins?.find((entry) => parsePluginEntry(entry).identifier === pluginId);
+ const needsBuiltinOverride =
+ !!options?.builtin && (!existing || typeof existing === 'string' || !existing.builtinOverride);
+ if (!existing || parsePluginEntry(existing).mode === 'disabled' || needsBuiltinOverride) {
await getAgentStoreState().optimisticUpdateAgentConfig(agentId, {
- plugins: upsertPluginMode(currentPlugins, pluginId, 'pinned'),
+ plugins: options?.builtin
+ ? setBuiltinPluginMode(currentPlugins, pluginId, 'auto')
+ : upsertConnectorEnabled(currentPlugins, pluginId, true),
});
}
};
diff --git a/packages/builtin-tool-agent-builder/src/client/Render/SearchMarketTools.tsx b/packages/builtin-tool-agent-builder/src/client/Render/SearchMarketTools.tsx
index e62c67a1f8a..12c8e78aaf8 100644
--- a/packages/builtin-tool-agent-builder/src/client/Render/SearchMarketTools.tsx
+++ b/packages/builtin-tool-agent-builder/src/client/Render/SearchMarketTools.tsx
@@ -1,8 +1,7 @@
'use client';
import type { BuiltinRenderProps } from '@lobechat/types';
-import { Flexbox } from '@lobehub/ui';
-import { Avatar, Button, Tag } from '@lobehub/ui';
+import { Avatar, Button, Flexbox, Tag } from '@lobehub/ui';
import { CheckCircle, Download, Package, Search } from 'lucide-react';
import { memo, useState } from 'react';
@@ -47,7 +46,7 @@ const ToolItem = memo<ToolItemProps>(({ tool }) => {
try {
const isSuccess = await installMCPPlugin(tool.identifier);
if (isSuccess) {
- await togglePlugin(tool.identifier);
+ await togglePlugin(tool.identifier, true);
}
} finally {
setLocalInstalling(false);
diff --git a/packages/builtin-tools/src/index.ts b/packages/builtin-tools/src/index.ts
index b674699988f..d671f1ab2f6 100644
--- a/packages/builtin-tools/src/index.ts
+++ b/packages/builtin-tools/src/index.ts
@@ -109,13 +109,6 @@ export const getUserDisabledToolIds = (
: disabled;
};
-/**
- * Tool IDs to exclude from defaults when in manual skill-activate mode.
- * These are the tool/skill discovery tools that should be disabled when user wants precise control.
- * Other default tools (sandbox, web browsing, etc.) remain available if enabled externally.
- */
-export const manualModeExcludeToolIds = [LobeActivatorManifest.identifier];
-
/**
* Tool IDs allowed when the agent runs in chat mode
* (`chatConfig.enableAgentMode === false`). Each one still passes through
diff --git a/packages/database/src/models/__tests__/agent.characterization.test.ts b/packages/database/src/models/__tests__/agent.characterization.test.ts
index e3f32cd6cdb..6f137e2d0ea 100644
--- a/packages/database/src/models/__tests__/agent.characterization.test.ts
+++ b/packages/database/src/models/__tests__/agent.characterization.test.ts
@@ -182,10 +182,10 @@ describe('AgentModel - characterization', () => {
{ marketIdentifier: 'from-market' },
]);
- // Media opt-ins keep the same representation as the picker so they also work in Chat mode.
+ // All four starter tools use the two-state on-demand representation; Chat mode accepts auto too.
const expected = [
- { identifier: 'lobe-image-generation', mode: 'pinned' },
- { identifier: 'lobe-video-generation', mode: 'pinned' },
+ { identifier: 'lobe-image-generation', mode: 'auto' },
+ { identifier: 'lobe-video-generation', mode: 'auto' },
{ identifier: 'lobe-agent-documents', mode: 'auto' },
{ identifier: 'lobe-agent', mode: 'auto' },
];
diff --git a/packages/database/src/utils/agentConfig.ts b/packages/database/src/utils/agentConfig.ts
index ee416af1bb1..c462b73c8ce 100644
--- a/packages/database/src/utils/agentConfig.ts
+++ b/packages/database/src/utils/agentConfig.ts
@@ -23,10 +23,9 @@ export const getNewAgentPlugins = (
)
return config.plugins;
- // Agent mode defers media pins too. Chat mode needs those pins when the user switches modes.
return [
- { identifier: 'lobe-image-generation', mode: 'pinned' },
- { identifier: 'lobe-video-generation', mode: 'pinned' },
+ { identifier: 'lobe-image-generation', mode: 'auto' },
+ { identifier: 'lobe-video-generation', mode: 'auto' },
{ identifier: 'lobe-agent-documents', mode: 'auto' },
{ identifier: 'lobe-agent', mode: 'auto' },
];
diff --git a/packages/locales/src/default/setting.ts b/packages/locales/src/default/setting.ts
index 47adfb345c5..b5cc3b6b865 100644
--- a/packages/locales/src/default/setting.ts
+++ b/packages/locales/src/default/setting.ts
@@ -4498,12 +4498,12 @@ When I am ___, I need ___
'tools.builtins.lobe-image-generation.description':
'Generate images through LobeHub providers when the current chat model has no native image output.',
'tools.builtins.lobe-image-generation.readme':
- 'Opt-in image generation for models without native image output. Pin this tool to enable it in chat or agent mode; leave unpinned to avoid the tool schema cost.',
+ 'Opt-in image generation for models without native image output. Enable this tool to use it in chat or agent mode; disable it to avoid exposing the tool.',
'tools.builtins.lobe-image-generation.title': 'Image Generation',
'tools.builtins.lobe-video-generation.description':
'Generate videos through LobeHub providers from text or reference images.',
'tools.builtins.lobe-video-generation.readme':
- 'Opt-in video generation. Pin this tool to enable it in chat or agent mode; leave unpinned to avoid the tool schema cost.',
+ 'Opt-in video generation. Enable this tool to use it in chat or agent mode; disable it to avoid exposing the tool.',
'tools.builtins.lobe-video-generation.title': 'Video Generation',
'tools.builtins.lobe-web-onboarding.description':
'Drive the web onboarding flow with a controlled agent runtime',
@@ -4780,20 +4780,7 @@ When I am ___, I need ___
'Your private connector: only you can see it, and only your private agents load it.',
'tools.search': 'Search skills...',
'tools.loading.onDemand': 'Load on demand',
- 'tools.activation.action.auto': 'Auto',
'tools.loading.never': 'Never load',
- 'tools.activation.action.pin': 'Pin',
- 'tools.activation.auto': 'Auto',
- 'tools.activation.auto.desc': 'Smart',
- 'tools.activation.disabled.desc': 'Turned Off',
- 'tools.activation.fixed.hint': 'Always on — managed by the app and can’t be turned off',
- 'tools.activation.pinned': 'Pinned',
- 'tools.activation.pinned.desc': 'Always On',
- 'tools.skillActivateMode.auto.desc':
- 'AI can autonomously activate tools, run skills, and install new skills from the store',
- 'tools.skillActivateMode.auto.title': 'Auto',
- 'tools.skillActivateMode.manual.desc': 'Only user-selected tools and skills are available to AI',
- 'tools.skillActivateMode.manual.title': 'Manual',
'tools.skillActivateMode.title': 'Activate Mode',
'tools.tabs.all': 'All',
'tools.tabs.installed': 'Enabled',
diff --git a/packages/mecha/src/resolveAgentConfig.test.ts b/packages/mecha/src/resolveAgentConfig.test.ts
index d11b2eb1536..93dfd8fe4ef 100644
--- a/packages/mecha/src/resolveAgentConfig.test.ts
+++ b/packages/mecha/src/resolveAgentConfig.test.ts
@@ -59,6 +59,45 @@ describe('resolveAgentConfig without a host', () => {
expect(resolved.plugins).toContain('lobe-web-browsing');
});
+ it('treats auto entries as enabled in Chat and Custom modes while keeping disabled entries excluded', () => {
+ const plugins = [
+ { identifier: 'lobe-image-generation', mode: 'auto' },
+ { builtinOverride: true, identifier: 'lobe-task', mode: 'auto' },
+ { identifier: 'lobe-video-generation', mode: 'disabled' },
+ ];
+
+ expect(
+ resolveAgentConfig(
+ { agentId: 'agt_1' },
+ snapshot({
+ agentConfig: { plugins } as never,
+ chatConfig: { enableAgentMode: false } as never,
+ }),
+ ).plugins,
+ ).toEqual(['lobe-image-generation', 'lobe-task']);
+
+ expect(
+ resolveAgentConfig(
+ { agentId: 'agt_1' },
+ snapshot({
+ agentConfig: { plugins } as never,
+ chatConfig: { toolMode: 'custom' } as never,
+ }),
+ ).plugins,
+ ).toEqual(['lobe-image-generation', 'lobe-task']);
+
+ // Agent mode still defers auto and on-demand builtins to the activator.
+ expect(
+ resolveAgentConfig(
+ { agentId: 'agt_1' },
+ snapshot({
+ agentConfig: { plugins } as never,
+ chatConfig: { enableAgentMode: true } as never,
+ }),
+ ).plugins,
+ ).toEqual([]);
+ });
+
it('prefers the caller plugins over the stored ones', () => {
const resolved = resolveAgentConfig(
{ agentId: 'agt_1', plugins: ['lobe-local-system'] },
diff --git a/packages/mecha/src/resolveAgentConfig.ts b/packages/mecha/src/resolveAgentConfig.ts
index 0d3e004eba2..a53b7384098 100644
--- a/packages/mecha/src/resolveAgentConfig.ts
+++ b/packages/mecha/src/resolveAgentConfig.ts
@@ -14,6 +14,7 @@ import {
type AgentModelOverride,
type ChatCompletionTool,
getActivePluginIds,
+ getOptedInPluginIds,
type LobeAgentChatConfig,
type LobeAgentConfig,
type MessageMapScope,
@@ -328,12 +329,13 @@ export const resolveAgentConfig = (
? sharedChatConfig
: { ...sharedChatConfig, enableAgentMode: memberModeOverride };
- // Base plugins from agent config (pinned identifiers only — disabled entries excluded)
- const savedPlugins = getActivePluginIds(agentConfig?.plugins);
+ // Base plugins from agent config: Agent mode loads on-demand builtins and `auto`
+ // entries through the activator; Chat and Custom modes have no activator by default,
+ // so every opted-in entry (`auto` or legacy `pinned`) joins the base toolset directly.
const basePlugins =
resolveToolMode(chatConfig) === 'agent'
- ? savedPlugins.filter((id) => !isOnDemandBuiltinTool(id))
- : savedPlugins;
+ ? getActivePluginIds(agentConfig?.plugins).filter((id) => !isOnDemandBuiltinTool(id))
+ : getOptedInPluginIds(agentConfig?.plugins);
// Check if this is a builtin agent
// Priority: supervisor check (when in group scope) > agent store slug
diff --git a/packages/mecha/src/toolSet/connectorActivation.ts b/packages/mecha/src/toolSet/connectorActivation.ts
index 9e23c7346cf..76d0a982f27 100644
--- a/packages/mecha/src/toolSet/connectorActivation.ts
+++ b/packages/mecha/src/toolSet/connectorActivation.ts
@@ -3,10 +3,7 @@ import { type LobeAgentChatConfig, resolveToolMode } from '@lobechat/types';
/** Agent mode provides the activator by default. Custom toolsets can declare it explicitly. */
export const hasConnectorActivator = (
- chatConfig:
- | Pick<LobeAgentChatConfig, 'enableAgentMode' | 'skillActivateMode' | 'toolMode'>
- | null
- | undefined,
+ chatConfig: Pick<LobeAgentChatConfig, 'enableAgentMode' | 'toolMode'> | null | undefined,
pluginIds: readonly string[] = [],
disabledIds: readonly string[] = [],
): boolean => {
diff --git a/packages/mecha/src/toolSet/skillPool.test.ts b/packages/mecha/src/toolSet/skillPool.test.ts
index d0daaf8d58f..dd52ed33152 100644
--- a/packages/mecha/src/toolSet/skillPool.test.ts
+++ b/packages/mecha/src/toolSet/skillPool.test.ts
@@ -85,14 +85,14 @@ describe('assembleSkillPool', () => {
'agent-skills:notes',
]);
- // A saved auto entry is a user choice, including on legacy manual agents.
+ // A saved auto entry is a user choice, including on legacy manual agents (for both DB and agent skills).
expect(
assembleSkillPool(sources, {
- autoSkillIds: ['auto'],
+ autoSkillIds: ['auto', 'agent-skills:notes'],
enabledPluginIds: ['pinned'],
skillActivateMode: 'manual',
}).skills.map((s) => s.identifier),
- ).toEqual(['project:deploy', 'pinned', 'auto']);
+ ).toEqual(['project:deploy', 'pinned', 'auto', 'agent-skills:notes']);
});
it('withholds everything a share configuration does not allow', () => {
diff --git a/packages/mecha/src/toolSet/skillPool.ts b/packages/mecha/src/toolSet/skillPool.ts
index f9fe828dd3a..0e96eba0a5a 100644
--- a/packages/mecha/src/toolSet/skillPool.ts
+++ b/packages/mecha/src/toolSet/skillPool.ts
@@ -72,23 +72,19 @@ export const assembleSkillPool = (
): OperationSkillSet => {
const enabledPluginIds = new Set(options.enabledPluginIds ?? []);
const turnSkillIds = new Set(options.turnSkillIds ?? []);
- // Manual mode exposes only what the user picked. Project / device skills are
- // discovered from the run's working directory and can never be picked in the
- // UI, so the mode does not speak about them and they stay.
- const selectable =
- options.skillActivateMode === 'manual'
- ? (skills: readonly SkillMeta[] = []) =>
- skills.filter(
- (skill) => enabledPluginIds.has(skill.identifier) || turnSkillIds.has(skill.identifier),
- )
- : (skills: readonly SkillMeta[] = []) => skills;
-
// Profile-managed skills are opt-in. A legacy pin and explicit auto both
// make a skill discoverable, even on agents with the old manual setting.
const on = new Set([...enabledPluginIds, ...turnSkillIds, ...(options.autoSkillIds ?? [])]);
const offered = (skills: readonly SkillMeta[] = []) =>
skills.filter((skill) => on.has(skill.identifier));
+ // Manual mode exposes only what the user (or turn) opted into. Project / device
+ // skills come from the working directory and stay visible either way.
+ const selectable =
+ options.skillActivateMode === 'manual'
+ ? offered
+ : (skills: readonly SkillMeta[] = []) => skills;
+
const ordered = [
...(sources.project ?? []),
...offered(sources.db),
diff --git a/src/features/AgentBuilder/SuggestionChips/useBuilderContext.ts b/src/features/AgentBuilder/SuggestionChips/useBuilderContext.ts
index 10e5a67e376..c05dde94462 100644
--- a/src/features/AgentBuilder/SuggestionChips/useBuilderContext.ts
+++ b/src/features/AgentBuilder/SuggestionChips/useBuilderContext.ts
@@ -3,7 +3,7 @@ import {
agentDisplayName,
type AgentGroupDetail,
type AgentPluginEntry,
- getActivePluginIds,
+ getOptedInPluginIds,
} from '@lobechat/types';
import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -31,9 +31,8 @@ const summarize = (value: string | null | undefined, fallback: string): string =
const buildAgentSummary = (agent?: AgentLike): string => {
if (!agent) return 'A new agent with default settings and no role configured yet.';
const role = agent.systemRole?.trim();
- // Pinned identifiers only — a disabled plugin isn't a "tool enabled" for
- // the builder-suggestion summary's purposes.
- const plugins = getActivePluginIds(agent.plugins);
+ // Opted-in identifiers (`auto` + legacy `pinned`) — excludes explicitly disabled plugins.
+ const plugins = getOptedInPluginIds(agent.plugins);
const openingQuestions = agent.openingQuestions ?? [];
return [
`Name: ${summarize(agentDisplayName(agent), '(untitled)')}`,
diff --git a/src/features/AgentProfileCard/AgentProfilePopup.tsx b/src/features/AgentProfileCard/AgentProfilePopup.tsx
index d11db3b4d5a..098239c7523 100644
--- a/src/features/AgentProfileCard/AgentProfilePopup.tsx
+++ b/src/features/AgentProfileCard/AgentProfilePopup.tsx
@@ -1,6 +1,6 @@
'use client';
-import { agentDisplayName } from '@lobechat/types';
+import { agentDisplayName, getOptedInPluginIds } from '@lobechat/types';
import {
ActionIcon,
createStaticStyles,
@@ -185,7 +185,7 @@ const AgentProfilePopup = memo<AgentProfilePopupProps>(
const hasDisplay = Boolean(agentDisplayName(merged) || merged.avatar || merged.description);
const showSkeleton = !hasDisplay && isLoading;
- const pluginCount = fetched?.plugins?.length ?? 0;
+ const pluginCount = getOptedInPluginIds(fetched?.plugins).length;
const knowledgeCount = fetched?.knowledgeBases?.length ?? 0;
const fileCount = fetched?.files?.length ?? 0;
const hasStats = pluginCount > 0 || knowledgeCount > 0 || fileCount > 0;
diff --git a/src/features/AgentSetting/store/action.ts b/src/features/AgentSetting/store/action.ts
index 886e4b3d922..23384b881e7 100644
--- a/src/features/AgentSetting/store/action.ts
+++ b/src/features/AgentSetting/store/action.ts
@@ -69,7 +69,6 @@ export interface Action extends PublicAction {
setChatConfig: (config: Partial<LobeAgentChatConfig>) => Promise<void>;
streamUpdateMetaArray: (key: keyof MetaData) => any;
streamUpdateMetaString: (key: keyof MetaData) => any;
- toggleAgentPlugin: (pluginId: string, state?: boolean) => void;
/**
* Update loading state
@@ -363,10 +362,6 @@ export const store: StateCreator<Store, [['zustand/devtools', never]]> = (set, g
};
},
- toggleAgentPlugin: (id, state) => {
- get().dispatchConfig({ pluginId: id, state, type: 'togglePlugin' });
- },
-
updateLoadingState: (key, value) => {
set(
{ loadingState: { ...get().loadingState, [key]: value } },
diff --git a/src/features/AgentSetting/store/reducers/config.test.ts b/src/features/AgentSetting/store/reducers/config.test.ts
index 7949e09e540..91ae31d33ba 100644
--- a/src/features/AgentSetting/store/reducers/config.test.ts
+++ b/src/features/AgentSetting/store/reducers/config.test.ts
@@ -36,58 +36,4 @@ describe('configReducer', () => {
});
});
});
-
- describe('togglePlugin', () => {
- it('pins a new identifier when absent', () => {
- const state = { ...DEFAULT_AGENT_CONFIG, plugins: ['plugin-a'] };
-
- const nextState = configReducer(state, {
- pluginId: 'plugin-b',
- type: 'togglePlugin',
- });
-
- expect(nextState.plugins).toEqual(['plugin-a', { identifier: 'plugin-b', mode: 'pinned' }]);
- });
-
- it('unpins (removes) an already-pinned legacy string entry', () => {
- const state = { ...DEFAULT_AGENT_CONFIG, plugins: ['plugin-a', 'plugin-b'] };
-
- const nextState = configReducer(state, {
- pluginId: 'plugin-b',
- type: 'togglePlugin',
- });
-
- expect(nextState.plugins).toEqual(['plugin-a']);
- });
-
- it('flips an existing disabled object entry back to pinned, without duplicating it', () => {
- const state = {
- ...DEFAULT_AGENT_CONFIG,
- plugins: ['plugin-a', { identifier: 'plugin-b', mode: 'disabled' }] as any,
- };
-
- const nextState = configReducer(state, {
- pluginId: 'plugin-b',
- state: true,
- type: 'togglePlugin',
- });
-
- expect(nextState.plugins).toEqual(['plugin-a', { identifier: 'plugin-b', mode: 'pinned' }]);
- });
-
- it('explicit state=false reverts the entry to auto, removing it from the array', () => {
- const state = {
- ...DEFAULT_AGENT_CONFIG,
- plugins: ['plugin-a', { identifier: 'plugin-b', mode: 'disabled' }] as any,
- };
-
- const nextState = configReducer(state, {
- pluginId: 'plugin-b',
- state: false,
- type: 'togglePlugin',
- });
-
- expect(nextState.plugins).toEqual(['plugin-a']);
- });
- });
});
diff --git a/src/features/AgentSetting/store/reducers/config.ts b/src/features/AgentSetting/store/reducers/config.ts
index bda61bf5e30..c8061c1923d 100644
--- a/src/features/AgentSetting/store/reducers/config.ts
+++ b/src/features/AgentSetting/store/reducers/config.ts
@@ -1,4 +1,3 @@
-import { getPluginMode, upsertPluginMode } from '@lobechat/types';
import { produce } from 'immer';
import type { PartialDeep } from 'type-fest';
@@ -7,9 +6,7 @@ import type { LobeAgentConfig } from '@/types/agent';
import { merge } from '@/utils/merge';
export type ConfigDispatch =
- | { config: PartialDeep<LobeAgentConfig>; type: 'update' }
- | { pluginId: string; state?: boolean; type: 'togglePlugin' }
- | { type: 'reset' };
+ { config: PartialDeep<LobeAgentConfig>; type: 'update' } | { type: 'reset' };
export const configReducer = (state: LobeAgentConfig, payload: ConfigDispatch): LobeAgentConfig => {
switch (payload.type) {
@@ -19,19 +16,6 @@ export const configReducer = (state: LobeAgentConfig, payload: ConfigDispatch):
});
}
- case 'togglePlugin': {
- return produce(state, (config) => {
- const { pluginId: id, state } = payload;
- const isPinned = getPluginMode(config.plugins, id) === 'pinned';
- const shouldPin = typeof state === 'undefined' ? !isPinned : state;
-
- // upsertPluginMode preserves an already-matching entry as-is and
- // flips a disabled entry back to pinned in place, instead of
- // blindly pushing a duplicate bare-string identifier.
- config.plugins = upsertPluginMode(config.plugins, id, shouldPin ? 'pinned' : 'auto');
- });
- }
-
case 'reset': {
return DEFAULT_AGENT_CONFIG;
}
diff --git a/src/features/ChatInput/ActionBar/Token/useTokenBreakdown.test.ts b/src/features/ChatInput/ActionBar/Token/useTokenBreakdown.test.ts
index bf5d9bc1bd1..90e5300fee2 100644
--- a/src/features/ChatInput/ActionBar/Token/useTokenBreakdown.test.ts
+++ b/src/features/ChatInput/ActionBar/Token/useTokenBreakdown.test.ts
@@ -51,6 +51,7 @@ vi.mock('@/store/agent', () => ({
}));
vi.mock('@/store/agent/selectors', () => ({
agentByIdSelectors: {
+ getAgentConfigById: () => () => undefined,
getAgentKnowledgeBasesById: () => () => [],
getAgentPluginsById: () => () => [],
getAgentSystemRoleById: () => () => '',
@@ -58,7 +59,6 @@ vi.mock('@/store/agent/selectors', () => ({
chatConfigByIdSelectors: {
getChatConfigById: () => () => ({}),
getRuntimeModeById: () => () => undefined,
- getSkillActivateModeById: () => () => undefined,
},
}));
vi.mock('@/store/aiInfra', () => ({
diff --git a/src/features/ChatInput/ActionBar/Token/useTokenBreakdown.ts b/src/features/ChatInput/ActionBar/Token/useTokenBreakdown.ts
index 09434bacd2b..ae54615ccf1 100644
--- a/src/features/ChatInput/ActionBar/Token/useTokenBreakdown.ts
+++ b/src/features/ChatInput/ActionBar/Token/useTokenBreakdown.ts
@@ -247,6 +247,9 @@ export const useTokenBreakdown = (): TokenBreakdown => {
const canUseTool = useModelSupportToolUse(model, provider);
const pluginIds = useAgentStore((s) => agentByIdSelectors.getAgentPluginsById(agentId)(s));
+ const rawPlugins = useAgentStore(
+ (s) => agentByIdSelectors.getAgentConfigById(agentId)(s)?.plugins,
+ );
const installedPlugins = useToolStore((s) => s.installedPlugins);
// The fallback for a conversation with no recorded request yet. Once the
@@ -291,6 +294,7 @@ export const useTokenBreakdown = (): TokenBreakdown => {
model,
pluginIds,
provider,
+ rawPlugins,
toolContextRefreshKey,
toolMode,
]);
diff --git a/src/features/ChatInput/ActionBar/Tools/capabilityTools.test.ts b/src/features/ChatInput/ActionBar/Tools/capabilityTools.test.ts
index 866091b00f0..7e3cc755312 100644
--- a/src/features/ChatInput/ActionBar/Tools/capabilityTools.test.ts
+++ b/src/features/ChatInput/ActionBar/Tools/capabilityTools.test.ts
@@ -2,28 +2,9 @@ import { MemoryManifest } from '@lobechat/builtin-tool-memory';
import { WebBrowsingManifest } from '@lobechat/builtin-tool-web-browsing';
import { describe, expect, it } from 'vitest';
-import {
- isCapabilityTool,
- resolveCapabilityConfigPatch,
- resolveCapabilityMode,
-} from './capabilityTools';
+import { isCapabilityTool, resolveCapabilityConfigPatch } from './capabilityTools';
describe('capabilityTools', () => {
- describe('resolveCapabilityMode', () => {
- it('reports an enabled capability as Auto', () => {
- expect(resolveCapabilityMode(true)).toBe('auto');
- });
-
- it('reports a disabled capability as Disabled', () => {
- expect(resolveCapabilityMode(false)).toBe('disabled');
- });
-
- it('reports a pinned capability as Pinned, whether or not it is enabled', () => {
- expect(resolveCapabilityMode(true, true)).toBe('pinned');
- expect(resolveCapabilityMode(false, true)).toBe('pinned');
- });
- });
-
describe('isCapabilityTool', () => {
it('recognises memory and web browsing', () => {
expect(isCapabilityTool(MemoryManifest.identifier)).toBe(true);
diff --git a/src/features/ChatInput/ActionBar/Tools/capabilityTools.ts b/src/features/ChatInput/ActionBar/Tools/capabilityTools.ts
index a91478005a7..c352ca74a19 100644
--- a/src/features/ChatInput/ActionBar/Tools/capabilityTools.ts
+++ b/src/features/ChatInput/ActionBar/Tools/capabilityTools.ts
@@ -30,17 +30,6 @@ const CAPABILITY_CONFIG_PATCHES: Record<
},
};
-/**
- * Activation label a capability row shows. On/off comes from chatConfig rather than
- * from the plugin list, while `pinned` additionally records the explicit pin in
- * `agents.plugins` — that is what moves the row into the Pinned group.
- */
-export const resolveCapabilityMode = (enabled: boolean, pinned = false): AgentPluginMode => {
- if (pinned) return 'pinned';
-
- return enabled ? 'auto' : 'disabled';
-};
-
/** Whether `identifier`'s activation is backed by chatConfig rather than only `agents.plugins`. */
export const isCapabilityTool = (identifier: string): boolean =>
identifier in CAPABILITY_CONFIG_PATCHES;
diff --git a/src/features/ChatInput/ActionBar/Tools/useActivationSets.test.ts b/src/features/ChatInput/ActionBar/Tools/useActivationSets.test.ts
index 91ecec048c3..f83b56935f6 100644
--- a/src/features/ChatInput/ActionBar/Tools/useActivationSets.test.ts
+++ b/src/features/ChatInput/ActionBar/Tools/useActivationSets.test.ts
@@ -3,41 +3,35 @@ import { describe, expect, it } from 'vitest';
import { resolveImplicitMode } from './librarySkillPolicy';
import { resolveActivationSets } from './useActivationSets';
-const resolve = (rawPlugins: Parameters<typeof resolveActivationSets>[0]['rawPlugins']) =>
+const resolve = (
+ rawPlugins: Parameters<typeof resolveActivationSets>[0]['rawPlugins'],
+ discoverBuiltins = true,
+) =>
resolveActivationSets({
connectedConnectorIds: ['gmail', 'slack', 'linear'],
connectorIds: ['gmail', 'slack', 'linear'],
- librarySkillIds: ['excalidraw'],
- // What `getActivePluginIds` yields: the entries that carry a pin.
- pinnedIds: (rawPlugins ?? []).flatMap((entry) =>
- typeof entry === 'string' ? [entry] : entry.mode === 'pinned' ? [entry.identifier] : [],
- ),
+ discoverBuiltins,
rawPlugins,
});
describe('resolveActivationSets', () => {
- it('puts inherited connectors under Auto and keeps library skills off', () => {
- const { checkedSet, disabledIdSet } = resolve([]);
+ it('puts inherited connectors and configurable builtins under Auto in agent mode', () => {
+ const { disabledIdSet } = resolve([]);
- expect([...disabledIdSet]).toEqual(['excalidraw']);
+ expect([...disabledIdSet]).toEqual([]);
expect(disabledIdSet.has('lobe-creds')).toBe(false);
- expect(checkedSet.size).toBe(0);
});
- it('lists a connector that is on under Auto: neither Pinned nor Disabled', () => {
- const { checkedSet, disabledIdSet } = resolve([{ identifier: 'gmail', mode: 'auto' }]);
+ it('lists a connector that is on under Auto', () => {
+ const { disabledIdSet } = resolve([{ identifier: 'gmail', mode: 'auto' }]);
- expect(checkedSet.has('gmail')).toBe(false);
expect(disabledIdSet.has('gmail')).toBe(false);
});
- it('never lists a connector under Pinned, even one pinned before the two-state switch', () => {
- const { checkedSet, disabledIdSet } = resolve(['gmail', 'lobe-image-generation']);
+ it('treats legacy pinned entries as Auto (not Disabled)', () => {
+ const { disabledIdSet } = resolve(['gmail', 'lobe-image-generation']);
- expect(checkedSet.has('gmail')).toBe(false);
expect(disabledIdSet.has('gmail')).toBe(false);
- // Legacy pins on configurable builtins also mean on demand.
- expect(checkedSet.has('lobe-image-generation')).toBe(false);
expect(disabledIdSet.has('lobe-image-generation')).toBe(false);
});
@@ -47,6 +41,14 @@ describe('resolveActivationSets', () => {
expect(disabledIdSet.has('slack')).toBe(true);
});
+ it('treats connectors as opt-in when discoverBuiltins is false (custom / chat mode)', () => {
+ const { disabledIdSet, optInIds } = resolve([{ identifier: 'gmail', mode: 'auto' }], false);
+
+ expect(disabledIdSet.has('gmail')).toBe(false);
+ expect(disabledIdSet.has('slack')).toBe(true);
+ expect(resolveImplicitMode('slack', optInIds)).toBe('disabled');
+ });
+
it('inherits Auto for a connector in agent mode', () => {
const { optInIds } = resolve([]);
diff --git a/src/features/ChatInput/ActionBar/Tools/useActivationSets.ts b/src/features/ChatInput/ActionBar/Tools/useActivationSets.ts
index 782bd0fa068..56673e4c9da 100644
--- a/src/features/ChatInput/ActionBar/Tools/useActivationSets.ts
+++ b/src/features/ChatInput/ActionBar/Tools/useActivationSets.ts
@@ -1,5 +1,5 @@
import { getLegacyDisabledBuiltinToolIds, onDemandBuiltinToolIds } from '@lobechat/builtin-tools';
-import { type AgentPluginEntry, type AgentPluginMode, getBuiltinOverrides } from '@lobechat/types';
+import { type AgentPluginEntry, getBuiltinOverrides } from '@lobechat/types';
import isEqual from 'fast-deep-equal';
import { useMemo } from 'react';
@@ -8,50 +8,35 @@ import {
getConnectorIdentifiers,
} from '@/helpers/toolEngineering/connectorActivation';
import { useToolStore } from '@/store/tool';
-import { agentSkillsSelectors } from '@/store/tool/slices/agentSkills/selectors';
import { resolveDisabledIds } from './librarySkillPolicy';
-/** A connector is two-state: on (found on demand) or off. It cannot be pinned. */
-export const CONNECTOR_MODES: AgentPluginMode[] = ['auto', 'disabled'];
-
/**
* The identifier sets the Tools popover groups its rows by.
*
- * Library skills require an explicit entry. Connected tools default to Auto in
- * agent mode and require an entry in custom toolsets. A connector also has no Pinned
- * state: an entry pinned before it lost that state reads as on, so it is listed
- * under Auto rather than Pinned.
+ * Connected tools and configurable builtins default to on-demand (`auto`) in
+ * Agent mode and require an explicit entry in Chat / Custom modes. A legacy
+ * `pinned` entry reads as on, so rows are strictly two-state (on-demand vs disabled).
*/
export const resolveActivationSets = ({
connectedConnectorIds,
connectorIds: connectorIdList,
- librarySkillIds,
discoverBuiltins = true,
- pinnedIds,
uninstalled = [],
rawPlugins,
}: {
- discoverBuiltins?: boolean;
- uninstalled?: readonly string[];
connectedConnectorIds: readonly string[];
connectorIds: readonly string[];
- librarySkillIds: readonly string[];
- /** The agent's pinned identifiers. */
- pinnedIds: readonly string[];
+ discoverBuiltins?: boolean;
/** The agent's raw `plugins` field, disabled and `auto` entries included. */
rawPlugins: AgentPluginEntry[] | undefined;
+ uninstalled?: readonly string[];
}) => {
const connectorIds = new Set(connectorIdList);
const connected = new Set(connectedConnectorIds);
- const optInIds = new Set(
- discoverBuiltins ? librarySkillIds : [...librarySkillIds, ...connectorIdList],
- );
+ const optInIds = new Set(discoverBuiltins ? [] : connectorIdList);
return {
- checkedSet: new Set(
- pinnedIds.filter((id) => !connectorIds.has(id) && !onDemandBuiltinToolIds.includes(id)),
- ),
connectorIds,
disabledIdSet: new Set([
...getLegacyDisabledBuiltinToolIds(uninstalled, getBuiltinOverrides(rawPlugins)),
@@ -69,7 +54,6 @@ export const resolveActivationSets = ({
/** {@link resolveActivationSets} over the tool store. */
export const useActivationSets = (
agentId: string,
- pinnedIds: string[],
rawPlugins: AgentPluginEntry[] | undefined,
discoverBuiltins: boolean,
) => {
@@ -81,8 +65,6 @@ export const useActivationSets = (
};
}, isEqual);
const uninstalled = useToolStore((s) => s.uninstalledBuiltinTools);
- const marketAgentSkills = useToolStore(agentSkillsSelectors.getMarketAgentSkills, isEqual);
- const userAgentSkills = useToolStore(agentSkillsSelectors.getUserAgentSkills, isEqual);
return useMemo(
() =>
@@ -90,22 +72,9 @@ export const useActivationSets = (
connectedConnectorIds,
connectorIds,
discoverBuiltins,
- librarySkillIds: [...marketAgentSkills, ...userAgentSkills].map(
- (skill) => skill.identifier,
- ),
- pinnedIds,
- uninstalled,
rawPlugins,
+ uninstalled,
}),
- [
- connectedConnectorIds,
- connectorIds,
- discoverBuiltins,
- marketAgentSkills,
- userAgentSkills,
- pinnedIds,
- uninstalled,
- rawPlugins,
- ],
+ [connectedConnectorIds, connectorIds, discoverBuiltins, rawPlugins, uninstalled],
);
};
diff --git a/src/features/ChatInput/ActionBar/Tools/useControls.styles.ts b/src/features/ChatInput/ActionBar/Tools/useControls.styles.ts
index bf5e3795183..fc7c58b228f 100644
--- a/src/features/ChatInput/ActionBar/Tools/useControls.styles.ts
+++ b/src/features/ChatInput/ActionBar/Tools/useControls.styles.ts
@@ -64,7 +64,6 @@ export const styles = stylex.create({
iconAuto: { color: cssVar.colorInfo },
iconDefault: { color: cssVar.colorTextTertiary },
iconDisabled: { color: cssVar.colorError },
- iconPinned: { color: cssVar.colorInfo },
policyButton: {
cursor: { 'default': 'pointer', ':disabled': 'not-allowed' },
display: 'inline-flex',
diff --git a/src/features/ChatInput/ActionBar/Tools/useControls.test.ts b/src/features/ChatInput/ActionBar/Tools/useControls.test.ts
index 7ce8674603d..659c4b8de90 100644
--- a/src/features/ChatInput/ActionBar/Tools/useControls.test.ts
+++ b/src/features/ChatInput/ActionBar/Tools/useControls.test.ts
@@ -227,26 +227,37 @@ describe('chat input tool picker', () => {
});
it.each(['lobe-image-generation', 'lobe-video-generation'])(
- 're-enables %s as a pin in either mode, so a later switch to Chat keeps it callable',
+ 're-enables %s as mode auto with builtinOverride in either mode',
async (id) => {
mocks.plugins = [{ identifier: id, mode: 'disabled' }];
const { result } = renderHook(() => useControls());
- // Agent mode: Chat requires a pin, and switching modes does not rewrite plugins.
mocks.chatMode = false;
await act(() => result.current.setPolicy(id, 'auto'));
expect(mocks.updateConfig).toHaveBeenLastCalledWith({
- plugins: [{ builtinOverride: true, identifier: id, mode: 'pinned' }],
+ plugins: [{ builtinOverride: true, identifier: id, mode: 'auto' }],
});
mocks.chatMode = true;
await act(() => result.current.setPolicy(id, 'auto'));
expect(mocks.updateConfig).toHaveBeenLastCalledWith({
- plugins: [{ builtinOverride: true, identifier: id, mode: 'pinned' }],
+ plugins: [{ builtinOverride: true, identifier: id, mode: 'auto' }],
});
},
);
+ it('writes an explicit auto entry when re-enabling a connector in agent mode', async () => {
+ mocks.composioEnabled = true;
+ mocks.composioServers = [{ identifier: 'gmail', status: ComposioServerStatus.ACTIVE }];
+ mocks.plugins = [{ identifier: 'gmail', mode: 'disabled' }];
+ const { result } = renderHook(() => useControls());
+
+ await act(() => result.current.setPolicy('gmail', 'auto'));
+ expect(mocks.updateConfig).toHaveBeenLastCalledWith({
+ plugins: [{ identifier: 'gmail', mode: 'auto' }],
+ });
+ });
+
it('only shows connectors with connection records and keeps rows needing authorization', () => {
mocks.composioEnabled = true;
mocks.composioServers = [
@@ -350,7 +361,6 @@ describe('chat input tool picker', () => {
it('derives the profile summary from the same unfiltered options as chat', () => {
const { result } = renderHook(() => useControls());
const active = leafKeys(result.current.marketItems);
- expect(result.current.activeTools.map((item) => item.id)).toEqual(active);
act(() => result.current.marketHeader.props.onFilterChange('disabled'));
const disabled = leafKeys(result.current.marketItems);
expect(disabled).toContain('lobe-web-browsing');
@@ -362,7 +372,9 @@ describe('chat input tool picker', () => {
);
expect(result.current.totalCount).toBe(active.length + disabled.length);
act(() => result.current.marketHeader.props.onSearchChange('no such tool'));
- expect(result.current.activeTools.map((item) => item.id)).toEqual(active);
+ expect(
+ result.current.toolOptions.filter((tool) => tool.enabled).map((tool) => tool.id),
+ ).toEqual(active);
});
it('offers only tool management in the footer, without an add-tools action', () => {
diff --git a/src/features/ChatInput/ActionBar/Tools/useControls.tsx b/src/features/ChatInput/ActionBar/Tools/useControls.tsx
index 751e862ff81..936bc2c5f06 100644
--- a/src/features/ChatInput/ActionBar/Tools/useControls.tsx
+++ b/src/features/ChatInput/ActionBar/Tools/useControls.tsx
@@ -1,6 +1,4 @@
-import { ImageGenerationIdentifier } from '@lobechat/builtin-tool-image-generation';
import { MemoryManifest } from '@lobechat/builtin-tool-memory';
-import { VideoGenerationIdentifier } from '@lobechat/builtin-tool-video-generation';
import { WebBrowsingManifest } from '@lobechat/builtin-tool-web-browsing';
import { isOnDemandBuiltinTool } from '@lobechat/builtin-tools';
import { getConnectorCatalog } from '@lobechat/const';
@@ -8,6 +6,7 @@ import {
parsePluginEntry,
resolveToolMode,
setBuiltinPluginMode,
+ upsertConnectorEnabled,
upsertPluginMode,
} from '@lobechat/types';
import type { ItemType } from '@lobehub/ui';
@@ -155,7 +154,6 @@ export const useControls = ({ closeDropdown }: { closeDropdown?: () => void } =
s.removeComposioConnection,
s.deleteConnector,
]);
- const checked = useAgentStore(agentByIdSelectors.getAgentPluginsById(agentId), isEqual);
const rawPlugins = useAgentStore(
(s) => agentByIdSelectors.getAgentConfigById(agentId)(s)?.plugins,
);
@@ -165,8 +163,11 @@ export const useControls = ({ closeDropdown }: { closeDropdown?: () => void } =
(s) =>
resolveToolMode(agentByIdSelectors.getAgentConfigById(agentId)(s)?.chatConfig) === 'agent',
);
- const activationSets = useActivationSets(agentId, checked, rawPlugins, discoverBuiltins);
- const { disabledIdSet, optInIds } = activationSets;
+ const { connectorIds, disabledIdSet, optInIds } = useActivationSets(
+ agentId,
+ rawPlugins,
+ discoverBuiltins,
+ );
const builtinList = useToolStore(builtinToolSelectors.metaListIncludingHidden, isEqual);
// Memory and web browsing are runtime-managed builtin tools: `hidden` keeps them
@@ -209,26 +210,23 @@ export const useControls = ({ closeDropdown }: { closeDropdown?: () => void } =
...(hasLegacyEntry && { plugins: upsertPluginMode(plugins, id, 'auto') }),
});
} else {
- // Chat has no activator: media generation reaches the model there only when pinned.
- // Pin it in every mode — the mode can switch later without rewriting plugins, and
- // Agent mode still loads a pinned on-demand builtin through the activator.
- const pinMediaTool =
- mode === 'auto' && (id === ImageGenerationIdentifier || id === VideoGenerationIdentifier);
await updateAgentConfig({
plugins: isOnDemandBuiltinTool(id)
- ? setBuiltinPluginMode(plugins, id, pinMediaTool ? 'pinned' : mode)
- : upsertPluginMode(
- plugins,
- id,
- pinMediaTool ? 'pinned' : mode,
- mode === 'auto' && !discoverBuiltins
- ? 'disabled'
- : resolveImplicitMode(id, optInIds),
- ),
+ ? setBuiltinPluginMode(plugins, id, mode)
+ : connectorIds.has(id)
+ ? upsertConnectorEnabled(plugins, id, mode === 'auto')
+ : upsertPluginMode(
+ plugins,
+ id,
+ mode,
+ mode === 'auto' && !discoverBuiltins
+ ? 'disabled'
+ : resolveImplicitMode(id, optInIds),
+ ),
});
}
},
- [agentId, canEdit, discoverBuiltins, optInIds, updateAgentConfig],
+ [agentId, canEdit, connectorIds, discoverBuiltins, optInIds, updateAgentConfig],
);
const openSkillPolicyMenu = useCallback((id: string) => {
@@ -1098,10 +1096,6 @@ export const useControls = ({ closeDropdown }: { closeDropdown?: () => void } =
searchText: item.searchText,
title: item.optionTitle,
})),
- activeTools: allAutoItems.map((item) => ({
- canDisable: !!item.canDisable,
- id: String(item.key),
- })),
canEdit,
setPolicy: updateSkillPolicy,
totalCount: allAutoItems.length + allDisabledItems.length,
diff --git a/src/features/Conversation/AgentWelcome/ToolAuthAlert.tsx b/src/features/Conversation/AgentWelcome/ToolAuthAlert.tsx
index 0130a003bfe..0f70bcecac4 100644
--- a/src/features/Conversation/AgentWelcome/ToolAuthAlert.tsx
+++ b/src/features/Conversation/AgentWelcome/ToolAuthAlert.tsx
@@ -1,6 +1,7 @@
'use client';
import type { TaskTemplateConnectorReference } from '@lobechat/const';
+import { getOptedInPluginIds } from '@lobechat/types';
import {
ActionIcon,
Alert,
@@ -27,7 +28,7 @@ import {
} from '@/features/RecommendTaskTemplates/useConnectorConnection';
import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';
import { useAgentStore } from '@/store/agent';
-import { agentByIdSelectors } from '@/store/agent/selectors';
+import { agentSelectors } from '@/store/agent/selectors';
import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';
import { useToolStore } from '@/store/tool';
import { ComposioServerStatus, composioStoreSelectors } from '@/store/tool/slices/composioStore';
@@ -422,7 +423,10 @@ const ToolAuthAlert = memo(() => {
const { t } = useTranslation('chat');
const agentId = useConversationStore(contextSelectors.agentId);
- const plugins = useAgentStore(agentByIdSelectors.getAgentPluginsById(agentId), isEqual);
+ const plugins = useAgentStore(
+ (s) => getOptedInPluginIds(agentSelectors.getAgentConfigById(agentId)(s)?.plugins),
+ isEqual,
+ );
const isComposioEnabled = useServerConfigStore(serverConfigSelectors.enableComposio);
const isLobehubSkillEnabled = useServerConfigStore(serverConfigSelectors.enableLobehubSkill);
const composioServers = useToolStore(composioStoreSelectors.getServers, isEqual);
diff --git a/src/features/DesktopNavigationBridge/index.test.tsx b/src/features/DesktopNavigationBridge/index.test.tsx
index b02249c36c3..4602018878c 100644
--- a/src/features/DesktopNavigationBridge/index.test.tsx
+++ b/src/features/DesktopNavigationBridge/index.test.tsx
@@ -31,7 +31,9 @@ vi.mock('@/features/AppLaunch/openDirectory', () => ({
openDirectoryInApp: openDirectoryInAppMock,
}));
-const getStateMock = vi.hoisted(() => vi.fn(() => ({ gatewayDeviceInfo: { deviceId: 'device-local' } })));
+const getStateMock = vi.hoisted(() =>
+ vi.fn(() => ({ gatewayDeviceInfo: { deviceId: 'device-local' } })),
+);
vi.mock('@/store/electron', () => ({
useElectronStore: Object.assign(() => undefined, { getState: getStateMock }),
diff --git a/src/features/ProfileEditor/AgentTool.tsx b/src/features/ProfileEditor/AgentTool.tsx
index ab85dc15097..0a8c8e1a560 100644
--- a/src/features/ProfileEditor/AgentTool.tsx
+++ b/src/features/ProfileEditor/AgentTool.tsx
@@ -143,7 +143,6 @@ const AgentTool = memo<AgentToolProps>(
const activeAgentId = useAgentStore((s) => s.activeAgentId);
const effectiveAgentId = agentId || activeAgentId || '';
const config = useAgentStore(agentSelectors.getAgentConfigById(effectiveAgentId), isEqual);
- const isManualSkillMode = config?.chatConfig?.skillActivateMode === 'manual';
// Workspace General access on this agent. A private agent is creator-only and
// has no shared access row, so skip the query for it (same shape as the
// prompt editor's gate). Only the automatic stale-plugin cleanup below reads
@@ -170,9 +169,7 @@ const AgentTool = memo<AgentToolProps>(
);
const profileBuiltinList = useToolStore(
useAllMetaList
- ? builtinToolSelectors.installedProfileConfigurableMetaList({
- isManualMode: isManualSkillMode,
- })
+ ? builtinToolSelectors.installedProfileConfigurableMetaList
: builtinToolSelectors.metaList,
isEqual,
);
@@ -226,9 +223,7 @@ const AgentTool = memo<AgentToolProps>(
}, [implicitToolIds, config?.plugins, disabledToolIds]);
const nonProfileConfigurableBuiltinToolIds = useToolStore(
- builtinToolSelectors.nonProfileConfigurableBuiltinToolIds({
- isManualMode: isManualSkillMode,
- }),
+ builtinToolSelectors.nonProfileConfigurableBuiltinToolIds,
isEqual,
);
const nonProfileConfigurableBuiltinToolIdentifiers = useMemo(
diff --git a/src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx b/src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx
index 182a5131755..02d4d5e8c9b 100644
--- a/src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx
+++ b/src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx
@@ -94,7 +94,7 @@ const CustomPluginInstallModal = memo<CustomPluginInstallModalProps>(
identifier: schema.identifier,
name: schema.name,
});
- await togglePlugin(schema.identifier);
+ await togglePlugin(schema.identifier, true);
toast.success(t('protocolInstall.messages.installSuccess', { name: schema.name }));
onComplete?.();
diff --git a/src/features/Settings/skill/features/Actions.tsx b/src/features/Settings/skill/features/Actions.tsx
index 9bcf1f39bf4..be48dd47ef1 100644
--- a/src/features/Settings/skill/features/Actions.tsx
+++ b/src/features/Settings/skill/features/Actions.tsx
@@ -1,3 +1,4 @@
+import { parsePluginEntry } from '@lobechat/types';
import { Button, confirmModal, DropdownMenu, Flexbox, Icon, stopPropagation } from '@lobehub/ui';
import { MoreHorizontalIcon, Trash2 } from 'lucide-react';
import { memo, useState } from 'react';
@@ -39,9 +40,12 @@ const Actions = memo<ActionsProps>(({ identifier, type, isMCP }) => {
const plugin = useToolStore(pluginSelectors.getToolManifestById(identifier));
const { allowed: canCreate } = usePermission('create_content');
const { allowed: canEdit } = usePermission('edit_own_content');
- const [togglePlugin, isPluginEnabledInAgent] = useAgentStore((s) => [
+ const [togglePlugin, removePlugin, hasPluginEntry] = useAgentStore((s) => [
s.togglePlugin,
- agentSelectors.currentAgentPlugins(s).includes(identifier),
+ s.removePlugin,
+ (agentSelectors.currentAgentConfig(s)?.plugins ?? []).some(
+ (entry) => parsePluginEntry(entry).identifier === identifier,
+ ),
]);
// A marketplace MCP installed as a connector, a reinstall over a legacy row
// included: its tools run on the connector, so its settings are edited there,
@@ -116,9 +120,9 @@ const Actions = memo<ActionsProps>(({ identifier, type, isMCP }) => {
confirmModal({
okButtonProps: { danger: true },
onOk: async () => {
- // If plugin is enabled in current agent, disable it first
- if (isPluginEnabledInAgent) {
- await togglePlugin(identifier, false);
+ // Drop any agent-level entry (auto / pinned / disabled) before uninstalling
+ if (hasPluginEntry) {
+ await removePlugin(identifier);
}
await unInstallPlugin(identifier);
},
@@ -142,7 +146,7 @@ const Actions = memo<ActionsProps>(({ identifier, type, isMCP }) => {
if (!canCreate || !canEdit) return;
if (isMCP) {
await installMCPPlugin(identifier);
- await togglePlugin(identifier);
+ await togglePlugin(identifier, true);
}
}}
>
diff --git a/src/features/ShareModal/ShareImage/Preview.tsx b/src/features/ShareModal/ShareImage/Preview.tsx
index 9bafa9d820c..1ecf666d78b 100644
--- a/src/features/ShareModal/ShareImage/Preview.tsx
+++ b/src/features/ShareModal/ShareImage/Preview.tsx
@@ -1,5 +1,10 @@
import { DEFAULT_INBOX_TITLE } from '@lobechat/const';
-import { agentDisplayName, type ConversationContext, type UIChatMessage } from '@lobechat/types';
+import {
+ agentDisplayName,
+ type ConversationContext,
+ getOptedInPluginIds,
+ type UIChatMessage,
+} from '@lobechat/types';
import { cx, Flexbox, Markdown, Text } from '@lobehub/ui';
import { memo } from 'react';
@@ -60,7 +65,7 @@ const Preview = memo<PreviewProps>(
return [
s.activeAgentId,
agentSelectors.currentAgentModel(s),
- agentSelectors.displayableAgentPlugins(s),
+ filterToolIds(getOptedInPluginIds(agentSelectors.currentAgentConfig(s)?.plugins)),
agentSelectors.currentAgentSystemRole(s),
builtinAgentSelectors.isInboxAgent(s),
agentSelectors.currentAgentDisplayName(s),
@@ -73,7 +78,11 @@ const Preview = memo<PreviewProps>(
? agentByIdSelectors.getAgentModelById(resolvedHeaderAgentId)(s)
: undefined,
resolvedHeaderAgentId
- ? filterToolIds(agentByIdSelectors.getAgentPluginsById(resolvedHeaderAgentId)(s))
+ ? filterToolIds(
+ getOptedInPluginIds(
+ agentSelectors.getAgentConfigById(resolvedHeaderAgentId)(s)?.plugins,
+ ),
+ )
: undefined,
resolvedHeaderAgentId
? builtinAgentSelectors.inboxAgentId(s) === resolvedHeaderAgentId
diff --git a/src/features/SkillStore/SkillList/Community/Item.tsx b/src/features/SkillStore/SkillList/Community/Item.tsx
index 31812b24623..9105e2ec3ed 100644
--- a/src/features/SkillStore/SkillList/Community/Item.tsx
+++ b/src/features/SkillStore/SkillList/Community/Item.tsx
@@ -1,5 +1,6 @@
'use client';
+import { parsePluginEntry } from '@lobechat/types';
import {
ActionIcon,
Block,
@@ -65,9 +66,12 @@ const Item = memo<DiscoverMcpItem>(({ name, description, icon, identifier }) =>
isEqual,
);
- const [togglePlugin, isPluginEnabledInAgent] = useAgentStore((s) => [
+ const [togglePlugin, removePlugin, hasPluginEntry] = useAgentStore((s) => [
s.togglePlugin,
- agentSelectors.currentAgentPlugins(s).includes(identifier),
+ s.removePlugin,
+ (agentSelectors.currentAgentConfig(s)?.plugins ?? []).some(
+ (entry) => parsePluginEntry(entry).identifier === identifier,
+ ),
]);
const { isAuthenticated, signIn } = useMarketAuth();
@@ -86,7 +90,7 @@ const Item = memo<DiscoverMcpItem>(({ name, description, icon, identifier }) =>
const isSuccess = await installMCPPlugin(identifier);
if (isSuccess) {
- await togglePlugin(identifier);
+ await togglePlugin(identifier, true);
}
};
@@ -112,8 +116,8 @@ const Item = memo<DiscoverMcpItem>(({ name, description, icon, identifier }) =>
confirmModal({
okButtonProps: { danger: true },
onOk: async () => {
- if (isPluginEnabledInAgent) {
- await togglePlugin(identifier, false);
+ if (hasPluginEntry) {
+ await removePlugin(identifier);
}
await unInstallPlugin(identifier);
},
diff --git a/src/helpers/toolEngineering/connectorActivation.ts b/src/helpers/toolEngineering/connectorActivation.ts
index dca96ca677d..20b052dc46f 100644
--- a/src/helpers/toolEngineering/connectorActivation.ts
+++ b/src/helpers/toolEngineering/connectorActivation.ts
@@ -79,7 +79,7 @@ export interface AgentConnectorActivation {
export const resolveAgentConnectorActivation = (
agent: {
id?: string;
- chatConfig?: Pick<LobeAgentChatConfig, 'enableAgentMode' | 'skillActivateMode' | 'toolMode'>;
+ chatConfig?: Pick<LobeAgentChatConfig, 'enableAgentMode' | 'toolMode'>;
enabledPluginIds?: readonly string[];
/** The raw `plugins` field, before it is collapsed to pinned identifiers. */
plugins?: AgentPluginEntry[];
diff --git a/src/helpers/toolEngineering/index.ts b/src/helpers/toolEngineering/index.ts
index c0a4f744b76..be5cc52901c 100644
--- a/src/helpers/toolEngineering/index.ts
+++ b/src/helpers/toolEngineering/index.ts
@@ -275,9 +275,9 @@ export const createAgentToolsEngine = (
chatConfig,
plugins: applyAgentConnectorActivation(
options.runAgent?.enabledPluginIds ??
- getActivePluginIds(agent.plugins).filter(
- (id) => resolveToolMode(chatConfig) !== 'agent' || !isOnDemandBuiltinTool(id),
- ),
+ (resolveToolMode(chatConfig) === 'agent'
+ ? getActivePluginIds(agent.plugins).filter((id) => !isOnDemandBuiltinTool(id))
+ : getOptedInPluginIds(agent.plugins)),
connectors,
),
},
diff --git a/src/helpers/toolEngineering/index.twoStateMode.test.ts b/src/helpers/toolEngineering/index.twoStateMode.test.ts
new file mode 100644
index 00000000000..3b6725e0dce
--- /dev/null
+++ b/src/helpers/toolEngineering/index.twoStateMode.test.ts
@@ -0,0 +1,107 @@
+import { ImageGenerationManifest } from '@lobechat/builtin-tool-image-generation';
+import { TaskManifest } from '@lobechat/builtin-tool-task';
+import { describe, expect, it, vi } from 'vitest';
+
+import { createAgentToolsEngine } from './index';
+
+vi.mock('@/store/tool', () => ({
+ getToolStoreState: () => ({
+ agentConnectors: {},
+ builtinSkills: [],
+ builtinTools: [
+ {
+ identifier: ImageGenerationManifest.identifier,
+ manifest: ImageGenerationManifest,
+ type: 'builtin' as const,
+ },
+ {
+ identifier: TaskManifest.identifier,
+ manifest: TaskManifest,
+ type: 'builtin' as const,
+ },
+ ],
+ composioServers: [],
+ connectors: [],
+ installedPlugins: [],
+ lobehubSkillServers: [],
+ uninstalledBuiltinTools: [],
+ uninstalledBuiltinToolsReplica: { entries: {} },
+ }),
+}));
+vi.mock('@/store/agent', () => ({
+ getAgentStoreState: () => ({
+ activeAgentId: 'agent-1',
+ agentMap: { 'agent-1': { chatConfig: {}, plugins: [] } },
+ }),
+}));
+vi.mock('@/store/aiInfra', () => ({
+ aiModelSelectors: {
+ isModelSupportImageOutput: () => () => false,
+ },
+ getAiInfraStoreState: () => ({}),
+}));
+vi.mock('@/store/serverConfig', () => ({ getServerConfigStoreState: () => undefined }));
+vi.mock('@/store/user', () => ({
+ useUserStore: { getState: () => ({}) },
+}));
+vi.mock('@/store/user/selectors', () => ({
+ settingsSelectors: {
+ defaultAgentConfig: () => ({ chatConfig: {} }),
+ memoryEnabled: () => false,
+ },
+}));
+vi.mock('../getSearchConfig', () => ({
+ getSearchConfig: () => ({ useApplicationBuiltinSearchTool: false }),
+}));
+vi.mock('../isCanUseFC', () => ({ isCanUseFC: () => true }));
+vi.mock('../toolAvailability', () => ({ isToolAvailableInCurrentEnv: () => true }));
+
+describe('createAgentToolsEngine two-state mode parity', () => {
+ it('invokes an opted-in on-demand builtin in custom mode without requiring a legacy pin', () => {
+ const result = createAgentToolsEngine(
+ { model: 'gpt-4', provider: 'openai' },
+ undefined,
+ undefined,
+ {
+ runAgent: {
+ chatConfig: { toolMode: 'custom' },
+ plugins: [{ builtinOverride: true, identifier: TaskManifest.identifier, mode: 'auto' }],
+ },
+ uninstalledBuiltinTools: [],
+ },
+ ).generateToolsDetailed({
+ model: 'gpt-4',
+ provider: 'openai',
+ toolIds: [],
+ });
+
+ expect(result.enabledToolIds).toEqual([TaskManifest.identifier]);
+ });
+
+ it('enables image generation in Chat mode when stored as mode auto', () => {
+ const result = createAgentToolsEngine(
+ { model: 'gpt-4', provider: 'openai' },
+ undefined,
+ undefined,
+ {
+ runAgent: {
+ chatConfig: { enableAgentMode: false },
+ plugins: [
+ {
+ builtinOverride: true,
+ identifier: ImageGenerationManifest.identifier,
+ mode: 'auto',
+ },
+ ],
+ },
+ uninstalledBuiltinTools: [],
+ },
+ ).generateToolsDetailed({
+ model: 'gpt-4',
+ provider: 'openai',
+ toolIds: [],
+ });
+
+ expect(result.enabledToolIds).toContain(ImageGenerationManifest.identifier);
+ });
+});
diff --git a/src/services/chat/mecha/contextFactProviders.ts b/src/services/chat/mecha/contextFactProviders.ts
index e5b2a1d5201..dbdf1b946b2 100644
--- a/src/services/chat/mecha/contextFactProviders.ts
+++ b/src/services/chat/mecha/contextFactProviders.ts
@@ -1,7 +1,7 @@
import { AGENT_PLAN_FILE_TYPE, isDesktop } from '@lobechat/const';
import type { AvailablePluginInfo } from '@lobechat/context-engine';
import type { ContextFactProviders, ContextFactRequest, CredentialSummary } from '@lobechat/mecha';
-import { type AgentShareVisitorContext, getActivePluginIds } from '@lobechat/types';
+import { type AgentShareVisitorContext, getOptedInPluginIds } from '@lobechat/types';
import { getActiveWorkspaceSlug } from '@/business/client/hooks/useActiveWorkspaceSlug';
import { lambdaClient } from '@/libs/trpc/client';
@@ -146,7 +146,7 @@ export const createBrowserContextFactProviders = ({
openingMessage: config.openingMessage,
openingQuestions: config.openingQuestions,
params: config.params as Record<string, unknown> | undefined,
- plugins: getActivePluginIds(config.plugins),
+ plugins: getOptedInPluginIds(config.plugins),
provider: config.provider,
systemRole: config.systemRole,
tags: meta?.tags,
diff --git a/src/store/agent/selectors/agentByIdSelectors.ts b/src/store/agent/selectors/agentByIdSelectors.ts
index 0a4c23d31f4..1dd81b65fea 100644
--- a/src/store/agent/selectors/agentByIdSelectors.ts
+++ b/src/store/agent/selectors/agentByIdSelectors.ts
@@ -9,6 +9,7 @@ import { type AgentBuilderContext } from '@lobechat/context-engine';
import {
type AgentMode,
getActivePluginIds,
+ getOptedInPluginIds,
getWorkingDirEffectivePath,
type LobeAgentAgencyConfig,
type LobeAgentTTSConfig,
@@ -184,9 +185,8 @@ const getAgentBuilderContextById =
openingMessage: config?.openingMessage,
openingQuestions: config?.openingQuestions,
params: config?.params,
- // Pinned identifiers only — AgentBuilderContext.config.plugins is a
- // display DTO (still string[]); a disabled plugin isn't "enabled".
- plugins: getActivePluginIds(config?.plugins),
+ // Opted-in identifiers (`auto` + legacy `pinned`) — excludes explicitly disabled plugins.
+ plugins: getOptedInPluginIds(config?.plugins),
provider: config?.provider,
systemRole: config?.systemRole,
},
diff --git a/src/store/agent/selectors/chatConfigByIdSelectors.ts b/src/store/agent/selectors/chatConfigByIdSelectors.ts
index 8d83e51ef69..4a677e0a1e1 100644
--- a/src/store/agent/selectors/chatConfigByIdSelectors.ts
+++ b/src/store/agent/selectors/chatConfigByIdSelectors.ts
@@ -99,11 +99,6 @@ const getRuntimeModeById =
(s: AgentStoreState): RuntimeEnvMode =>
executionTargetToRuntimeMode(getExecutionTargetById(agentId)(s));
-const getSkillActivateModeById =
- (agentId: string) =>
- (s: AgentStoreState): 'auto' | 'manual' =>
- getChatConfigById(agentId)(s).skillActivateMode ?? 'auto';
-
/**
* Resolve the agent's tool mode via the shared `resolveToolMode` helper, so
* client and server agree on what counts as chat mode.
@@ -126,7 +121,6 @@ export const chatConfigByIdSelectors = {
getRuntimeModeById,
getSearchFCModelById,
getSearchModeById,
- getSkillActivateModeById,
getToolModeById,
getUseModelBuiltinSearchById,
isChatModeById,
diff --git a/src/store/agent/selectors/chatConfigSelectors.ts b/src/store/agent/selectors/chatConfigSelectors.ts
index 82d35aeaa78..7c559b37853 100644
--- a/src/store/agent/selectors/chatConfigSelectors.ts
+++ b/src/store/agent/selectors/chatConfigSelectors.ts
@@ -37,9 +37,6 @@ const isLocalSystemEnabled = (s: AgentStoreState) =>
const isCloudSandboxEnabled = (s: AgentStoreState) =>
chatConfigByIdSelectors.getRuntimeModeById(s.activeAgentId || '')(s) === 'cloud';
-const skillActivateMode = (s: AgentStoreState) =>
- chatConfigByIdSelectors.getSkillActivateModeById(s.activeAgentId || '')(s);
-
const enableHistoryDivider =
(historyLength: number, currentIndex: number) => (s: AgentStoreState) => {
const config = currentChatConfig(s);
@@ -62,6 +59,5 @@ export const agentChatConfigSelectors = {
isLocalSystemEnabled,
isMemoryToolEnabled,
searchFCModel,
- skillActivateMode,
useModelBuiltinSearch,
};
diff --git a/src/store/agent/selectors/selectors.test.ts b/src/store/agent/selectors/selectors.test.ts
index f006ee407f9..a22c5f7a118 100644
--- a/src/store/agent/selectors/selectors.test.ts
+++ b/src/store/agent/selectors/selectors.test.ts
@@ -271,23 +271,6 @@ describe('agentSelectors', () => {
});
});
- describe('currentAgentDisabledPlugins', () => {
- it('returns only the disabled identifiers from a mixed-shape plugins array', () => {
- const state = createState(mixedPluginsInput());
-
- expect(agentSelectors.currentAgentDisabledPlugins(state)).toEqual(['plugin-2']);
- });
-
- it('returns an empty array when there are no plugins', () => {
- const state = createState({
- activeAgentId: 'agent-1',
- agentMap: { 'agent-1': {} },
- });
-
- expect(agentSelectors.currentAgentDisabledPlugins(state)).toEqual([]);
- });
- });
-
describe('currentAgentKnowledgeBases', () => {
it('should return knowledge bases array', () => {
const state = createState({
diff --git a/src/store/agent/selectors/selectors.ts b/src/store/agent/selectors/selectors.ts
index 636b6904f1a..ec2c4654808 100644
--- a/src/store/agent/selectors/selectors.ts
+++ b/src/store/agent/selectors/selectors.ts
@@ -13,7 +13,6 @@ import {
type AgentMode,
type AgentProfile,
getActivePluginIds,
- getDisabledPluginIds,
getWorkingDirEffectivePath,
type KnowledgeItem,
KnowledgeType,
@@ -194,19 +193,6 @@ const currentAgentPlugins = (s: AgentStoreState) => {
return getActivePluginIds(config?.plugins);
};
-/**
- * Disabled plugin identifiers for the current agent. Consumers that build a
- * tool/skill candidate pool (not just the "always whitelisted" rule map)
- * need this to actually drop a disabled entry from the pool — being absent
- * from `currentAgentPlugins` alone doesn't stop it from being present (and
- * explicit-activation-eligible) in an unfiltered manifest source.
- */
-const currentAgentDisabledPlugins = (s: AgentStoreState) => {
- const config = currentAgentConfig(s);
-
- return getDisabledPluginIds(config?.plugins);
-};
-
/**
* Get displayable agent plugins by filtering out platform-specific tools
* that shouldn't be shown in the current environment
@@ -417,7 +403,6 @@ export const agentSelectors = {
currentAgentRuntimeEnvConfig,
currentAgentMeta,
currentAgentMode,
- currentAgentDisabledPlugins,
currentAgentModel,
currentAgentModelProvider,
currentAgentPlugins,
diff --git a/src/store/agent/slices/agent/action.ts b/src/store/agent/slices/agent/action.ts
index e2a78ea48a6..b7b0154d08f 100644
--- a/src/store/agent/slices/agent/action.ts
+++ b/src/store/agent/slices/agent/action.ts
@@ -414,26 +414,10 @@ export class AgentSliceActionImpl {
};
toggleAgentPlugin = async (pluginId: string, state?: boolean): Promise<void> => {
- const { activeAgentId, agentMap, updateAgentConfig } = this.#get();
+ const { activeAgentId, togglePlugin } = this.#get();
if (!activeAgentId) return;
- const currentPlugins = (agentMap[activeAgentId]?.plugins as string[]) || [];
- const hasPlugin = currentPlugins.includes(pluginId);
-
- // Determine new state
- const shouldEnable = state !== undefined ? state : !hasPlugin;
-
- let newPlugins: string[];
- if (shouldEnable && !hasPlugin) {
- newPlugins = [...currentPlugins, pluginId];
- } else if (!shouldEnable && hasPlugin) {
- newPlugins = currentPlugins.filter((id) => id !== pluginId);
- } else {
- // No change needed
- return;
- }
-
- await updateAgentConfig({ plugins: newPlugins });
+ await togglePlugin(pluginId, state);
};
updateAgentChatConfig = async (
diff --git a/src/store/agent/slices/plugin/action.firstScreen.test.ts b/src/store/agent/slices/plugin/action.firstScreen.test.ts
new file mode 100644
index 00000000000..cf23c08500d
--- /dev/null
+++ b/src/store/agent/slices/plugin/action.firstScreen.test.ts
@@ -0,0 +1,18 @@
+import { readFileSync } from 'node:fs';
+import path from 'node:path';
+
+import { describe, expect, it } from 'vitest';
+
+describe('agent plugin slice — first-screen imports', () => {
+ // This store is on the first screen. A static import of the builtin-tools entry
+ // pulls every tool manifest into the entry chunk (+327 KB gzip on the size gate).
+ it.each(['@lobechat/builtin-tools', '@lobechat/mecha/builtinSkillGate'])(
+ 'does not statically import %s',
+ (specifier) => {
+ const source = readFileSync(path.join(__dirname, 'action.ts'), 'utf8');
+ const staticImport = new RegExp(`^import(?!\\s+type)[^;]*from '${specifier}'`, 'm');
+
+ expect(source).not.toMatch(staticImport);
+ },
+ );
+});
diff --git a/src/store/agent/slices/plugin/action.test.ts b/src/store/agent/slices/plugin/action.test.ts
index fba140aa319..7766b65e011 100644
--- a/src/store/agent/slices/plugin/action.test.ts
+++ b/src/store/agent/slices/plugin/action.test.ts
@@ -30,11 +30,11 @@ afterEach(() => {
describe('PluginSlice Actions', () => {
describe('togglePlugin', () => {
- it('should add plugin when not in list', async () => {
+ it('should enable plugin as mode auto when not in list', async () => {
const { result } = renderHook(() => useAgentStore());
vi.mocked(agentService.updateAgentConfig).mockResolvedValue({
- agent: { plugins: ['plugin-1'] } as any,
+ agent: { plugins: [{ identifier: 'plugin-1', mode: 'auto' }] } as any,
success: true,
});
@@ -52,18 +52,18 @@ describe('PluginSlice Actions', () => {
expect(agentService.updateAgentConfig).toHaveBeenCalledWith(
'agent-1',
expect.objectContaining({
- plugins: [{ identifier: 'plugin-1', mode: 'pinned' }],
+ plugins: [{ identifier: 'plugin-1', mode: 'auto' }],
}),
expect.any(AbortSignal),
undefined,
);
});
- it('should remove plugin when in list', async () => {
+ it('should disable plugin when already enabled (legacy string or auto object)', async () => {
const { result } = renderHook(() => useAgentStore());
vi.mocked(agentService.updateAgentConfig).mockResolvedValue({
- agent: { plugins: [] } as any,
+ agent: { plugins: [{ identifier: 'plugin-1', mode: 'disabled' }] } as any,
success: true,
});
@@ -81,18 +81,49 @@ describe('PluginSlice Actions', () => {
expect(agentService.updateAgentConfig).toHaveBeenCalledWith(
'agent-1',
expect.objectContaining({
- plugins: [],
+ plugins: [{ identifier: 'plugin-1', mode: 'disabled' }],
+ }),
+ expect.any(AbortSignal),
+ undefined,
+ );
+ });
+
+ it('keeps the toggle on its Agent when the user switches while it loads', async () => {
+ vi.mocked(agentService.updateAgentConfig).mockResolvedValue({
+ agent: { plugins: [{ identifier: 'plugin-1', mode: 'auto' }] } as any,
+ success: true,
+ });
+
+ useAgentStore.setState({
+ activeAgentId: 'agent-1',
+ agentMap: {
+ 'agent-1': { plugins: [] } as any,
+ 'agent-2': { plugins: [] } as any,
+ },
+ });
+
+ await act(async () => {
+ const toggle = useAgentStore.getState().togglePlugin('plugin-1', true);
+ useAgentStore.setState({ activeAgentId: 'agent-2' });
+ await toggle;
+ });
+
+ expect(agentService.updateAgentConfig).toHaveBeenCalledTimes(1);
+ expect(agentService.updateAgentConfig).toHaveBeenCalledWith(
+ 'agent-1',
+ expect.objectContaining({
+ plugins: [{ identifier: 'plugin-1', mode: 'auto' }],
}),
expect.any(AbortSignal),
undefined,
);
});
- it('should add plugin when open=true explicitly', async () => {
+ it('should enable plugin as mode auto when open=true explicitly', async () => {
const { result } = renderHook(() => useAgentStore());
vi.mocked(agentService.updateAgentConfig).mockResolvedValue({
- agent: { plugins: ['plugin-1'] } as any,
+ agent: { plugins: [{ identifier: 'plugin-1', mode: 'auto' }] } as any,
success: true,
});
@@ -110,18 +141,18 @@ describe('PluginSlice Actions', () => {
expect(agentService.updateAgentConfig).toHaveBeenCalledWith(
'agent-1',
expect.objectContaining({
- plugins: [{ identifier: 'plugin-1', mode: 'pinned' }],
+ plugins: [{ identifier: 'plugin-1', mode: 'auto' }],
}),
expect.any(AbortSignal),
undefined,
);
});
- it('should remove plugin when open=false explicitly', async () => {
+ it('should disable plugin explicitly when open=false', async () => {
const { result } = renderHook(() => useAgentStore());
vi.mocked(agentService.updateAgentConfig).mockResolvedValue({
- agent: { plugins: [] } as any,
+ agent: { plugins: [{ identifier: 'plugin-1', mode: 'disabled' }] } as any,
success: true,
});
@@ -139,18 +170,18 @@ describe('PluginSlice Actions', () => {
expect(agentService.updateAgentConfig).toHaveBeenCalledWith(
'agent-1',
expect.objectContaining({
- plugins: [],
+ plugins: [{ identifier: 'plugin-1', mode: 'disabled' }],
}),
expect.any(AbortSignal),
undefined,
);
});
- it('should not add duplicate plugin', async () => {
+ it('should not add duplicate plugin and should upgrade legacy entries in place', async () => {
const { result } = renderHook(() => useAgentStore());
vi.mocked(agentService.updateAgentConfig).mockResolvedValue({
- agent: { plugins: ['plugin-1'] } as any,
+ agent: { plugins: [{ identifier: 'plugin-1', mode: 'auto' }] } as any,
success: true,
});
@@ -165,11 +196,76 @@ describe('PluginSlice Actions', () => {
await result.current.togglePlugin('plugin-1', true);
});
- // Should still have only one plugin-1 (upgraded in place to object shape)
expect(agentService.updateAgentConfig).toHaveBeenCalledWith(
'agent-1',
expect.objectContaining({
- plugins: [{ identifier: 'plugin-1', mode: 'pinned' }],
+ plugins: [{ identifier: 'plugin-1', mode: 'auto' }],
+ }),
+ expect.any(AbortSignal),
+ undefined,
+ );
+ });
+
+ it('sets builtinOverride when toggling an on-demand builtin tool', async () => {
+ const { result } = renderHook(() => useAgentStore());
+
+ vi.mocked(agentService.updateAgentConfig).mockResolvedValue({
+ agent: { plugins: [] } as any,
+ success: true,
+ });
+
+ act(() => {
+ useAgentStore.setState({
+ activeAgentId: 'agent-1',
+ agentMap: {
+ 'agent-1': {
+ plugins: [{ identifier: 'lobe-calculator', mode: 'disabled' }],
+ } as any,
+ },
+ });
+ });
+
+ await act(async () => {
+ await result.current.togglePlugin('lobe-calculator', true);
+ });
+
+ expect(agentService.updateAgentConfig).toHaveBeenCalledWith(
+ 'agent-1',
+ expect.objectContaining({
+ plugins: [{ builtinOverride: true, identifier: 'lobe-calculator', mode: 'auto' }],
+ }),
+ expect.any(AbortSignal),
+ undefined,
+ );
+ });
+
+ it('toggleAgentPlugin flips a disabled object entry in place without appending duplicates', async () => {
+ const { result } = renderHook(() => useAgentStore());
+
+ vi.mocked(agentService.updateAgentConfig).mockResolvedValue({
+ agent: { plugins: [] } as any,
+ success: true,
+ });
+
+ act(() => {
+ useAgentStore.setState({
+ activeAgentId: 'agent-1',
+ agentMap: {
+ 'agent-1': {
+ plugins: [{ identifier: 'github', mode: 'disabled' }],
+ } as any,
+ },
+ });
+ });
+
+ await act(async () => {
+ await result.current.toggleAgentPlugin('github', true);
+ });
+
+ expect(agentService.updateAgentConfig).toHaveBeenCalledWith(
+ 'agent-1',
+ expect.objectContaining({
+ plugins: [{ identifier: 'github', mode: 'auto' }],
}),
expect.any(AbortSignal),
undefined,
@@ -180,7 +276,7 @@ describe('PluginSlice Actions', () => {
const { result } = renderHook(() => useAgentStore());
vi.mocked(agentService.updateAgentConfig).mockResolvedValue({
- agent: { plugins: ['plugin-1'] } as any,
+ agent: { plugins: [{ identifier: 'plugin-1', mode: 'auto' }] } as any,
success: true,
});
@@ -198,7 +294,7 @@ describe('PluginSlice Actions', () => {
expect(agentService.updateAgentConfig).toHaveBeenCalledWith(
'agent-1',
expect.objectContaining({
- plugins: [{ identifier: 'plugin-1', mode: 'pinned' }],
+ plugins: [{ identifier: 'plugin-1', mode: 'auto' }],
}),
expect.any(AbortSignal),
undefined,
@@ -207,7 +303,7 @@ describe('PluginSlice Actions', () => {
});
describe('removePlugin', () => {
- it('should call togglePlugin with open=false', async () => {
+ it('should drop an existing entry regardless of mode', async () => {
const { result } = renderHook(() => useAgentStore());
vi.mocked(agentService.updateAgentConfig).mockResolvedValue({
@@ -218,7 +314,9 @@ describe('PluginSlice Actions', () => {
act(() => {
useAgentStore.setState({
activeAgentId: 'agent-1',
- agentMap: { 'agent-1': { plugins: ['plugin-1'] } as any },
+ agentMap: {
+ 'agent-1': { plugins: [{ identifier: 'plugin-1', mode: 'disabled' }] } as any,
+ },
});
});
diff --git a/src/store/agent/slices/plugin/action.ts b/src/store/agent/slices/plugin/action.ts
index a772d7c9bff..0b059cd1804 100644
--- a/src/store/agent/slices/plugin/action.ts
+++ b/src/store/agent/slices/plugin/action.ts
@@ -1,4 +1,10 @@
-import { type AgentPluginMode, getPluginMode, upsertPluginMode } from '@lobechat/types';
+import {
+ type AgentPluginMode,
+ parsePluginEntry,
+ setBuiltinPluginMode,
+ upsertConnectorEnabled,
+ upsertPluginMode,
+} from '@lobechat/types';
import { produce } from 'immer';
import { type StoreSetter } from '@/store/types';
@@ -24,25 +30,43 @@ export class PluginSliceActionImpl {
this.#get = get;
}
+ /** Drops an entry from `plugins` entirely (used when uninstalling or clearing deprecated items). */
removePlugin = async (id: string): Promise<void> => {
- await this.#get().togglePlugin(id, false);
+ await this.setPluginMode(id, 'auto');
};
/**
- * Boolean pin/unpin toggle, kept for the many callers that only ever
- * add-to-agent or remove-from-agent (no disabled concept). Internally
- * upgrades to `upsertPluginMode` so the write path is unified with
- * `setPluginMode`; callers that need the third (disabled) state should use
- * `setPluginMode` directly instead.
+ * Two-state enable/disable toggle (`auto` vs `disabled`).
+ * Builtin tools and skills record `builtinOverride: true` so an explicit
+ * per-agent choice overrides any legacy library-wide uninstall.
*/
togglePlugin = async (id: string, open?: boolean): Promise<void> => {
- const originConfig = agentSelectors.currentAgentConfig(this.#get());
+ // Pin the Agent first: the user may switch Agents while the chunks load.
+ const agentId = this.#get().activeAgentId;
+ if (!agentId) return;
+
+ // This store is on the first screen; the builtin-tools entry carries every tool manifest.
+ const [{ isOnDemandBuiltinTool }, { legacyBuiltinSkillIds }] = await Promise.all([
+ import('@lobechat/builtin-tools'),
+ import('@lobechat/mecha/builtinSkillGate'),
+ ]);
+
+ const originConfig = agentSelectors.getAgentConfigById(agentId)(this.#get());
if (!originConfig) return;
- const shouldOpen =
- open !== undefined ? open : getPluginMode(originConfig.plugins, id) !== 'pinned';
+ const existing = originConfig.plugins?.find(
+ (entry) => parsePluginEntry(entry).identifier === id,
+ );
+ const isEnabled = existing ? parsePluginEntry(existing).mode !== 'disabled' : false;
+ const shouldOpen = open !== undefined ? open : !isEnabled;
+
+ const config = produce(originConfig, (draft) => {
+ draft.plugins = (isOnDemandBuiltinTool(id) || legacyBuiltinSkillIds.includes(id)
+ ? setBuiltinPluginMode(draft.plugins, id, shouldOpen ? 'auto' : 'disabled')
+ : upsertConnectorEnabled(draft.plugins, id, shouldOpen)) as unknown as string[];
+ });
- await this.setPluginMode(id, shouldOpen ? 'pinned' : 'auto');
+ await this.#get().updateAgentConfigById(agentId, config);
};
/**
diff --git a/src/store/tool/slices/builtin/selectors.test.ts b/src/store/tool/slices/builtin/selectors.test.ts
index 1463b14ee65..ea904dbd482 100644
--- a/src/store/tool/slices/builtin/selectors.test.ts
+++ b/src/store/tool/slices/builtin/selectors.test.ts
@@ -225,33 +225,17 @@ describe('builtinToolSelectors', () => {
uninstalledBuiltinTools: ['uninstalled-tool'],
} as ToolStoreState;
- const autoVisible = builtinToolSelectors.installedProfileConfigurableMetaList({
- isManualMode: false,
- })(state);
- const autoExcluded = builtinToolSelectors.nonProfileConfigurableBuiltinToolIds({
- isManualMode: false,
- })(state);
- const manualVisible = builtinToolSelectors.installedProfileConfigurableMetaList({
- isManualMode: true,
- })(state);
- const manualExcluded = builtinToolSelectors.nonProfileConfigurableBuiltinToolIds({
- isManualMode: true,
- })(state);
+ const visible = builtinToolSelectors.installedProfileConfigurableMetaList(state);
+ const excluded = builtinToolSelectors.nonProfileConfigurableBuiltinToolIds(state);
- expect(autoVisible.map((item) => item.identifier)).toEqual([
+ expect(visible.map((item) => item.identifier)).toEqual([
'lobe-skill-store',
'lobe-agent-management',
'profile-tool',
]);
- expect(autoExcluded).toEqual(expect.arrayContaining(['lobe-web-browsing', 'lobe-verify']));
- expect(manualVisible.map((item) => item.identifier)).toEqual([
- 'lobe-skill-store',
- 'lobe-agent-management',
- 'profile-tool',
- ]);
- expect(manualExcluded).toEqual(expect.arrayContaining(['lobe-web-browsing', 'lobe-verify']));
- expect(manualExcluded).not.toContain('lobe-skill-store');
- expect(manualExcluded).not.toContain('lobe-agent-management');
+ expect(excluded).toEqual(expect.arrayContaining(['lobe-web-browsing', 'lobe-verify']));
+ expect(excluded).not.toContain('lobe-skill-store');
+ expect(excluded).not.toContain('lobe-agent-management');
});
});
});
diff --git a/src/store/tool/slices/builtin/selectors.ts b/src/store/tool/slices/builtin/selectors.ts
index 8d60d74cfce..a535a98f9df 100644
--- a/src/store/tool/slices/builtin/selectors.ts
+++ b/src/store/tool/slices/builtin/selectors.ts
@@ -1,7 +1,6 @@
import {
alwaysOnToolIds,
isOnDemandBuiltinTool,
- manualModeExcludeToolIds,
runtimeManagedToolIds,
} from '@lobechat/builtin-tools';
import type { BuiltinSkillManifest, LobeToolMeta } from '@lobechat/types';
@@ -75,30 +74,20 @@ const getComposioMetasWithAvailability = (s: ToolStoreState): LobeToolMetaWithAv
// Set form for O(1) lookup inside the filter loop.
const RUNTIME_MANAGED_TOOL_IDS = new Set(runtimeManagedToolIds);
const ALWAYS_ON_TOOL_IDS = new Set(alwaysOnToolIds);
-const MANUAL_MODE_EXCLUDE_TOOL_IDS = new Set(manualModeExcludeToolIds);
-
-interface ProfileConfigurableToolOptions {
- isManualMode: boolean;
-}
/**
* Agent Profile only owns tools whose lifecycle can genuinely be controlled by
* the agent's plugin policy. Runtime-managed tools (for example Web Browsing),
* non-discoverable infrastructure, and system-fixed tools do not satisfy that
- * contract. A default tool removed specifically by manual activation mode is
- * the exception: an explicit profile pin genuinely adds it back.
+ * contract.
*/
const isProfileConfigurableBuiltinTool = (
tool: ToolStoreState['builtinTools'][number],
- { isManualMode }: ProfileConfigurableToolOptions,
): boolean => {
if (tool.discoverable === false) return false;
if (RUNTIME_MANAGED_TOOL_IDS.has(tool.identifier)) return false;
- return (
- !ALWAYS_ON_TOOL_IDS.has(tool.identifier) ||
- (isManualMode && MANUAL_MODE_EXCLUDE_TOOL_IDS.has(tool.identifier))
- );
+ return !ALWAYS_ON_TOOL_IDS.has(tool.identifier);
};
/**
@@ -268,39 +257,37 @@ const installedAllMetaList = (s: ToolStoreState): LobeToolMetaWithAvailability[]
};
/**
- * Installed builtin tools that Agent Profile can truthfully pin or unpin.
+ * Installed builtin tools that Agent Profile can truthfully enable or disable.
*
* This intentionally differs from `installedAllMetaList`, which is also used
* by inventory/detail surfaces and therefore contains runtime-managed and
* internal tools for lookup purposes.
*/
-const installedProfileConfigurableMetaList =
- (options: ProfileConfigurableToolOptions) =>
- (s: ToolStoreState): LobeToolMetaWithAvailability[] => {
- const { uninstalledBuiltinTools } = s;
-
- const builtinMetas = s.builtinTools
- .filter((tool) => isProfileConfigurableBuiltinTool(tool, options))
- .filter(
- (item) =>
- isOnDemandBuiltinTool(item.identifier) ||
- !uninstalledBuiltinTools.includes(item.identifier),
- )
- .map(toBuiltinMetaWithAvailability);
+const installedProfileConfigurableMetaList = (
+ s: ToolStoreState,
+): LobeToolMetaWithAvailability[] => {
+ const { uninstalledBuiltinTools } = s;
- return [...builtinMetas, ...getComposioMetasWithAvailability(s)];
- };
+ const builtinMetas = s.builtinTools
+ .filter(isProfileConfigurableBuiltinTool)
+ .filter(
+ (item) =>
+ isOnDemandBuiltinTool(item.identifier) ||
+ !uninstalledBuiltinTools.includes(item.identifier),
+ )
+ .map(toBuiltinMetaWithAvailability);
+
+ return [...builtinMetas, ...getComposioMetasWithAvailability(s)];
+};
/**
- * Builtin identifiers hidden from Agent Profile in the current activation
- * mode. Their config entries remain intact so switching modes is reversible.
+ * Builtin identifiers hidden from Agent Profile. Their config entries remain
+ * intact so non-profile flows are unaffected.
*/
-const nonProfileConfigurableBuiltinToolIds =
- (options: ProfileConfigurableToolOptions) =>
- (s: ToolStoreState): string[] =>
- s.builtinTools
- .filter((tool) => !isProfileConfigurableBuiltinTool(tool, options))
- .map((tool) => tool.identifier);
+const nonProfileConfigurableBuiltinToolIds = (s: ToolStoreState): string[] =>
+ s.builtinTools
+ .filter((tool) => !isProfileConfigurableBuiltinTool(tool))
+ .map((tool) => tool.identifier);
/**
* Bundled skills available on this client, including those awaiting an agent opt-in.
diff --git a/src/store/user/slices/onboarding/action.firstScreen.test.ts b/src/store/user/slices/onboarding/action.firstScreen.test.ts
new file mode 100644
index 00000000000..1030ec383ef
--- /dev/null
+++ b/src/store/user/slices/onboarding/action.firstScreen.test.ts
@@ -0,0 +1,18 @@
+import { readFileSync } from 'node:fs';
+import path from 'node:path';
+
+import { describe, expect, it } from 'vitest';
+
+describe('user onboarding slice — first-screen imports', () => {
+ // This store is on the first screen. A static import of the builtin-tools entry
+ // pulls every tool manifest into the entry chunk (+327 KB gzip on the size gate).
+ it.each(['@lobechat/builtin-tools', '@lobechat/mecha/builtinSkillGate'])(
+ 'does not statically import %s',
+ (specifier) => {
+ const source = readFileSync(path.join(__dirname, 'action.ts'), 'utf8');
+ const staticImport = new RegExp(`^import(?!\\s+type)[^;]*from '${specifier}'`, 'm');
+
+ expect(source).not.toMatch(staticImport);
+ },
+ );
+});
diff --git a/src/store/user/slices/onboarding/action.test.ts b/src/store/user/slices/onboarding/action.test.ts
index 2c7fa506930..ab42a13d1d2 100644
--- a/src/store/user/slices/onboarding/action.test.ts
+++ b/src/store/user/slices/onboarding/action.test.ts
@@ -131,7 +131,7 @@ describe('onboarding actions', () => {
});
});
- it('flips an existing disabled object entry back to pinned, without duplicating it', async () => {
+ it('flips an existing disabled object entry back to auto, without duplicating it', async () => {
act(() => {
useAgentStore.setState({
agentMap: {
@@ -149,18 +149,35 @@ describe('onboarding actions', () => {
});
expect(updateAgentConfigById).toHaveBeenCalledWith('inbox-agent-id', {
- plugins: ['plugin-1', { identifier: 'plugin-2', mode: 'pinned' }],
+ plugins: ['plugin-1', { identifier: 'plugin-2', mode: 'auto' }],
});
});
- it('setting open=false reverts the entry to auto, removing it from the array', async () => {
+ it('records a builtin override when enabling a legacy builtin skill', async () => {
+ const { result } = renderHook(() => useUserStore());
+
+ await act(async () => {
+ await result.current.toggleInboxAgentDefaultPlugin('lobe-artifacts', true);
+ });
+
+ expect(updateAgentConfigById).toHaveBeenCalledWith('inbox-agent-id', {
+ plugins: [
+ 'plugin-1',
+ { builtinOverride: true, identifier: 'lobe-artifacts', mode: 'auto' },
+ ],
+ });
+ });
+
+ it('setting open=false writes an explicit disabled entry', async () => {
const { result } = renderHook(() => useUserStore());
await act(async () => {
await result.current.toggleInboxAgentDefaultPlugin('plugin-1', false);
});
- expect(updateAgentConfigById).toHaveBeenCalledWith('inbox-agent-id', { plugins: [] });
+ expect(updateAgentConfigById).toHaveBeenCalledWith('inbox-agent-id', {
+ plugins: [{ identifier: 'plugin-1', mode: 'disabled' }],
+ });
});
});
});
diff --git a/src/store/user/slices/onboarding/action.ts b/src/store/user/slices/onboarding/action.ts
index 3dae6d78e9f..cb6027eff18 100644
--- a/src/store/user/slices/onboarding/action.ts
+++ b/src/store/user/slices/onboarding/action.ts
@@ -1,5 +1,10 @@
import { CURRENT_ONBOARDING_VERSION, INBOX_SESSION_ID } from '@lobechat/const';
-import { CLASSIC_ONBOARDING_MAX_STEP, getPluginMode, upsertPluginMode } from '@lobechat/types';
+import {
+ CLASSIC_ONBOARDING_MAX_STEP,
+ parsePluginEntry,
+ setBuiltinPluginMode,
+ upsertConnectorEnabled,
+} from '@lobechat/types';
import { userService } from '@/services/user';
import { type StoreSetter } from '@/store/types';
@@ -96,23 +101,36 @@ export class OnboardingActionImpl {
};
toggleInboxAgentDefaultPlugin = async (id: string, open?: boolean): Promise<void> => {
- /** Break the user → agent → cache-scope → user initialization cycle. */
- const { getAgentStoreState } = await import('@/store/agent');
+ /**
+ * The agent store breaks the user → agent → cache-scope → user initialization
+ * cycle; the builtin-tools entry carries every tool manifest and stays off the
+ * first screen.
+ */
+ const [{ getAgentStoreState }, { isOnDemandBuiltinTool }, { legacyBuiltinSkillIds }] =
+ await Promise.all([
+ import('@/store/agent'),
+ import('@lobechat/builtin-tools'),
+ import('@lobechat/mecha/builtinSkillGate'),
+ ]);
const currentSettings = settingsSelectors.currentSettings(this.#get());
- const isDefaultPinned =
- getPluginMode(currentSettings.defaultAgent?.config?.plugins, id) === 'pinned';
- const shouldOpen = open !== undefined ? open : !isDefaultPinned;
+ const defaultEntry = currentSettings.defaultAgent?.config?.plugins?.find(
+ (entry) => parsePluginEntry(entry).identifier === id,
+ );
+ const isDefaultEnabled = defaultEntry
+ ? parsePluginEntry(defaultEntry).mode !== 'disabled'
+ : false;
+ const shouldOpen = open !== undefined ? open : !isDefaultEnabled;
const agentStore = getAgentStoreState();
const inboxAgentId = agentStore.builtinAgentIdMap[INBOX_SESSION_ID];
if (!inboxAgentId) return;
- // upsertPluginMode preserves an already-matching entry as-is and flips a
- // disabled entry back to pinned in place, instead of blindly pushing a
- // duplicate bare-string identifier.
const inboxRawPlugins = agentStore.agentMap[inboxAgentId]?.plugins;
await agentStore.updateAgentConfigById(inboxAgentId, {
- plugins: upsertPluginMode(inboxRawPlugins, id, shouldOpen ? 'pinned' : 'auto'),
+ plugins:
+ isOnDemandBuiltinTool(id) || legacyBuiltinSkillIds.includes(id)
+ ? setBuiltinPluginMode(inboxRawPlugins, id, shouldOpen ? 'auto' : 'disabled')
+ : upsertConnectorEnabled(inboxRawPlugins, id, shouldOpen),
});
};
}