Browse Source

core: reorganize agent configuration to separate primary agents (build, plan) from subagents

Dax Raad 2 months ago
parent
commit
b0f77da56c

+ 1 - 1
.github/workflows/publish.yml

@@ -102,7 +102,7 @@ jobs:
             target: aarch64-apple-darwin
           - host: blacksmith-4vcpu-windows-2025
             target: x86_64-pc-windows-msvc
-          - host: blacksmith-4vcpu-ubuntu-2404
+          - host: blacksmith-4vcpu-ubuntu-2204
             target: x86_64-unknown-linux-gnu
     runs-on: ${{ matrix.settings.host }}
     steps:

+ 18 - 18
packages/opencode/src/agent/agent.ts

@@ -107,6 +107,24 @@ export namespace Agent {
     )
 
     const result: Record<string, Info> = {
+      build: {
+        name: "build",
+        tools: { ...defaultTools },
+        options: {},
+        permission: agentPermission,
+        mode: "primary",
+        native: true,
+      },
+      plan: {
+        name: "plan",
+        options: {},
+        permission: planPermission,
+        tools: {
+          ...defaultTools,
+        },
+        mode: "primary",
+        native: true,
+      },
       general: {
         name: "general",
         description: `General-purpose agent for researching complex questions and executing multi-step tasks. Use this agent to execute multiple units of work in parallel.`,
@@ -149,14 +167,6 @@ export namespace Agent {
         options: {},
         permission: agentPermission,
       },
-      build: {
-        name: "build",
-        tools: { ...defaultTools },
-        options: {},
-        permission: agentPermission,
-        mode: "primary",
-        native: true,
-      },
       title: {
         name: "title",
         mode: "primary",
@@ -177,16 +187,6 @@ export namespace Agent {
         prompt: PROMPT_SUMMARY,
         tools: {},
       },
-      plan: {
-        name: "plan",
-        options: {},
-        permission: planPermission,
-        tools: {
-          ...defaultTools,
-        },
-        mode: "primary",
-        native: true,
-      },
     }
     for (const [key, value] of Object.entries(cfg.agent ?? {})) {
       if (value.disable) {

+ 6 - 0
packages/opencode/src/config/config.ts

@@ -668,10 +668,16 @@ export namespace Config {
         .describe("@deprecated Use `agent` field instead."),
       agent: z
         .object({
+          // primary
           plan: Agent.optional(),
           build: Agent.optional(),
+          // subagent
           general: Agent.optional(),
           explore: Agent.optional(),
+          // specialized
+          title: Agent.optional(),
+          summary: Agent.optional(),
+          compaction: Agent.optional(),
         })
         .catchall(Agent)
         .optional()