🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
♻️ refactor(task): move execution guidance out of the builtin task skill (#23416)
AmAzing-70e07c9b6b0a
diff --git a/apps/server/src/services/agentDocumentVfs/mounts/skills/providers/ProviderSkillsBuiltin.ts b/apps/server/src/services/agentDocumentVfs/mounts/skills/providers/ProviderSkillsBuiltin.tsindex 31105b11ed8..e6207bf70ff 100644--- a/apps/server/src/services/agentDocumentVfs/mounts/skills/providers/ProviderSkillsBuiltin.ts+++ b/apps/server/src/services/agentDocumentVfs/mounts/skills/providers/ProviderSkillsBuiltin.ts@@ -1,6 +1,5 @@import { builtinSkills } from '@lobechat/builtin-skills';-import { USER_HIDDEN_BUILTIN_SKILLS } from '@/helpers/skillFilters';import { AgentDocumentVfsError } from '@/server/services/agentDocumentVfs/errors';import type { SkillMountProvider, SkillMountProviderRequest } from '../SkillMount';@@ -16,11 +15,8 @@ export class ProviderSkillsBuiltin implements SkillMountProvider {// No device gating on purpose: the VFS is a read-only file view of skill// content, so device-only skills (agent-browser) stay browsable here —// executability gating lives in the runtime entry points (SkillEngine /- // skills / activator). User-hidden skills stay excluded: that axis is about- // visibility, not executability.- private readonly skills = builtinSkills.filter(- (skill) => !USER_HIDDEN_BUILTIN_SKILLS.has(skill.identifier),- );+ // skills / activator).+ private readonly skills = builtinSkills;async get(input: SkillMountProviderRequest): Promise<SkillMountNode> {if (!input.resolvedPath.skillName) {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.tsindex ab3990c702e..50a1c8c3fb8 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@@ -2,19 +2,13 @@import { builtinSkills } from '@lobechat/builtin-skills';import { beforeEach, describe, expect, it, vi } from 'vitest';-import { USER_HIDDEN_BUILTIN_SKILLS } from '@/helpers/skillFilters';-import { ProviderSkillsBuiltin } from './ProviderSkillsBuiltin';import { ProviderSkillsInstalledActive } from './ProviderSkillsInstalledActive';import { ProviderSkillsInstalledAll } from './ProviderSkillsInstalledAll';describe('readonly skill providers', () => {- // Mirrors the provider's own set: user-hidden skills excluded, no device gating.- const visibleBuiltinSkills = builtinSkills.filter(- (skill) => !USER_HIDDEN_BUILTIN_SKILLS.has(skill.identifier),- );- const builtinSkill = visibleBuiltinSkills[0];- const builtinSkillWithResources = visibleBuiltinSkills.find(+ const builtinSkill = builtinSkills[0];+ const builtinSkillWithResources = builtinSkills.find((skill) => skill.resources && Object.keys(skill.resources).length > 0,);diff --git a/apps/server/src/services/taskRunner/index.ts b/apps/server/src/services/taskRunner/index.tsindex 8befdba0ef5..5516cb26842 100644--- a/apps/server/src/services/taskRunner/index.ts+++ b/apps/server/src/services/taskRunner/index.ts@@ -1,4 +1,3 @@-import { TaskIdentifier as TaskSkillIdentifier } from '@lobechat/builtin-skills';import { AcceptanceEvidenceIdentifier } from '@lobechat/builtin-tool-acceptance-evidence';import { BriefIdentifier } from '@lobechat/builtin-tool-brief';import { INBOX_SESSION_ID } from '@lobechat/const';@@ -44,7 +43,7 @@ interface TopicRetarget {}export interface RunTaskParams {- /** Extra builtin tools this run mounts beside the Task skill, e.g. the Goal report tool. */+ /** Extra builtin tools this run mounts for the task, e.g. the Goal report tool. */additionalPluginIds?: string[];continueTopicId?: string;/** Explicit device target for this run only. The Task itself does not retain the binding. */@@ -336,7 +335,7 @@ export class TaskRunnerService {? 'agent': 'auto') as 'agent' | 'auto';- const pluginIds = [TaskSkillIdentifier];+ const pluginIds: string[] = [];// Mount BriefIdentifier (createBrief + requestCheckpoint) only in the// legacy 'agent' path; in 'auto' the agent must not also call// createBrief or we'd double up.diff --git a/apps/server/src/services/taskRunner/taskSkill.test.ts b/apps/server/src/services/taskRunner/taskSkill.test.tsdeleted file mode 100644index 3ec3e017c45..00000000000--- a/apps/server/src/services/taskRunner/taskSkill.test.ts+++ /dev/null@@ -1,48 +0,0 @@-import { readFileSync } from 'node:fs';-import { createRequire } from 'node:module';-import { dirname, join } from 'node:path';--import { builtinSkills, TaskIdentifier } from '@lobechat/builtin-skills';-import { describe, expect, it } from 'vitest';--// The vitest config stubs `.md` imports to an empty string, so read the skill-// instructions straight from disk instead of through the package export.-const builtinSkillsEntry = createRequire(import.meta.url).resolve('@lobechat/builtin-skills');-const content = readFileSync(join(dirname(builtinSkillsEntry), 'task/SKILL.md'), 'utf8');--/**- * TaskRunnerService auto-activates the task skill for every task run, so its- * SKILL.md lands in the system context — a higher-priority surface than the- * per-run task prompt. Guard that the "complete when done" guidance it ships- * carries the automation exception; without it, a quiet automation tick can- * follow the skill and `lh task complete` its own recurring task, which- * cancels the in-flight run and permanently disarms the heartbeat/schedule- * loop.- */-describe('task skill instructions', () => {- it('is mounted under the identifier the task runner auto-activates', () => {- expect(builtinSkills.some((s) => s.identifier === TaskIdentifier)).toBe(true);- });-- it('ships the complete-when-done guidance the exception guards against', () => {- expect(content).toContain('lh task complete');- expect(content).toContain('Complete when done');- });-- it('forbids completing automation tasks via the CLI', () => {- expect(content).toContain('Automation tasks are the exception — NEVER complete them');- expect(content).toContain(- 'NEVER run `lh task complete` (or set a terminal status via `lh task edit --status`)',- );- // The exception must follow the completion guidance it carves out of.- expect(content.indexOf('NEVER run `lh task complete`')).toBeGreaterThan(- content.indexOf('Complete when done'),- );- });-- it('lets a tick retire the loop once the instruction end condition is met', () => {- expect(content).toContain('**End conditions**');- expect(content).toContain('Then run `lh task complete <id>` as your final step');- expect(content).toContain('Do not ask the user to stop it instead');- });-});diff --git a/packages/builtin-skills/src/index.ts b/packages/builtin-skills/src/index.tsindex 437adebce6f..f1e03dcb981 100644--- a/packages/builtin-skills/src/index.ts+++ b/packages/builtin-skills/src/index.ts@@ -3,12 +3,10 @@ import type { BuiltinSkill } from '@lobechat/types';import { AgentBrowserSkill } from './agent-browser';import { ArtifactsSkill } from './artifacts';import { LobeHubSkill } from './lobehub';-import { TaskSkill } from './task';export { AgentBrowserIdentifier } from './agent-browser';export { ArtifactsIdentifier } from './artifacts';export { LobeHubIdentifier } from './lobehub';-export { TaskIdentifier } from './task';export {buildReactArtifactProject,REACT_ARTIFACT_APP_PATH,@@ -31,6 +29,5 @@ export const builtinSkills: BuiltinSkill[] = [AgentBrowserSkill,ArtifactsSkill,LobeHubSkill,- TaskSkill,// FindSkillsSkill];diff --git a/packages/builtin-skills/src/lobehub/content.ts b/packages/builtin-skills/src/lobehub/content.tsindex 85f4c35daac..c171fe18c08 100644--- a/packages/builtin-skills/src/lobehub/content.ts+++ b/packages/builtin-skills/src/lobehub/content.ts@@ -58,7 +58,8 @@ run commands.| \`lh memory\` | User memory management (identity, activity, preference) | \`references/memory\` || \`lh search\` / \`lh recall\` | Search local resources or the web / recall past work in a time window | \`references/search\` || \`lh gen\` | Content generation (text, image, video, TTS, ASR) | \`references/generate\` |-| \`lh project\` / \`lh task\` | Projects and agent tasks | \`references/project\` |+| \`lh project\` | Projects | \`references/project\` |+| \`lh task\` | Tasks, dependencies and task documents | \`references/task\` || \`lh goal\` | Long-running goal graphs | \`references/goal\` || \`lh trace\` | Inspect and replay recorded agent runs | \`references/trace\` || \`lh skill\` | Skill management (install, create, manage) | \`references/skill\` |@@ -74,9 +75,7 @@ run commands.| \`lh eval\` | Evaluation workflow management | \`references/eval\` || \`lh whoami\` / \`lh usage\` / \`lh user\` / \`lh notification\` / \`lh migrate\` | Account, usage, settings, notification settings and imports (top-level commands, not a \`config\` module) | \`references/config\` |-Covered by their own skills, so activate the skill instead of reading a reference here:-\`lh task\` inside a task run (\`task\` skill) and-\`lh acceptance\` (\`acceptance\` skill).+For \`lh acceptance\`, activate the \`acceptance\` skill instead of reading a reference here.# Workspace scopediff --git a/packages/builtin-skills/src/lobehub/index.test.ts b/packages/builtin-skills/src/lobehub/index.test.tsindex 0623b28824b..0cd39775213 100644--- a/packages/builtin-skills/src/lobehub/index.test.ts+++ b/packages/builtin-skills/src/lobehub/index.test.ts@@ -23,6 +23,11 @@ describe('LobeHubSkill', () => {expect(LobeHubSkill.content).toContain('references/connector');});+ it('provides task commands as a platform reference', () => {+ expect(LobeHubSkill.content).toContain('references/task');+ expect(LobeHubSkill.resources?.['references/task']?.content).toContain('lh task complete <id>');+ });+it('documents workspace scope in the guide', () => {expect(LobeHubSkill.content).toContain('`lh workspace`');expect(LobeHubSkill.content).toContain('references/workspace');diff --git a/packages/builtin-skills/src/lobehub/index.ts b/packages/builtin-skills/src/lobehub/index.tsindex e6f7bf6a201..b399fa76719 100644--- a/packages/builtin-skills/src/lobehub/index.ts+++ b/packages/builtin-skills/src/lobehub/index.ts@@ -33,6 +33,7 @@ import provider from './references/provider';import quota from './references/quota';import search from './references/search';import skill from './references/skill';+import task from './references/task.md';import topic from './references/topic';import trace from './references/trace';import webhook from './references/webhook';@@ -74,6 +75,7 @@ export const LobeHubSkill: BuiltinSkill = {'references/quota': quota,'references/search': search,'references/skill': skill,+ 'references/task': task,'references/topic': topic,'references/trace': trace,'references/webhook': webhook,diff --git a/packages/builtin-skills/src/lobehub/manifest.ts b/packages/builtin-skills/src/lobehub/manifest.tsindex 73067561155..39549dfdff0 100644--- a/packages/builtin-skills/src/lobehub/manifest.ts+++ b/packages/builtin-skills/src/lobehub/manifest.ts@@ -9,7 +9,7 @@ const LOBEHUB_AVATAR =export const LobeHubManifest: BuiltinSkillManifest = {avatar: LOBEHUB_AVATAR,description:- "Read and change LobeHub platform data through the `lh` CLI, including this agent's own configuration. ACTIVATE when the user wants to: (1) change this agent — system prompt / persona, tools / plugins / skills, model or provider, knowledge bases or files, opening message, or topic title; (2) work with any platform resource — agents, topics, messages, memory, documents, knowledge bases, files, search, content generation, models / providers / plugins, MCP servers / connectors (add, list, refresh or remove an MCP server, `lh mcp`), evals, usage stats, custom webhooks (list, create, rename, edit, pause, rotate a key, delete, or post results to a Channel, `lh webhook`) and automations, i.e. MCP Events subscriptions (list, view, rename, check, delete, `lh automation`); (3) connect a chat-platform bot — Discord, Telegram, Slack, Feishu (飞书), Lark, QQ, WeChat (微信), e.g. '接入飞书', 'connect my Slack'; (4) read another conversation — the message contains a topic id (`tpc_…`) or a `<refer_topic>` tag. Without activation you cannot read or change platform data; you can only describe what you would do.",+ "Read and change LobeHub platform data through the `lh` CLI, including this agent's own configuration. ACTIVATE when the user wants to: (1) change this agent — system prompt / persona, tools / plugins / skills, model or provider, knowledge bases or files, opening message, or topic title; (2) work with any platform resource — projects, tasks, agents, topics, messages, memory, documents, knowledge bases, files, search, content generation, models / providers / plugins, MCP servers / connectors (add, list, refresh or remove an MCP server, `lh mcp`), evals, usage stats, custom webhooks (list, create, rename, edit, pause, rotate a key, delete, or post results to a Channel, `lh webhook`) and automations, i.e. MCP Events subscriptions (list, view, rename, check, delete, `lh automation`); (3) connect a chat-platform bot — Discord, Telegram, Slack, Feishu (飞书), Lark, QQ, WeChat (微信), e.g. '接入飞书', 'connect my Slack'; (4) read another conversation — the message contains a topic id (`tpc_…`) or a `<refer_topic>` tag. Without activation you cannot read or change platform data; you can only describe what you would do.",identifier: LobeHubIdentifier,name: 'lobehub',source: 'builtin',diff --git a/packages/builtin-skills/src/lobehub/references/project.ts b/packages/builtin-skills/src/lobehub/references/project.tsindex d3fea6b7d4c..ce31976b6a8 100644--- a/packages/builtin-skills/src/lobehub/references/project.ts+++ b/packages/builtin-skills/src/lobehub/references/project.ts@@ -1,4 +1,4 @@-const content = `# lh project / lh task - Projects and Tasks+const content = `# lh project - ProjectsA project groups tasks, agents and knowledge bases around one outcome. Tasks areunits of agent work with an identifier such as \`T-12\`.@@ -17,21 +17,8 @@ units of agent work with an identifier such as \`T-12\`.- \`lh project delete <id> [--yes]\` - Delete a project (its tasks are kept, without a project)## Tasks+See \`references/task\` for task commands and \`lh man task\` for the CLI manual.-- \`lh task list [--root] [--parent <id>] [--agent <id>] [--tree] [--board] [-L <n>] [--json]\` - List tasks-- \`lh task view <id> [--json]\` - View a task (instruction, documents, activities)-- \`lh task create -i <instruction> [-n <name>] [--agent <id>] [--user <idOrEmail>] [--parent <id>] [--priority <0-4>]\` - Create a task-- \`lh task edit <id> [-n <name>] [-i <instruction>] [--agent <id>] [--user <idOrEmail>] [--priority <0-4>]\` - Edit a task-- \`lh task comment <id> -m <text>\` - Add a progress comment--When you are executing a task run, the \`task\` skill covers the full lifecycle-(subtasks, dependencies, task documents, completion rules). Activate it instead of-guessing. \`lh man task\` lists every subcommand.--## Tips--- \`--user\` takes an email or username only in a workspace scope (see \`references/workspace\`). In personal scope it needs a \`user_…\` id-- Priority: 0 none, 1 urgent, 2 high, 3 normal, 4 low`;export default content;diff --git a/packages/builtin-skills/src/task/references/commands.md b/packages/builtin-skills/src/lobehub/references/task.mdsimilarity index 93%rename from packages/builtin-skills/src/task/references/commands.mdrename to packages/builtin-skills/src/lobehub/references/task.mdindex bf9f2fab943..06845a7b831 100644--- a/packages/builtin-skills/src/task/references/commands.md+++ b/packages/builtin-skills/src/lobehub/references/task.md@@ -2,16 +2,16 @@## Core Commands-- `lh task list [--status <status>] [--root] [--parent <id>] [--agent <id>] [--label <name>] [--unlabeled] [-L <limit>] [--tree]` - List tasks+- `lh task list [--status <status>] [--root] [--parent <id>] [--agent <id>] [--label <name>] [--unlabeled] [-L <limit>] [--tree] [--board]` - List tasks- `--status`: backlog, running, scheduled, paused, completed, failed, canceled- `--root`: Only root tasks (no parent)- `--label`: Tasks carrying any of these labels (repeatable / comma-separated; a label group name matches any label in it)- `--tree`: Display as tree structure- `lh task view <id>` - View task details (instruction, documents, activities)-- `lh task create -i <instruction> [-n <name>] [--agent <id>] [--parent <id>] [--priority <0-4>] [--label <name>] [--origin-agent <id> --origin-topic <id>]` - Create task+- `lh task create -i <instruction> [-n <name>] [--agent <id>] [--user <idOrEmail>] [--parent <id>] [--priority <0-4>] [--label <name>] [--origin-agent <id> --origin-topic <id>]` - Create task- Priority: 0=none, 1=urgent, 2=high, 3=normal, 4=low- `--origin-agent` / `--origin-topic` (optional): the conversation to report back to when the task finishes (a result card is posted there and that agent continues). Pass both together; to be notified in your current conversation, use `$LOBEHUB_AGENT_ID` and `$LOBEHUB_TOPIC_ID`. The topic must be your own conversation.-- `lh task edit <id> [-n <name>] [-i <instruction>] [--status <status>] [--priority <0-4>] [--agent <id>] [--label <name>] [--remove-label <name>]` - Update task+- `lh task edit <id> [-n <name>] [-i <instruction>] [--status <status>] [--priority <0-4>] [--agent <id>] [--user <idOrEmail>] [--label <name>] [--remove-label <name>]` - Update task- `lh task delete <id> [--yes]` - Delete task- `lh task clear [--yes]` - Delete all tasks- `lh task tree <id>` - Show subtask tree with dependencies@@ -84,6 +84,7 @@ Labels are shared by the workspace. `--label` only takes existing names (`Bug`,## Tips+- `--user` accepts an email or username in workspace scope; in personal scope it needs a `user_…` id.- All commands support `--json [fields]` for structured output- Task identifiers use formats like T-1 or ABC-2. They are display labels and compatible input aliases; prefer stable task ids from previous results for subsequent calls. Use identifier short links such as `/task/T-1` in user-facing output.- Use `lh task tree` to visualize full task hierarchy before planning workdiff --git a/packages/builtin-skills/src/manifests.ts b/packages/builtin-skills/src/manifests.tsindex c7ae9c8b28c..10f59c10906 100644--- a/packages/builtin-skills/src/manifests.ts+++ b/packages/builtin-skills/src/manifests.ts@@ -3,16 +3,13 @@ import type { BuiltinSkillManifest } from '@lobechat/types';import { AgentBrowserManifest } from './agent-browser/manifest';import { ArtifactsManifest } from './artifacts/manifest';import { LobeHubManifest } from './lobehub/manifest';-import { TaskManifest } from './task/manifest';export { AgentBrowserIdentifier } from './agent-browser/manifest';export { ArtifactsIdentifier } from './artifacts/manifest';export { LobeHubIdentifier } from './lobehub/manifest';-export { TaskIdentifier } from './task/manifest';export const builtinSkillManifests: BuiltinSkillManifest[] = [AgentBrowserManifest,ArtifactsManifest,LobeHubManifest,- TaskManifest,];diff --git a/packages/builtin-skills/src/task/SKILL.md b/packages/builtin-skills/src/task/SKILL.mddeleted file mode 100644index 60102711413..00000000000--- a/packages/builtin-skills/src/task/SKILL.md+++ /dev/null@@ -1,56 +0,0 @@-\<task_skill_guides>-You are executing a task within the LobeHub task system. Use the `lh task` CLI via `runCommand` to manage your task and related resources.--# Task Lifecycle--| Command | Description |-| ------------------------------- | ------------------------------------------------------- |-| `lh task view <id>` | View task details, instruction, documents, activities |-| `lh task edit <id>` | Update task name, instruction, status, priority, labels |-| `lh task complete <id>` | Mark task as completed |-| `lh task comment <id> -m "..."` | Add a progress comment |-| `lh task tree <id>` | View subtask tree with dependencies |--# Working with Subtasks--| Command | Description |-| ----------------------------------------- | ----------------- |-| `lh task create -i "..." --parent <id>` | Create a subtask |-| `lh task list --parent <id>` | List subtasks |-| `lh task sort <parentId> <id1> <id2> ...` | Reorder subtasks |-| `lh task dep add <id> <dependsOnId>` | Add dependency |-| `lh task dep rm <id> <dependsOnId>` | Remove dependency |--# Task Documents--| Command | Description |-| ------------------------------------------------- | ------------------------- |-| `lh task doc create <id> -t "title" -b "content"` | Create and pin a document |-| `lh task doc pin <id> <docId>` | Pin existing document |-| `lh task doc unpin <id> <docId>` | Unpin document |--# Task Topics (Conversations)--| Command | Description |-| ----------------------------------- | ------------------------ |-| `lh task topic list <id>` | List conversation topics |-| `lh task topic view <id> <topicId>` | View topic messages |--# Usage Pattern--1. Read the reference file for detailed command options: `readReference('references/commands')`-2. Run commands via `runCommand` — the `lh` prefix is automatically handled-3. Use `--json` flag on any command for structured output-4. Use `lh task <subcommand> --help` for full command-line help--# Task Execution Guidelines--- **Use stable task references**: Commands accept display identifiers (for example `T-12`) and stable ids (`task_…`). Prefer the id returned by a tool for subsequent calls. Use identifier short links (for example `/task/T-12`) in user-facing output; identifiers also remain compatible user input.-- **Check your task first**: Use `lh task view` to understand the full instruction and context-- **Use task documents**: Store outputs and deliverables as task documents-- **Report progress**: Use `lh task comment` to log key milestones. To notify a member who needs to act, mention them with `<mention name="Name" id="user_xxx" />`, taking the id from `lh workspace members` (never guess it); a plain "@Name" is only text. Each mention sends a notification, so do not @ people in routine progress notes.-- **Respect dependencies**: Check `lh task tree` to understand task ordering-- **Complete when done**: Use `lh task complete` when all deliverables are ready-- **Automation tasks are the exception — NEVER complete them**: a task with automation (heartbeat or schedule — shown as an `Automation:` line in the task context) is a recurring loop, and this run is one tick of it. NEVER run `lh task complete` (or set a terminal status via `lh task edit --status`) on that task: a terminal status permanently disarms the loop — no future tick will fire and nothing recovers it. A tick with nothing to do, or whose condition is not met yet, is still a successful run; just finish your turn and the next tick is armed automatically. Only the user retires a recurring task.-- **End conditions**: the one exception is when the instruction itself defines when the loop ends ("until X", "stop once Y", "after Z is merged") and this tick has verified it is now met. Then run `lh task complete <id>` as your final step: it is finalized after this run finishes and retires the loop. Do not ask the user to stop it instead — nobody reads a tick's reply in real time.- \</task_skill_guides>diff --git a/packages/builtin-skills/src/task/index.ts b/packages/builtin-skills/src/task/index.tsdeleted file mode 100644index f0a98aa0809..00000000000--- a/packages/builtin-skills/src/task/index.ts+++ /dev/null@@ -1,16 +0,0 @@-import type { BuiltinSkill } from '@lobechat/types';--import { toResourceMeta } from '../lobehub/helpers';-import { TaskIdentifier, TaskManifest } from './manifest';-import commands from './references/commands.md';-import content from './SKILL.md';--export { TaskIdentifier };--export const TaskSkill: BuiltinSkill = {- ...TaskManifest,- content,- resources: toResourceMeta({- 'references/commands': commands,- }),-};diff --git a/packages/builtin-skills/src/task/manifest.ts b/packages/builtin-skills/src/task/manifest.tsdeleted file mode 100644index fd541a133ec..00000000000--- a/packages/builtin-skills/src/task/manifest.ts+++ /dev/null@@ -1,11 +0,0 @@-import type { BuiltinSkillManifest } from '@lobechat/types';--export const TaskIdentifier = 'task';--export const TaskManifest: BuiltinSkillManifest = {- avatar: '📋',- description: 'Task management and execution — create, track, review, and complete tasks via CLI.',- identifier: TaskIdentifier,- name: 'task',- source: 'builtin',-};diff --git a/packages/mecha/src/toolSet/builtinSkillGate.ts b/packages/mecha/src/toolSet/builtinSkillGate.tsindex 2aa886b20c1..7f507428655 100644--- a/packages/mecha/src/toolSet/builtinSkillGate.ts+++ b/packages/mecha/src/toolSet/builtinSkillGate.ts@@ -3,9 +3,6 @@ import { AgentBrowserIdentifier } from '@lobechat/builtin-skills/manifests';/** Builtin skills that only work where the run can execute commands on a device. */const DEVICE_ONLY_BUILTIN_SKILLS = new Set<string>([AgentBrowserIdentifier]);-/** Builtin skills the product drives itself; never listed to the user or the model. */-export const USER_HIDDEN_BUILTIN_SKILLS = new Set<string>(['task']);-export interface BuiltinSkillEnvironment {/*** The run can execute commands on a device: the desktop app is itself that@@ -26,7 +23,6 @@ export const isBuiltinSkillEnabled = (skillId: string,environment: BuiltinSkillEnvironment,): boolean => {- if (USER_HIDDEN_BUILTIN_SKILLS.has(skillId)) return false;if (DEVICE_ONLY_BUILTIN_SKILLS.has(skillId)) return environment.canExecuteOnDevice;return true;};diff --git a/packages/mecha/src/toolSet/skillPool.test.ts b/packages/mecha/src/toolSet/skillPool.test.tsindex ec2bd65eb13..083709ed9a3 100644--- a/packages/mecha/src/toolSet/skillPool.test.ts+++ b/packages/mecha/src/toolSet/skillPool.test.ts@@ -8,8 +8,7 @@ const skill = (identifier: string, name = identifier, extra: Partial<SkillMeta>({ description: '', identifier, name, ...extra }) as SkillMeta;describe('isBuiltinSkillEnabled', () => {- it('hides the product-driven skills and gates the device-only ones', () => {- expect(isBuiltinSkillEnabled('task', { canExecuteOnDevice: true })).toBe(false);+ it('gates only the device-only skills', () => {expect(isBuiltinSkillEnabled(AgentBrowserIdentifier, { canExecuteOnDevice: false })).toBe(false,);diff --git a/packages/mecha/src/toolSet/skillPool.ts b/packages/mecha/src/toolSet/skillPool.tsindex 0ebac8a9475..7c6c64bc56b 100644--- a/packages/mecha/src/toolSet/skillPool.ts+++ b/packages/mecha/src/toolSet/skillPool.ts@@ -6,7 +6,7 @@ import { type BuiltinSkillEnvironment, isBuiltinSkillEnabled } from './builtinSkconst log = debug('mecha:skillPool');export type { BuiltinSkillEnvironment };-export { isBuiltinSkillEnabled, USER_HIDDEN_BUILTIN_SKILLS } from './builtinSkillGate';+export { isBuiltinSkillEnabled } from './builtinSkillGate';/*** The skill sources of a run, in precedence order. A host that has no suchdiff --git a/packages/prompts/src/prompts/task/__snapshots__/index.test.ts.snap b/packages/prompts/src/prompts/task/__snapshots__/index.test.ts.snapindex bb389c6dde7..6a054ec242d 100644--- a/packages/prompts/src/prompts/task/__snapshots__/index.test.ts.snap+++ b/packages/prompts/src/prompts/task/__snapshots__/index.test.ts.snap@@ -3,8 +3,10 @@exports[`buildTaskRunPrompt > should build prompt with only task instruction 1`] = `"<task><hint>This tag contains the complete task context. Do NOT call viewTask to re-fetch it.</hint>+Use the task tools or, with a shell, \`lh task\` (\`lh man task\` lists the commands). Respect dependencies, record milestones in task comments, and pin deliverables as task documents.TASK-1 (id: task_test) 写一本书Status: ● running Priority: -+When all deliverables are ready, request completion of this task (\`lh task complete <id>\` with a shell).Instruction: 帮我写一本 AI Agent 技术书籍Review: (not configured)@@ -14,8 +16,10 @@ Review: (not configured)exports[`buildTaskRunPrompt > should build prompt with task description + instruction 1`] = `"<task><hint>This tag contains the complete task context. Do NOT call viewTask to re-fetch it.</hint>+Use the task tools or, with a shell, \`lh task\` (\`lh man task\` lists the commands). Respect dependencies, record milestones in task comments, and pin deliverables as task documents.TASK-1 (id: task_test) 写一本书Status: ● running Priority: -+When all deliverables are ready, request completion of this task (\`lh task complete <id>\` with a shell).Instruction: 帮我写一本 AI Agent 技术书籍,目标 8 章Description: 面向开发者的技术书籍@@ -26,8 +30,10 @@ Review: (not configured)exports[`buildTaskRunPrompt > should handle empty activities gracefully 1`] = `"<task><hint>This tag contains the complete task context. Do NOT call viewTask to re-fetch it.</hint>+Use the task tools or, with a shell, \`lh task\` (\`lh man task\` lists the commands). Respect dependencies, record milestones in task comments, and pin deliverables as task documents.TASK-1 (id: task_test) 写一本书Status: ● running Priority: -+When all deliverables are ready, request completion of this task (\`lh task complete <id>\` with a shell).Instruction: 写书Review: (not configured)@@ -45,8 +51,10 @@ exports[`buildTaskRunPrompt > should handle full scenario with all sections 1`]<task><hint>This tag contains the complete task context. Do NOT call viewTask to re-fetch it.</hint>+Use the task tools or, with a shell, \`lh task\` (\`lh man task\` lists the commands). Respect dependencies, record milestones in task comments, and pin deliverables as task documents.TASK-1 (id: task_test) 写一本书Status: ● running Priority: -+When all deliverables are ready, request completion of this task (\`lh task complete <id>\` with a shell).Instruction: 写一本 AI Agent 书,目标 8 章Description: 面向开发者的 AI Agent 技术书籍Topics: 1@@ -65,8 +73,10 @@ Activities:exports[`buildTaskRunPrompt > should include activity history with topics and briefs in CLI style 1`] = `"<task><hint>This tag contains the complete task context. Do NOT call viewTask to re-fetch it.</hint>+Use the task tools or, with a shell, \`lh task\` (\`lh man task\` lists the commands). Respect dependencies, record milestones in task comments, and pin deliverables as task documents.TASK-1 (id: task_test) 写一本书Status: ● running Priority: -+When all deliverables are ready, request completion of this task (\`lh task complete <id>\` with a shell).Instruction: 写书Topics: 2@@ -89,8 +99,10 @@ exports[`buildTaskRunPrompt > should include agent comments with author label an<task><hint>This tag contains the complete task context. Do NOT call viewTask to re-fetch it.</hint>+Use the task tools or, with a shell, \`lh task\` (\`lh man task\` lists the commands). Respect dependencies, record milestones in task comments, and pin deliverables as task documents.TASK-1 (id: task_test) 写一本书Status: ● running Priority: -+When all deliverables are ready, request completion of this task (\`lh task complete <id>\` with a shell).Instruction: 写书Review: (not configured)@@ -104,8 +116,10 @@ Activities:exports[`buildTaskRunPrompt > should include parentTask context for subtasks 1`] = `"<task><hint>This tag contains the complete task context. Do NOT call viewTask to re-fetch it.</hint>+Use the task tools or, with a shell, \`lh task\` (\`lh man task\` lists the commands). Respect dependencies, record milestones in task comments, and pin deliverables as task documents.TASK-4 (id: task_004) 第2章 核心架构Status: ● running Priority: -+When all deliverables are ready, request completion of this task (\`lh task complete <id>\` with a shell).Instruction: 撰写第2章Parent: TASK-1@@ -124,8 +138,10 @@ Review: (not configured)exports[`buildTaskRunPrompt > should include subtasks in task section 1`] = `"<task><hint>This tag contains the complete task context. Do NOT call viewTask to re-fetch it.</hint>+Use the task tools or, with a shell, \`lh task\` (\`lh man task\` lists the commands). Respect dependencies, record milestones in task comments, and pin deliverables as task documents.TASK-1 (id: task_root) 写一本书Status: ● running Priority: -+When all deliverables are ready, request completion of this task (\`lh task complete <id>\` with a shell).Instruction: 写书Subtasks:@@ -139,8 +155,10 @@ Review: (not configured)exports[`buildTaskRunPrompt > should include subtasks in task tag when provided 1`] = `"<task><hint>This tag contains the complete task context. Do NOT call viewTask to re-fetch it.</hint>+Use the task tools or, with a shell, \`lh task\` (\`lh man task\` lists the commands). Respect dependencies, record milestones in task comments, and pin deliverables as task documents.TASK-1 (id: task_001) 写一本书Status: ● running Priority: -+When all deliverables are ready, request completion of this task (\`lh task complete <id>\` with a shell).Instruction: 写一本 AI Agent 书,目标 8 章Subtasks:@@ -159,8 +177,10 @@ exports[`buildTaskRunPrompt > should only include user comments in user_feedback<task><hint>This tag contains the complete task context. Do NOT call viewTask to re-fetch it.</hint>+Use the task tools or, with a shell, \`lh task\` (\`lh man task\` lists the commands). Respect dependencies, record milestones in task comments, and pin deliverables as task documents.TASK-1 (id: task_test) 写一本书Status: ● running Priority: -+When all deliverables are ready, request completion of this task (\`lh task complete <id>\` with a shell).Instruction: 写书Review: (not configured)@@ -182,8 +202,10 @@ exports[`buildTaskRunPrompt > should place high_priority_instruction first, then<task><hint>This tag contains the complete task context. Do NOT call viewTask to re-fetch it.</hint>+Use the task tools or, with a shell, \`lh task\` (\`lh man task\` lists the commands). Respect dependencies, record milestones in task comments, and pin deliverables as task documents.TASK-1 (id: task_test) 写一本书Status: ● running Priority: -+When all deliverables are ready, request completion of this task (\`lh task complete <id>\` with a shell).Instruction: 写书Review: (not configured)@@ -201,8 +223,10 @@ exports[`buildTaskRunPrompt > should prioritize user feedback at the top 1`] = `<task><hint>This tag contains the complete task context. Do NOT call viewTask to re-fetch it.</hint>+Use the task tools or, with a shell, \`lh task\` (\`lh man task\` lists the commands). Respect dependencies, record milestones in task comments, and pin deliverables as task documents.TASK-1 (id: task_test) 写一本书Status: ● running Priority: -+When all deliverables are ready, request completion of this task (\`lh task complete <id>\` with a shell).Instruction: 写书Review: (not configured)@@ -216,8 +240,10 @@ Activities:exports[`buildTaskRunPrompt > should show resolved action and comment on briefs 1`] = `"<task><hint>This tag contains the complete task context. Do NOT call viewTask to re-fetch it.</hint>+Use the task tools or, with a shell, \`lh task\` (\`lh man task\` lists the commands). Respect dependencies, record milestones in task comments, and pin deliverables as task documents.TASK-2 (id: task_test) 第2章Status: ● running Priority: -+When all deliverables are ready, request completion of this task (\`lh task complete <id>\` with a shell).Instruction: 写第2章Review: (not configured)@@ -234,8 +260,10 @@ exports[`buildTaskRunPrompt > should truncate comments to 80 chars in activities<task><hint>This tag contains the complete task context. Do NOT call viewTask to re-fetch it.</hint>+Use the task tools or, with a shell, \`lh task\` (\`lh man task\` lists the commands). Respect dependencies, record milestones in task comments, and pin deliverables as task documents.TASK-1 (id: task_test) 写一本书Status: ● running Priority: -+When all deliverables are ready, request completion of this task (\`lh task complete <id>\` with a shell).Instruction: 写书Review: (not configured)diff --git a/packages/prompts/src/prompts/task/index.test.ts b/packages/prompts/src/prompts/task/index.test.tsindex 51bfd8357b7..6b0eb0d573e 100644--- a/packages/prompts/src/prompts/task/index.test.ts+++ b/packages/prompts/src/prompts/task/index.test.ts@@ -130,6 +130,7 @@ describe('buildTaskRunPrompt', () => {);expect(result).toContain('Automation: heartbeat, every 4h');+ expect(result).not.toContain('When all deliverables are ready, request completion');expect(result).toContain('NEVER end the loop for that, and never set it to canceled or failed');// A tick may retire the loop only when the instruction's own end condition is met.expect(result).toContain('when the Instruction defines an end condition');@@ -170,6 +171,7 @@ describe('buildTaskRunPrompt', () => {);expect(result).not.toContain('Automation:');+ expect(result).toContain('When all deliverables are ready, request completion');});it('should prioritize user feedback at the top', () => {@@ -460,6 +462,7 @@ describe('buildTaskRunPrompt', () => {expect(result).toContain('console is clean');expect(result).toContain('include artifact paths, commands, and observed results');expect(result).toContain('an independent verifier decides whether this Task is complete');+ expect(result).not.toContain('When all deliverables are ready, request completion');expect(result).toContain('Run the Acceptance inside this Task, not after it');expect(result).toMatch(/`lh acceptance install`.*plan path.*chapters on every recording/);expect(result).not.toContain('lh acceptance run result submit'); // the skill owns publishingdiff --git a/packages/prompts/src/prompts/task/index.ts b/packages/prompts/src/prompts/task/index.tsindex aebc811c317..732a81148d9 100644--- a/packages/prompts/src/prompts/task/index.ts+++ b/packages/prompts/src/prompts/task/index.ts@@ -744,6 +744,7 @@ export const buildTaskRunPrompt = (input: TaskRunPromptInput, now?: Date): strinconst taskLines = [`<task>`,`<hint>This tag contains the complete task context. Do NOT call viewTask to re-fetch it.</hint>`,+ `Use the task tools or, with a shell, \`lh task\` (\`lh man task\` lists the commands). Respect dependencies, record milestones in task comments, and pin deliverables as task documents.`,`${taskIdentity(task)} ${task.name || task.identifier}`,`Status: ${statusIcon(task.status)} ${task.status} Priority: ${priorityLabel(task.priority)}`,];@@ -755,7 +756,11 @@ export const buildTaskRunPrompt = (input: TaskRunPromptInput, now?: Date): strin? `cron "${task.schedulePattern}" (${task.scheduleTimezone || 'UTC'})`: task.automationMode;taskLines.push(- `Automation: ${cadence} — this task is a recurring loop and this run is one tick of it. When the run ends, the next tick is armed automatically; a tick with nothing to do, or whose condition is not met yet, is still a successful run — NEVER end the loop for that, and never set it to canceled or failed. The only exception: when the Instruction defines an end condition (e.g. "until X", "stop once Y", "after Z is done") and this tick has verified that it is now met, mark this task completed as your final step — that retires the loop once this run finishes. Do not ask the user to stop it instead.`,+ `Automation: ${cadence} — this task is a recurring loop and this run is one tick of it. When the run ends, the next tick is armed automatically; a tick with nothing to do, or whose condition is not met yet, is still a successful run — NEVER end the loop for that, and never set it to canceled or failed. The only exception: when the Instruction defines an end condition (e.g. "until X", "stop once Y", "after Z is done") and this tick has verified that it is now met, request completion (\`lh task complete <id>\` with a shell) as your final step — that retires the loop once this run finishes. Do not ask the user to stop it instead.`,+ );+ } else if (!task.verify?.enabled && !task.review?.enabled) {+ taskLines.push(+ 'When all deliverables are ready, request completion of this task (`lh task complete <id>` with a shell).',);}taskLines.push(`Instruction: ${task.instruction}`);diff --git a/scripts/vercelIgnoredBuildStep.test.ts b/scripts/vercelIgnoredBuildStep.test.tsindex e57cc9c97fe..55867ee02c7 100644--- a/scripts/vercelIgnoredBuildStep.test.ts+++ b/scripts/vercelIgnoredBuildStep.test.ts@@ -26,7 +26,7 @@ describe('isNonRuntimePath', () => {it.each(['src/app/page.tsx','packages/agent-templates/src/templates/claw/SOUL.md',- 'packages/builtin-skills/src/task/SKILL.md',+ 'packages/builtin-skills/src/lobehub/references/task.md','scripts/migrateServerDB/index.ts','package.json',])('builds for %s', (file) => {diff --git a/src/features/ProfileEditor/profileToolVisibility.test.ts b/src/features/ProfileEditor/profileToolVisibility.test.tsindex 411e16d9eb9..4219d61c0ee 100644--- a/src/features/ProfileEditor/profileToolVisibility.test.ts+++ b/src/features/ProfileEditor/profileToolVisibility.test.ts@@ -3,9 +3,9 @@ import { describe, expect, it } from 'vitest';import { getVisibleProfileToolIds } from './profileToolVisibility';describe('getVisibleProfileToolIds', () => {- it('excludes runtime-managed builtins, internal skills, and agent connectors', () => {+ it('excludes runtime-managed builtins and agent connectors', () => {const result = getVisibleProfileToolIds(- ['lobe-web-browsing', 'task', 'agent-connector', 'workspace-plugin'],+ ['lobe-web-browsing', 'agent-connector', 'workspace-plugin'],{agentConnectorIdentifiers: new Set(['agent-connector']),nonConfigurableBuiltinToolIdentifiers: new Set(['lobe-web-browsing']),diff --git a/src/features/ProfileEditor/profileToolVisibility.ts b/src/features/ProfileEditor/profileToolVisibility.tsindex d03be2fdd31..2ad43564c6d 100644--- a/src/features/ProfileEditor/profileToolVisibility.ts+++ b/src/features/ProfileEditor/profileToolVisibility.ts@@ -1,5 +1,3 @@-import { USER_HIDDEN_BUILTIN_SKILLS } from '@/helpers/skillFilters';-interface ProfileToolVisibilityOptions {agentConnectorIdentifiers?: ReadonlySet<string> | null;nonConfigurableBuiltinToolIdentifiers: ReadonlySet<string>;@@ -20,7 +18,5 @@ export const getVisibleProfileToolIds = (): string[] =>toolIds.filter((toolId) =>- !USER_HIDDEN_BUILTIN_SKILLS.has(toolId) &&- !nonConfigurableBuiltinToolIdentifiers.has(toolId) &&- !agentConnectorIdentifiers?.has(toolId),+ !nonConfigurableBuiltinToolIdentifiers.has(toolId) && !agentConnectorIdentifiers?.has(toolId),);diff --git a/src/helpers/skillFilters.test.ts b/src/helpers/skillFilters.test.tsindex b761b7f4fe9..649d6e4b7a6 100644--- a/src/helpers/skillFilters.test.ts+++ b/src/helpers/skillFilters.test.ts@@ -14,11 +14,6 @@ describe('skillFilters', () => {);});- it('should disable task builtin skill globally', () => {- expect(shouldEnableBuiltinSkill('task', { canExecuteOnDevice: false })).toBe(false);- expect(shouldEnableBuiltinSkill('task', { canExecuteOnDevice: true })).toBe(false);- });-it('should enable agent-browser when the run can execute on a device', () => {expect(shouldEnableBuiltinSkill('lobe-agent-browser', { canExecuteOnDevice: true })).toBe(true);});@@ -52,13 +47,6 @@ describe('skillFilters', () => {name: 'Artifacts',source: 'builtin' as const,},- {- content: 'task',- description: 'task',- identifier: 'task',- name: 'Task',- source: 'builtin' as const,- },];const filtered = filterBuiltinSkills(skills, { canExecuteOnDevice: false });diff --git a/src/helpers/skillFilters.ts b/src/helpers/skillFilters.tsindex a0266a6b918..1be12f18f7b 100644--- a/src/helpers/skillFilters.ts+++ b/src/helpers/skillFilters.ts@@ -5,7 +5,6 @@ import { isDesktop } from '@lobechat/const';import {type BuiltinSkillEnvironment,isBuiltinSkillEnabled,- USER_HIDDEN_BUILTIN_SKILLS,} from '@lobechat/mecha/builtinSkillGate';import { type BuiltinSkill } from '@lobechat/types';@@ -29,5 +28,3 @@ export const filterBuiltinSkills = <T extends Pick<BuiltinSkill, 'identifier'>>(skills: T[],context: BuiltinSkillFilterContext = DEFAULT_CONTEXT,): T[] => skills.filter((skill) => shouldEnableBuiltinSkill(skill.identifier, context));--export { USER_HIDDEN_BUILTIN_SKILLS };