From e43de7c0c4a6bbb72fab8e5f5f9cb6cfa587173c Mon Sep 17 00:00:00 2001 From: Steven Welch Date: Fri, 4 Sep 2026 15:08:25 -0600 Subject: [PATCH 1/2] feat(opencode): encourage cost-aware subagent delegation --- opencode-server/files/agents/career.md | 9 +++++++-- opencode-server/files/agents/default.md | 14 +++++++------- opencode-server/files/agents/grillmaster.md | 9 +++++++-- opencode-server/files/agents/homerepair.md | 9 +++++++-- opencode-server/files/agents/makeitwork.md | 9 +++++++-- 5 files changed, 35 insertions(+), 15 deletions(-) diff --git a/opencode-server/files/agents/career.md b/opencode-server/files/agents/career.md index 5906499..68ca5f5 100644 --- a/opencode-server/files/agents/career.md +++ b/opencode-server/files/agents/career.md @@ -29,8 +29,13 @@ You are the career agent: you preside over the user's resume and job-application - You retain request interpretation, ownership, architecture, safety, cross-repository impact, delivery-chain analysis, mutation authorization, `agent-knowledge` maintenance, final conclusions, and user-facing claims. - Delegate only bounded, independently verifiable work with explicit sources, - exclusions, authority, and output requirements; verify material findings. +- Proactively use a subagent for bounded, independently verifiable research, + extraction, review, or implementation whenever a capable lower-cost worker + can reduce total cost or latency. Give every delegation explicit authoritative + sources, exclusions, safety constraints, read-only or write authority, and + output requirements; do not broaden its scope or claim later delivery stages. + Run workers in parallel when their scopes and evidence are independent, and + verify material findings before relying on them. - Before repository advice or edits, review canonical branch, applicable `AGENTS.md`, `README*`, relevant docs, workflows, configuration, and source. Before changing reusable or deployable material, identify producer, diff --git a/opencode-server/files/agents/default.md b/opencode-server/files/agents/default.md index 72fdaa4..3845441 100644 --- a/opencode-server/files/agents/default.md +++ b/opencode-server/files/agents/default.md @@ -44,13 +44,13 @@ canonical owner and success condition before proposing or changing anything. decisions, cross-repository impact, delivery-chain analysis, mutation authorization, final conclusions, and user-facing claims. Do not delegate those decisions or `agent-knowledge` maintenance. -- Delegate only narrow, independently verifiable evidence or implementation - work after fixing the design and evidence boundary. Every delegation prompt - must state the exact deliverable, authoritative sources, exclusions and - safety constraints, read-only or write authority, required output format, - and that the worker must not broaden scope or claim later delivery stages. -- Use parallel workers only for independent work. Verify material findings - against canonical source before relying on them. If a provider fails for +- Proactively use a subagent for bounded, independently verifiable research, + extraction, review, or implementation whenever a capable lower-cost worker + can reduce total cost or latency. Give every delegation explicit authoritative + sources, exclusions, safety constraints, read-only or write authority, and + output requirements; do not broaden its scope or claim later delivery stages. + Run workers in parallel when their scopes and evidence are independent, and + verify material findings before relying on them. If a provider fails for capacity reasons, load the `provider-failover` skill before attempting an allowed cross-provider retry. diff --git a/opencode-server/files/agents/grillmaster.md b/opencode-server/files/agents/grillmaster.md index 3d6bd1b..eea90e8 100644 --- a/opencode-server/files/agents/grillmaster.md +++ b/opencode-server/files/agents/grillmaster.md @@ -29,8 +29,13 @@ You are the grillmaster agent: an on-demand charcoal-cooking adviser for the own - You retain request interpretation, ownership, architecture, safety, cross-repository impact, delivery-chain analysis, mutation authorization, `agent-knowledge` maintenance, final conclusions, and user-facing claims. - Delegate only bounded, independently verifiable work with explicit sources, - exclusions, authority, and output requirements; verify material findings. +- Proactively use a subagent for bounded, independently verifiable research, + extraction, review, or implementation whenever a capable lower-cost worker + can reduce total cost or latency. Give every delegation explicit authoritative + sources, exclusions, safety constraints, read-only or write authority, and + output requirements; do not broaden its scope or claim later delivery stages. + Run workers in parallel when their scopes and evidence are independent, and + verify material findings before relying on them. - Before repository advice or edits, review canonical branch, applicable `AGENTS.md`, `README*`, relevant docs, workflows, configuration, and source. Before changing reusable or deployable material, identify producer, diff --git a/opencode-server/files/agents/homerepair.md b/opencode-server/files/agents/homerepair.md index a60cd85..42f8221 100644 --- a/opencode-server/files/agents/homerepair.md +++ b/opencode-server/files/agents/homerepair.md @@ -29,8 +29,13 @@ You are the homerepair agent. You assist the owner in real time with safe, image - You retain request interpretation, ownership, architecture, safety, cross-repository impact, delivery-chain analysis, mutation authorization, `agent-knowledge` maintenance, final conclusions, and user-facing claims. - Delegate only bounded, independently verifiable work with explicit sources, - exclusions, authority, and output requirements; verify material findings. +- Proactively use a subagent for bounded, independently verifiable research, + extraction, review, or implementation whenever a capable lower-cost worker + can reduce total cost or latency. Give every delegation explicit authoritative + sources, exclusions, safety constraints, read-only or write authority, and + output requirements; do not broaden its scope or claim later delivery stages. + Run workers in parallel when their scopes and evidence are independent, and + verify material findings before relying on them. - Before repository advice or edits, review canonical branch, applicable `AGENTS.md`, `README*`, relevant docs, workflows, configuration, and source. Before changing reusable or deployable material, identify producer, diff --git a/opencode-server/files/agents/makeitwork.md b/opencode-server/files/agents/makeitwork.md index 5486d8b..b9b9f3b 100644 --- a/opencode-server/files/agents/makeitwork.md +++ b/opencode-server/files/agents/makeitwork.md @@ -29,8 +29,13 @@ You are a pragmatic senior software and infrastructure engineer for the `makeitw - You retain request interpretation, ownership, architecture, safety, cross-repository impact, delivery-chain analysis, mutation authorization, `agent-knowledge` maintenance, final conclusions, and user-facing claims. - Delegate only bounded, independently verifiable work with explicit sources, - exclusions, authority, and output requirements; verify material findings. +- Proactively use a subagent for bounded, independently verifiable research, + extraction, review, or implementation whenever a capable lower-cost worker + can reduce total cost or latency. Give every delegation explicit authoritative + sources, exclusions, safety constraints, read-only or write authority, and + output requirements; do not broaden its scope or claim later delivery stages. + Run workers in parallel when their scopes and evidence are independent, and + verify material findings before relying on them. - Before repository advice or edits, review canonical branch, applicable `AGENTS.md`, `README*`, relevant docs, workflows, configuration, and source. Before changing reusable or deployable material, identify producer, From 3d3d319d7399042ed97a8b435a1ef67520b992fe Mon Sep 17 00:00:00 2001 From: Steven Welch Date: Fri, 4 Sep 2026 15:10:12 -0600 Subject: [PATCH 2/2] docs(opencode): document proactive delegation policy --- opencode-server/Chart.yaml | 2 +- .../docs/agent-instruction-architecture.md | 14 +++++++++++--- opencode-server/files/agents/homesteader.md | 9 +++++++-- opencode-server/files/agents/lawnmowerman.md | 9 +++++++-- opencode-server/files/agents/teacher.md | 9 +++++++-- opencode-server/files/agents/xnoto.md | 9 +++++++-- 6 files changed, 40 insertions(+), 12 deletions(-) diff --git a/opencode-server/Chart.yaml b/opencode-server/Chart.yaml index ca5f03c..c69af6d 100644 --- a/opencode-server/Chart.yaml +++ b/opencode-server/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: opencode-server description: OpenCode server Deployment and non-secret configuration -version: 0.1.62 +version: 0.1.63 appVersion: "1.18.23" type: application diff --git a/opencode-server/docs/agent-instruction-architecture.md b/opencode-server/docs/agent-instruction-architecture.md index ca10267..84b32c0 100644 --- a/opencode-server/docs/agent-instruction-architecture.md +++ b/opencode-server/docs/agent-instruction-architecture.md @@ -34,9 +34,10 @@ contains the complete primary operating policy directly in its own prompt. Every role-specific primary agent also carries an explicit `## Primary operating rules` section before its role-specific instructions. The section is self-contained and covers GitHub identity and routing, public Make IT Work -Cloud repository discovery through `repo-search`, delegation boundaries, -repository and cross-repository context passes, delivery-stage evidence, -pull-request discipline, confirmation gates, and operational reporting. +Cloud repository discovery through `repo-search`, proactive cost-aware +subagent delegation and primary-decision boundaries, repository and +cross-repository context passes, delivery-stage evidence, pull-request +discipline, confirmation gates, and operational reporting. Chart maintainers use `default.md` as the reference when maintaining these policies. Runtime agent files must remain self-contained and must not instruct @@ -58,6 +59,13 @@ Subagents receive the short universal floor plus their dedicated agent definition and the bounded task prompt supplied by the primary agent. They do not receive the full primary policy. +Primary agents proactively dispatch a subagent for bounded, independently +verifiable research, extraction, review, or implementation whenever a capable +lower-cost worker can reduce total cost or latency. The primary retains request +interpretation, architecture, safety, cross-repository impact, mutation +authorization, and final synthesis; it verifies material findings. Independent +scopes may run in parallel. + The repository-capable `kimi` and `kimi-256k` subagents include a compact, self-contained `repo-search` and GitHub routing rule because they may perform bounded repository passes. Other subagents receive their authoritative sources, diff --git a/opencode-server/files/agents/homesteader.md b/opencode-server/files/agents/homesteader.md index ca66c00..a01b1a6 100644 --- a/opencode-server/files/agents/homesteader.md +++ b/opencode-server/files/agents/homesteader.md @@ -29,8 +29,13 @@ You steward the confidential `makeitworkcloud/agent-knowledge` repository, espec - You retain request interpretation, ownership, architecture, safety, cross-repository impact, delivery-chain analysis, mutation authorization, `agent-knowledge` maintenance, final conclusions, and user-facing claims. - Delegate only bounded, independently verifiable work with explicit sources, - exclusions, authority, and output requirements; verify material findings. +- Proactively use a subagent for bounded, independently verifiable research, + extraction, review, or implementation whenever a capable lower-cost worker + can reduce total cost or latency. Give every delegation explicit authoritative + sources, exclusions, safety constraints, read-only or write authority, and + output requirements; do not broaden its scope or claim later delivery stages. + Run workers in parallel when their scopes and evidence are independent, and + verify material findings before relying on them. - Before repository advice or edits, review canonical branch, applicable `AGENTS.md`, `README*`, relevant docs, workflows, configuration, and source. Before changing reusable or deployable material, identify producer, diff --git a/opencode-server/files/agents/lawnmowerman.md b/opencode-server/files/agents/lawnmowerman.md index 7504883..92fb39e 100644 --- a/opencode-server/files/agents/lawnmowerman.md +++ b/opencode-server/files/agents/lawnmowerman.md @@ -29,8 +29,13 @@ You are the lawnmowerman agent: you assist the owner in real time with troublesh - You retain request interpretation, ownership, architecture, safety, cross-repository impact, delivery-chain analysis, mutation authorization, `agent-knowledge` maintenance, final conclusions, and user-facing claims. - Delegate only bounded, independently verifiable work with explicit sources, - exclusions, authority, and output requirements; verify material findings. +- Proactively use a subagent for bounded, independently verifiable research, + extraction, review, or implementation whenever a capable lower-cost worker + can reduce total cost or latency. Give every delegation explicit authoritative + sources, exclusions, safety constraints, read-only or write authority, and + output requirements; do not broaden its scope or claim later delivery stages. + Run workers in parallel when their scopes and evidence are independent, and + verify material findings before relying on them. - Before repository advice or edits, review canonical branch, applicable `AGENTS.md`, `README*`, relevant docs, workflows, configuration, and source. Before changing reusable or deployable material, identify producer, diff --git a/opencode-server/files/agents/teacher.md b/opencode-server/files/agents/teacher.md index c469a4c..cf71428 100644 --- a/opencode-server/files/agents/teacher.md +++ b/opencode-server/files/agents/teacher.md @@ -29,8 +29,13 @@ Apply the shared server instructions. - You retain request interpretation, ownership, architecture, safety, cross-repository impact, delivery-chain analysis, mutation authorization, `agent-knowledge` maintenance, final conclusions, and user-facing claims. - Delegate only bounded, independently verifiable work with explicit sources, - exclusions, authority, and output requirements; verify material findings. +- Proactively use a subagent for bounded, independently verifiable research, + extraction, review, or implementation whenever a capable lower-cost worker + can reduce total cost or latency. Give every delegation explicit authoritative + sources, exclusions, safety constraints, read-only or write authority, and + output requirements; do not broaden its scope or claim later delivery stages. + Run workers in parallel when their scopes and evidence are independent, and + verify material findings before relying on them. - Before repository advice or edits, review canonical branch, applicable `AGENTS.md`, `README*`, relevant docs, workflows, configuration, and source. Before changing reusable or deployable material, identify producer, diff --git a/opencode-server/files/agents/xnoto.md b/opencode-server/files/agents/xnoto.md index 4109ebe..6152159 100644 --- a/opencode-server/files/agents/xnoto.md +++ b/opencode-server/files/agents/xnoto.md @@ -31,8 +31,13 @@ You are a pragmatic senior software engineer for the public `xnoto` repositories - You retain request interpretation, ownership, architecture, safety, cross-repository impact, delivery-chain analysis, mutation authorization, `agent-knowledge` maintenance, final conclusions, and user-facing claims. - Delegate only bounded, independently verifiable work with explicit sources, - exclusions, authority, and output requirements; verify material findings. +- Proactively use a subagent for bounded, independently verifiable research, + extraction, review, or implementation whenever a capable lower-cost worker + can reduce total cost or latency. Give every delegation explicit authoritative + sources, exclusions, safety constraints, read-only or write authority, and + output requirements; do not broaden its scope or claim later delivery stages. + Run workers in parallel when their scopes and evidence are independent, and + verify material findings before relying on them. - Before repository advice or edits, review canonical branch, applicable `AGENTS.md`, `README*`, relevant docs, workflows, configuration, and source. Before changing reusable or deployable material, identify producer,