diff --git a/src/agents/agent-tools.deferred-followup-guidance.test.ts b/src/agents/agent-tools.deferred-followup-guidance.test.ts index 835d8e200acd..ed53989056c9 100644 --- a/src/agents/agent-tools.deferred-followup-guidance.test.ts +++ b/src/agents/agent-tools.deferred-followup-guidance.test.ts @@ -232,7 +232,7 @@ describe("createOpenClawCodingTools availability guidance", () => { expect(tool?.description).toContain("configured agent (see agents_list);"); expect(tool?.description).toContain("sessions_history"); expect(tool?.description).not.toContain("agents_wait"); - expect(tool?.description).not.toContain("subagents"); + expect(tool?.description).not.toContain("`subagents`"); expect(tool?.description).toContain("persistent/thread-bound"); expect(tool?.description).toContain("(self: current session only)"); expect(tool?.description).not.toContain('runtime="acp"'); @@ -251,7 +251,7 @@ describe("createOpenClawCodingTools availability guidance", () => { ] as AnyAgentTool[]); expect(tool?.description).toContain( - "Default to a hidden subagent for internal QA, research, coding, review, tests, and parallel work supporting the current task. This includes substantial, bounded API/service investigations that can be handed off with the needed context and capabilities. Omit `visible` or set it false, and report results through the parent.", + "Execute work directly by default. Delegate a bounded, independent task only when parallel execution or an independent review provides a concrete benefit. Keep dependent steps with the same owner. Once delegation is appropriate, use a hidden subagent unless the user needs a separate, independently steerable session. This includes substantial, bounded API/service investigations that can be handed off with the needed context and capabilities. For hidden subagents, omit `visible` or set it false, and report results through the parent.", ); expect(tool?.description).not.toContain("trial-and-error"); expect(tool?.description).toContain("configured agent (see agents_list);"); diff --git a/src/agents/system-prompt.test.ts b/src/agents/system-prompt.test.ts index ceccb2367c7e..b7b28e01d1e6 100644 --- a/src/agents/system-prompt.test.ts +++ b/src/agents/system-prompt.test.ts @@ -987,7 +987,7 @@ describe("system prompt memory and runtime cache boundary", () => { expect(next.prefix).toBe(first.prefix); expect(first.prefix).toContain("## Care"); expect(first.prefix).toContain( - "Large work: `sessions_spawn`; follow the accepted completion mode.", + "Execute work directly by default. Delegate a bounded, independent task only when parallel execution or an independent review provides a concrete benefit. Keep dependent steps with the same owner.", ); expect(first.prefix).not.toContain("## Proactive Sub-Agent Orchestration"); expect(first.suffix).not.toContain("Ultra active"); diff --git a/src/agents/system-prompt.ts b/src/agents/system-prompt.ts index 37b021689a4d..78d8b80c7afe 100644 --- a/src/agents/system-prompt.ts +++ b/src/agents/system-prompt.ts @@ -815,9 +815,9 @@ export function buildAgentSystemPrompt(params: { : []), ...(hasSessionsSpawn ? [ - "Large work: `sessions_spawn`; follow the accepted completion mode.", - '`sessions_spawn`: clean context => `context:"isolated"`; transcript needed => `context:"fork"`.', - "Default to subagents for internal work; use `visible:true` only for a separate session the user requests or needs to revisit and steer independently.", + "Execute work directly by default. Delegate a bounded, independent task only when parallel execution or an independent review provides a concrete benefit. Keep dependent steps with the same owner.", + '`sessions_spawn`: clean context => `context:"isolated"`; transcript needed => `context:"fork"`. Follow the accepted completion mode.', + "Once delegation is appropriate, use a hidden subagent unless the user needs a separate, independently steerable session.", ] : []), ...(availableTools.has("screen") diff --git a/src/agents/tool-description-presets.test.ts b/src/agents/tool-description-presets.test.ts index 86d3c5749856..a328d2253aae 100644 --- a/src/agents/tool-description-presets.test.ts +++ b/src/agents/tool-description-presets.test.ts @@ -95,7 +95,7 @@ describe("sessions_spawn delegation guidance", () => { it("bounds API investigation handoffs without delegating quick lookups", () => { const description = describeSessionsSpawnTool(); expect(description).toContain( - "Default to a hidden subagent for internal QA, research, coding, review, tests, and parallel work supporting the current task. This includes substantial, bounded API/service investigations that can be handed off with the needed context and capabilities. Omit `visible` or set it false, and report results through the parent.", + "Execute work directly by default. Delegate a bounded, independent task only when parallel execution or an independent review provides a concrete benefit. Keep dependent steps with the same owner. Once delegation is appropriate, use a hidden subagent unless the user needs a separate, independently steerable session. This includes substantial, bounded API/service investigations that can be handed off with the needed context and capabilities. For hidden subagents, omit `visible` or set it false, and report results through the parent.", ); expect(description).toContain( "A PR/report, long runtime, or isolated worktree alone does not justify a sidebar session. A request for a subagent does not request a separate session. No spawn for quick lookup/single read.", diff --git a/src/agents/tool-description-presets.ts b/src/agents/tool-description-presets.ts index e105738b0424..795ba025d4e8 100644 --- a/src/agents/tool-description-presets.ts +++ b/src/agents/tool-description-presets.ts @@ -148,7 +148,7 @@ export function describeSessionsSpawnTool(options?: { ? '`mode="run"` one-shot; `mode="session"` persistent/thread-bound only on supporting requester channel.' : '`mode="run"` one-shot background.', "`agentId` targets a configured agent; `model` overrides its model; `cleanup` delete|keep hidden child session; `sandbox` inherit|require.", - "Default to a hidden subagent for internal QA, research, coding, review, tests, and parallel work supporting the current task. This includes substantial, bounded API/service investigations that can be handed off with the needed context and capabilities. Omit `visible` or set it false, and report results through the parent.", + "Execute work directly by default. Delegate a bounded, independent task only when parallel execution or an independent review provides a concrete benefit. Keep dependent steps with the same owner. Once delegation is appropriate, use a hidden subagent unless the user needs a separate, independently steerable session. This includes substantial, bounded API/service investigations that can be handed off with the needed context and capabilities. For hidden subagents, omit `visible` or set it false, and report results through the parent.", '`visible=true`: durable visible session. Use only when the user requests a separate session or needs to revisit and steer the work independently. Shows in web UI sidebar; works without UI: announcing runs report back, progress checkable. `group` places it in a custom sidebar group (a new name creates the group); omission or an empty string leaves it ungrouped. Subagent only; omit `mode` (`mode="run"` is also accepted), `thread`, `thinking`, and `lightContext`; `attachments=[]` and omitted/blank `attachAs.mountPath` are accepted, but nonempty attachment staging is unsupported; inherits the caller tool-policy ceiling; select a registered project with `projectId` or a managed GitHub clone with `projectGitUrl` (mutually exclusive with each other and `cwd`); may check out a git worktree via `worktree`/`worktreeName`/`worktreeBaseRef`. When its accepted result includes `sessionUrl`, channel acknowledgements put the session URL on the first line and `Owner: