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(task): drop the non-existent pending status from CLI help, skill docs and dead branches (#22924)

Lobehub Coder1c4ee6ba2fc1
diff --git a/apps/cli/src/commands/task/index.ts b/apps/cli/src/commands/task/index.ts
index 83c0644393e..f49415e89f0 100644
--- a/apps/cli/src/commands/task/index.ts
+++ b/apps/cli/src/commands/task/index.ts
@@ -45,7 +45,7 @@ export function registerTaskCommand(program: Command) {
.description('List tasks')
.option(
'--status <status>',
- 'Filter by status (pending/running/paused/completed/failed/canceled)',
+ 'Filter by status (backlog/running/scheduled/paused/completed/failed/canceled)',
)
.option('--root', 'Only show root tasks (no parent)')
.option('--parent <id>', 'Filter by parent task ID')
@@ -916,7 +916,7 @@ export function registerTaskCommand(program: Command) {
const prefix = indent === 0 ? '' : ' '.repeat(indent) + 'β”œβ”€β”€ ';
const name = t.name || t.identifier || '';
- const status = t.status || 'pending';
+ const status = t.status || 'backlog';
const identifier = t.identifier || t.id;
console.log(`${prefix}${pc.dim(identifier)} ${statusBadge(status)} ${name}`);
diff --git a/apps/cli/src/commands/task/lifecycle.test.ts b/apps/cli/src/commands/task/lifecycle.test.ts
index 69d616145b5..880f433b5e4 100644
--- a/apps/cli/src/commands/task/lifecycle.test.ts
+++ b/apps/cli/src/commands/task/lifecycle.test.ts
@@ -165,7 +165,7 @@ describe('task lifecycle β€” following the agent stream', () => {
followAgentRun.mockReset();
pollAgentRunStatus.mockReset();
client.task.find.query.mockResolvedValue({
- data: { assigneeAgentId: 'agt_1', identifier: 'T-1', status: 'pending' },
+ data: { assigneeAgentId: 'agt_1', identifier: 'T-1', status: 'backlog' },
});
client.task.updateStatus.mutate.mockResolvedValue({ data: { identifier: 'T-1' } });
client.task.run.mutate.mockResolvedValue({
diff --git a/apps/cli/src/commands/task/lifecycle.ts b/apps/cli/src/commands/task/lifecycle.ts
index 969c68c6df5..14592824854 100644
--- a/apps/cli/src/commands/task/lifecycle.ts
+++ b/apps/cli/src/commands/task/lifecycle.ts
@@ -39,7 +39,7 @@ export function registerLifecycleCommands(task: Command) {
task
.command('start <id>')
- .description('Start a task (pending β†’ running)')
+ .description('Start a task (backlog β†’ running)')
.option('--no-run', 'Only update status, do not trigger agent execution')
.option('-p, --prompt <text>', 'Additional context for the agent')
.option('-f, --follow', 'Follow agent output in real-time (default: run in background)')
diff --git a/packages/builtin-skills/src/task/references/commands.md b/packages/builtin-skills/src/task/references/commands.md
index c52105b652b..bf9f2fab943 100644
--- a/packages/builtin-skills/src/task/references/commands.md
+++ b/packages/builtin-skills/src/task/references/commands.md
@@ -3,7 +3,7 @@
## Core Commands
- `lh task list [--status <status>] [--root] [--parent <id>] [--agent <id>] [--label <name>] [--unlabeled] [-L <limit>] [--tree]` - List tasks
- - `--status`: pending, running, paused, completed, failed, canceled
+ - `--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
@@ -18,7 +18,7 @@
## Lifecycle Commands
-- `lh task start <id> [--no-run] [-p <prompt>] [-f] [-v]` - Start task (pending β†’ running)
+- `lh task start <id> [--no-run] [-p <prompt>] [-f] [-v]` - Start task (backlog β†’ running)
- `--no-run`: Only update status, skip agent execution
- `-f, --follow`: Follow agent output in real-time
- `-v, --verbose`: Show detailed tool call info
diff --git a/src/store/task/slices/detail/inFlight.test.ts b/src/store/task/slices/detail/inFlight.test.ts
new file mode 100644
index 00000000000..26d10552244
--- /dev/null
+++ b/src/store/task/slices/detail/inFlight.test.ts
@@ -0,0 +1,52 @@
+import { TASK_STATUSES } from '@lobechat/builtin-tool-task';
+import type { TaskDetailActivity, TaskDetailData, TaskDetailSubtask } from '@lobechat/types';
+import { describe, expect, it } from 'vitest';
+
+import { hasInFlightActivity } from './inFlight';
+
+const detail = (overrides: Partial<TaskDetailData> = {}): TaskDetailData => ({
+ identifier: 'T-1',
+ instruction: 'do it',
+ status: 'backlog',
+ ...overrides,
+});
+
+const subtask = (overrides: Partial<TaskDetailSubtask> = {}): TaskDetailSubtask => ({
+ identifier: 'T-2',
+ status: 'backlog',
+ ...overrides,
+});
+
+const topic = (status: string): TaskDetailActivity => ({ status, type: 'topic' });
+
+describe('hasInFlightActivity', () => {
+ it('stops polling without a detail', () => {
+ expect(hasInFlightActivity(undefined)).toBe(false);
+ });
+
+ it.each(TASK_STATUSES.map((status) => [status, status === 'running'] as const))(
+ 'polls a %s task only while it is running (%s)',
+ (status, expected) => {
+ expect(hasInFlightActivity(detail({ status }))).toBe(expected);
+ },
+ );
+
+ it.each(TASK_STATUSES.map((status) => [status, status === 'running'] as const))(
+ 'polls for a nested %s subtask only while it is running (%s)',
+ (status, expected) => {
+ const nested = subtask({ children: [subtask({ identifier: 'T-3', status })] });
+ expect(hasInFlightActivity(detail({ subtasks: [nested] }))).toBe(expected);
+ },
+ );
+
+ it('polls while a settled subtask still has a running topic', () => {
+ const settled = subtask({ runningTopic: { id: 'tpc_1' }, status: 'completed' });
+ expect(hasInFlightActivity(detail({ subtasks: [settled] }))).toBe(true);
+ });
+
+ it('polls while a topic activity is pending or running', () => {
+ expect(hasInFlightActivity(detail({ activities: [topic('pending')] }))).toBe(true);
+ expect(hasInFlightActivity(detail({ activities: [topic('running')] }))).toBe(true);
+ expect(hasInFlightActivity(detail({ activities: [topic('completed')] }))).toBe(false);
+ });
+});
diff --git a/src/store/task/slices/detail/inFlight.ts b/src/store/task/slices/detail/inFlight.ts
index c71b97fdf44..825e85a7056 100644
--- a/src/store/task/slices/detail/inFlight.ts
+++ b/src/store/task/slices/detail/inFlight.ts
@@ -7,7 +7,6 @@ const hasInFlightSubtask = (subtasks: TaskDetailSubtask[] | undefined): boolean
(subtask) =>
Boolean(subtask.runningTopic) ||
subtask.status === 'running' ||
- subtask.status === 'pending' ||
hasInFlightSubtask(subtask.children),
) ?? false;
@@ -16,7 +15,7 @@ const hasInFlightSubtask = (subtasks: TaskDetailSubtask[] | undefined): boolean
// a manual refresh. Returns false once everything settles so SWR stops polling.
export const hasInFlightActivity = (detail: TaskDetailData | undefined): boolean => {
if (!detail) return false;
- if (detail.status === 'running' || detail.status === 'pending') return true;
+ if (detail.status === 'running') return true;
if (hasInFlightSubtask(detail.subtasks)) return true;
return (
detail.activities?.some(