feat(agents): add build agent prompt extension and configuration override support

- Add BUILD_AGENT_PROMPT_EXTENSION for orchestrator-focused main agent behavior
- Introduce OverridableAgentName type to allow build agent customization
- Update config schema to support build agent override in oh-my-opencode.json
- Inject orchestration prompt into build agent's system prompt

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2025-12-13 22:13:23 +09:00
parent f3b2fccba7
commit b24b00fad2
6 changed files with 116 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
import type { Plugin } from "@opencode-ai/plugin";
import { createBuiltinAgents } from "./agents";
import { createBuiltinAgents, BUILD_AGENT_PROMPT_EXTENSION } from "./agents";
import {
createTodoContinuationEnforcer,
createContextWindowMonitorHook,
@@ -258,6 +258,16 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
...projectAgents,
...config.agent,
};
if (config.agent.build) {
const existingPrompt = config.agent.build.prompt || "";
const userOverride = pluginConfig.agents?.build?.prompt || "";
config.agent.build = {
...config.agent.build,
prompt: existingPrompt + BUILD_AGENT_PROMPT_EXTENSION + userOverride,
};
}
config.tools = {
...config.tools,
};