From 2f97b7fe4b04f10dc34fc7451ecfa3355a70a4f7 Mon Sep 17 00:00:00 2001 From: can1357 Date: Sat, 11 Jul 2026 05:36:37 +0200 Subject: [PATCH] feat(coding-agent): removed plan subagent - Removed the `plan` agent definition and associated prompt file from bundled agents. - Updated documentation to reflect the removal of `plan` from available subagents. - Cleaned up related tests to remove references to the deprecated agent. --- docs/task-agent-discovery.md | 4 +- docs/tools/task.md | 2 +- packages/coding-agent/CHANGELOG.md | 5 ++ .../coding-agent/src/prompts/agents/plan.md | 47 ------------------- packages/coding-agent/src/task/agents.ts | 2 - .../test/bundled-agent-parsing.test.ts | 33 +++++-------- .../tools/task-agent-capabilities.test.ts | 4 +- 7 files changed, 21 insertions(+), 76 deletions(-) delete mode 100644 packages/coding-agent/src/prompts/agents/plan.md diff --git a/docs/task-agent-discovery.md b/docs/task-agent-discovery.md index 7e35066e6..c725f61f0 100644 --- a/docs/task-agent-discovery.md +++ b/docs/task-agent-discovery.md @@ -35,7 +35,7 @@ Parsing comes from frontmatter via `parseAgentFields()` (`src/discovery/helpers. - `spawns` accepts `*`, CSV, or array - backward-compat behavior: if `spawns` missing but `tools` includes `task`, `spawns` becomes `*` - `output` is passed through as opaque schema data -- `read-summarize: false` (parsed as `readSummarize`) forces the subagent's `read` tool to return verbatim file content instead of structural summaries — `runSubprocess` applies it as a `read.summarize.enabled: false` override on the subagent's isolated settings (`src/task/executor.ts`). `explore` and `librarian` ship with it disabled. Defaults to enabled when the field is absent. +- `read-summarize: false` (parsed as `readSummarize`) forces the subagent's `read` tool to return verbatim file content instead of structural summaries — `runSubprocess` applies it as a `read.summarize.enabled: false` override on the subagent's isolated settings (`src/task/executor.ts`). `scout` and `librarian` ship with it disabled. Defaults to enabled when the field is absent. ## Bundled agents @@ -43,7 +43,7 @@ Bundled agents are embedded at build time (`src/task/agents.ts`) using text impo `EMBEDDED_AGENT_DEFS` defines: -- `explore`, `plan`, `designer`, `reviewer`, `librarian`, `oracle` from prompt files +- `scout`, `designer`, `reviewer`, `librarian` from prompt files - `task` and `sonic` from shared `task.md` body plus injected frontmatter Loading path: diff --git a/docs/tools/task.md b/docs/tools/task.md index abf8bdcbe..790fc14ce 100644 --- a/docs/tools/task.md +++ b/docs/tools/task.md @@ -106,7 +106,7 @@ Artifacts and side channels: - off — single spawn per call; `tasks`/`context` are rejected and removed from the schema. - Isolation mode (`task.isolation.mode`): `none`, `auto`, `apfs`, `btrfs`, `zfs`, `reflink`, `overlayfs`, `projfs`, `block-clone`, `rcopy` (legacy `worktree`, `fuse-overlay`, `fuse-projfs` accepted for back-compat); the PAL resolves the actual backend with fallback. - Isolation merge strategy: patch mode (capture/apply root patches) or branch mode (commit to `omp/task/`, cherry-pick into parent). -- Agent source precedence: project custom agents, then user custom agents, then bundled agents (`explore`, `plan`, `designer`, `reviewer`, `task`, `sonic`, `librarian`, `oracle`). +- Agent source precedence: project custom agents, then user custom agents, then bundled agents (`scout`, `designer`, `reviewer`, `task`, `sonic`, `librarian`). ## Side Effects - Filesystem diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index ea88cd5fc..4223ac799 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -8,6 +8,11 @@ - Optimized subagent usage to discourage single-agent delegation and improve parallel execution flows - Clarified that prerequisite work for subagent tasks should be handled inline by the main agent +### Removed + +- Removed the bundled `plan` subagent from available task agents +- Removed the bundled `plan` subagent from available task agents. + ## [16.4.2] - 2026-07-10 ### Fixed diff --git a/packages/coding-agent/src/prompts/agents/plan.md b/packages/coding-agent/src/prompts/agents/plan.md deleted file mode 100644 index 66ca395b0..000000000 --- a/packages/coding-agent/src/prompts/agents/plan.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -name: plan -description: Software architect for complex multi-file architectural decisions. NOT for simple tasks, single-file changes, or tasks completable in <5 tool calls. -tools: read, grep, glob, bash, lsp, web_search, ast_grep -spawns: scout -model: pi/plan, pi/slow ---- - -Analyze the codebase and the user's request. Produce a detailed implementation plan. - -## Phase 1: Understand -1. Parse requirements precisely -2. Identify ambiguities; list assumptions - -## Phase 2: Explore -1. Find existing patterns via `grep`/`glob` -2. Read key files; understand architecture -3. Trace data flow through relevant paths -4. Identify types, interfaces, contracts -5. Note dependencies between components - -You MUST spawn `scout` agents for independent areas and synthesize findings. - -## Phase 3: Design -1. List concrete changes (files, functions, types) -2. Define sequence and dependencies -3. Identify edge cases and error conditions -4. Consider alternatives; justify your choice -5. Note pitfalls/tricky parts - -## Phase 4: Produce Plan - -You MUST write a plan executable without re-exploration. - - -- **Summary**: What to build and why (one paragraph). -- **Changes**: Concrete changes (files, functions, types). Exact file paths/line ranges where relevant. -- **Sequence**: Ordering and dependencies between sub-tasks. -- **Edge Cases**: Edge cases and error conditions to watch. -- **Verification**: Steps to verify correctness. -- **Critical Files**: Files the implementer must read to understand the codebase. - - - -You MUST operate as read-only. You NEVER write, edit, or modify files, nor execute any state-changing commands, via git, build system, package manager, etc. -You MUST keep going until complete. - diff --git a/packages/coding-agent/src/task/agents.ts b/packages/coding-agent/src/task/agents.ts index 4399f2751..627a99304 100644 --- a/packages/coding-agent/src/task/agents.ts +++ b/packages/coding-agent/src/task/agents.ts @@ -10,7 +10,6 @@ import designerMd from "../prompts/agents/designer.md" with { type: "text" }; // Embed agent markdown files at build time import agentFrontmatterTemplate from "../prompts/agents/frontmatter.md" with { type: "text" }; import librarianMd from "../prompts/agents/librarian.md" with { type: "text" }; -import planMd from "../prompts/agents/plan.md" with { type: "text" }; import reviewerMd from "../prompts/agents/reviewer.md" with { type: "text" }; import scoutMd from "../prompts/agents/scout.md" with { type: "text" }; import taskMd from "../prompts/agents/task.md" with { type: "text" }; @@ -41,7 +40,6 @@ function buildAgentContent(def: EmbeddedAgentDef): string { const EMBEDDED_AGENT_DEFS: EmbeddedAgentDef[] = [ { fileName: "scout.md", template: scoutMd }, - { fileName: "plan.md", template: planMd }, { fileName: "designer.md", template: designerMd }, { fileName: "reviewer.md", template: reviewerMd }, { fileName: "librarian.md", template: librarianMd }, diff --git a/packages/coding-agent/test/bundled-agent-parsing.test.ts b/packages/coding-agent/test/bundled-agent-parsing.test.ts index a4da8e57d..87133e0fd 100644 --- a/packages/coding-agent/test/bundled-agent-parsing.test.ts +++ b/packages/coding-agent/test/bundled-agent-parsing.test.ts @@ -15,22 +15,13 @@ describe("bundled agent parsing", () => { expect(reviewer?.thinkingLevel).toBeUndefined(); }); - it("lets plan inherit thinking effort from its model role", () => { - const plan = getBundledAgent("plan"); - - expect(plan).toBeDefined(); - expect(plan?.source).toBe("bundled"); - expect(plan?.model).toEqual(["pi/plan", "pi/slow"]); - expect(plan?.thinkingLevel).toBeUndefined(); - }); - // Issue #4761: with `modelRoles.slow: ...:xhigh`, the role's explicit effort // suffix must survive agent-pattern expansion and model resolution for the // bundled agents routed at that role. The executor picks // `agent.thinkingLevel ?? resolvedThinkingLevel` (task/executor.ts), so a - // bundled frontmatter pin would mask the suffix — reviewer/plan declare none + // bundled frontmatter pin would mask the suffix — reviewer declares none // (asserted above) and the resolved level below is what the subagent runs at. - it("resolves the configured slow-role effort suffix for reviewer and plan", () => { + it("resolves the configured slow-role effort suffix for reviewer", () => { const gpt55 = buildModel({ id: "gpt-5.5", name: "GPT-5.5 Codex", @@ -45,19 +36,17 @@ describe("bundled agent parsing", () => { maxTokens: 128000, }); const settings = Settings.isolated({ - modelRoles: { slow: "openai-codex/gpt-5.5:xhigh", plan: "openai-codex/gpt-5.5:xhigh" }, + modelRoles: { slow: "openai-codex/gpt-5.5:xhigh" }, }); const registry = { getAvailable: () => [gpt55] } as Parameters[1]; - for (const name of ["reviewer", "plan"]) { - const agent = getBundledAgent(name); - expect(agent?.thinkingLevel).toBeUndefined(); - const patterns = resolveAgentModelPatterns({ agentModel: agent?.model, settings }); - const resolved = resolveModelOverride(patterns, registry, settings); - expect(resolved.model?.provider).toBe("openai-codex"); - expect(resolved.model?.id).toBe("gpt-5.5"); - expect(resolved.thinkingLevel).toBe(Effort.XHigh); - expect(resolved.explicitThinkingLevel).toBe(true); - } + const agent = getBundledAgent("reviewer"); + expect(agent?.thinkingLevel).toBeUndefined(); + const patterns = resolveAgentModelPatterns({ agentModel: agent?.model, settings }); + const resolved = resolveModelOverride(patterns, registry, settings); + expect(resolved.model?.provider).toBe("openai-codex"); + expect(resolved.model?.id).toBe("gpt-5.5"); + expect(resolved.thinkingLevel).toBe(Effort.XHigh); + expect(resolved.explicitThinkingLevel).toBe(true); }); }); diff --git a/packages/coding-agent/test/tools/task-agent-capabilities.test.ts b/packages/coding-agent/test/tools/task-agent-capabilities.test.ts index 62011854a..022b2f057 100644 --- a/packages/coding-agent/test/tools/task-agent-capabilities.test.ts +++ b/packages/coding-agent/test/tools/task-agent-capabilities.test.ts @@ -14,7 +14,7 @@ describe("task agent capability descriptions", () => { const agents = loadBundledAgents(); expect(isReadOnlyAgent(agentByName(agents, "scout"))).toBe(true); - for (const name of ["task", "sonic", "plan", "reviewer", "designer"]) { + for (const name of ["task", "sonic", "reviewer", "designer"]) { expect(isReadOnlyAgent(agentByName(agents, name))).toBe(false); } }); @@ -24,7 +24,7 @@ describe("task agent capability descriptions", () => { expect(agentByName(agents, "scout").readSummarize).toBe(false); expect(agentByName(agents, "librarian").readSummarize).toBe(false); - for (const name of ["task", "sonic", "plan", "reviewer", "designer"]) { + for (const name of ["task", "sonic", "reviewer", "designer"]) { expect(agentByName(agents, name).readSummarize).toBeUndefined(); } });