π€― 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
βοΈ chore(goal): raise the default per-Task attempt budget from 3 to 8 (#19575)
Arvin Xud1a33225f77d
diff --git a/apps/server/src/services/goal/recoveryPolicy.ts b/apps/server/src/services/goal/recoveryPolicy.tsindex 960acd67f66..71eb3357ae1 100644--- a/apps/server/src/services/goal/recoveryPolicy.ts+++ b/apps/server/src/services/goal/recoveryPolicy.ts@@ -1,6 +1,17 @@import type { GoalItem } from '@lobechat/types';-const DEFAULT_MAX_ATTEMPTS_PER_TASK = 3;+/**+ * Attempts a Task gets before the coordinator opens a decision gate, when the+ * goal does not set its own.+ *+ * Long-horizon Tasks spend attempts on more than rejected deliveries: a run that+ * outlives its lease, a dispatch that never reached the device, a review that+ * asks for one more piece of evidence. Three attempts ran out on exactly those β+ * a Task whose work was finished still stopped the whole goal on a person β so+ * the default leaves room for a few infrastructure retries plus real repair+ * rounds. A goal can still set a lower `recovery.maxAttemptsPerTask`.+ */+const DEFAULT_MAX_ATTEMPTS_PER_TASK = 8;/*** Conservative on purpose: enough to stop independent Tasks queueing behind one* another, low enough that a goal cannot empty its budget in one fan-out beforediff --git a/apps/server/src/services/goal/supervisor/policy.test.ts b/apps/server/src/services/goal/supervisor/policy.test.tsindex bbbf585d283..9581a578fe1 100644--- a/apps/server/src/services/goal/supervisor/policy.test.ts+++ b/apps/server/src/services/goal/supervisor/policy.test.ts@@ -127,12 +127,14 @@ describe('supervisor recovery authority', () => {} as AgentOperationItem).eligible,).toBe(false);expect(- recoveryEligibility(graph, { ...task, totalTopics: 3, status: 'paused' }, settled).eligible,+ recoveryEligibility(graph, { ...task, totalTopics: 8, status: 'paused' }, settled).eligible,).toBe(false);});it('respects attempt exhaustion and explicit manual decisions', () => {- expect(recoveryEligibility(graph, { ...task, totalTopics: 3 }, operation).eligible).toBe(false);+ // No `recovery.maxAttemptsPerTask` on this goal, so the default budget applies.+ expect(recoveryEligibility(graph, { ...task, totalTopics: 7 }, operation).eligible).toBe(true);+ expect(recoveryEligibility(graph, { ...task, totalTopics: 8 }, operation).eligible).toBe(false);expect(recoveryEligibility({ ...graph, decisions: [{ status: 'pending' }] } as GoalGraphSnapshot,diff --git a/packages/builtin-tool-goal/src/createGoalInput.ts b/packages/builtin-tool-goal/src/createGoalInput.tsindex 934607884cd..410f51d2676 100644--- a/packages/builtin-tool-goal/src/createGoalInput.ts+++ b/packages/builtin-tool-goal/src/createGoalInput.ts@@ -16,7 +16,7 @@ export interface GoalCriterionInput {** `null` is the manifest's documented "no user-specified cap" β the cleared* input field β and must stay distinct from a chosen number, or clearing the- * field would quietly pin the goal to three attempts. Returning `undefined`+ * field would quietly pin the goal to a fixed count. Returning `undefined`* leaves `maxAttemptsPerTask` off the config so `resolveTaskAttemptBudget`* applies its own default.*/diff --git a/packages/builtin-tool-goal/src/manifest.ts b/packages/builtin-tool-goal/src/manifest.tsindex e6d59c9e3cf..68bfa58e9f0 100644--- a/packages/builtin-tool-goal/src/manifest.ts+++ b/packages/builtin-tool-goal/src/manifest.ts@@ -45,7 +45,7 @@ export const GoalManifest: BuiltinToolManifest = {instruction: { description: 'Detailed task direction and constraints.', type: 'string' },maxIterations: {description:- 'Maximum attempts one task may take before the goal opens a decision gate. Default 3, minimum 2. Null means no user-specified cap.',+ 'Maximum attempts one task may take before the goal opens a decision gate. Default 8, minimum 2. Null means no user-specified cap.',type: ['number', 'null'],},maxTotalCost: {diff --git a/packages/builtin-tool-goal/src/systemRole.ts b/packages/builtin-tool-goal/src/systemRole.tsindex b4fc1fe84d6..d9a4b9f927a 100644--- a/packages/builtin-tool-goal/src/systemRole.ts+++ b/packages/builtin-tool-goal/src/systemRole.ts@@ -1,3 +1,3 @@export const systemPrompt = `You have access to the Goal tool.-- **createGoal**: When β and only when β the user's message starts with \`/goal\`, turn the request into one editable goal plan and call createGoal before doing any substantive work. Use the current agent implicitly. Derive one concrete criterion per explicit requirement, default failed criteria to auto_repair, default maxIterations to 3, and omit maxTotalCost unless the user set one. The user confirms or edits the complete plan before the goal starts. After createGoal succeeds, the goal owns the work: its coordinator decomposes it and dispatches its own tasks, so do not perform, reproduce, preview, or self-check the requested work in the current conversation. End the turn with at most one brief sentence saying the goal is running and its live card shows progress.`;+- **createGoal**: When β and only when β the user's message starts with \`/goal\`, turn the request into one editable goal plan and call createGoal before doing any substantive work. Use the current agent implicitly. Derive one concrete criterion per explicit requirement, default failed criteria to auto_repair, default maxIterations to 8, and omit maxTotalCost unless the user set one. The user confirms or edits the complete plan before the goal starts. After createGoal succeeds, the goal owns the work: its coordinator decomposes it and dispatches its own tasks, so do not perform, reproduce, preview, or self-check the requested work in the current conversation. End the turn with at most one brief sentence saying the goal is running and its live card shows progress.`;diff --git a/packages/const/src/verify.ts b/packages/const/src/verify.tsindex cb917b6e5e0..22d0155b549 100644--- a/packages/const/src/verify.ts+++ b/packages/const/src/verify.ts@@ -384,7 +384,7 @@ export const DEFAULT_MAX_REPAIR_ROUNDS = 3;* (`tasks.config.verify.maxIterations`). Their product is the worst-case number* of agent runs a goal can pay for.*/-export const DEFAULT_GOAL_MAX_ROUNDS = 3;+export const DEFAULT_GOAL_MAX_ROUNDS = 8;/** Bounds the round budget a goal may be created with. */export const GOAL_MAX_ROUNDS_RANGE = { max: 10, min: 2 } as const;