feat(agents): enhance orchestration prompt and inject to all non-subagent agents

- Add mandatory parallel tool calls section
- Add mandatory 7-section subagent prompt structure guide
- Inject BUILD_AGENT_PROMPT_EXTENSION to all non-subagent agents (not just 'build')
- Fixes issue where custom primary agents don't receive orchestration guidance

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2025-12-13 23:14:25 +09:00
parent 44ce343708
commit 27403f2682
2 changed files with 68 additions and 8 deletions

View File

@@ -259,13 +259,17 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
...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,
};
// Inject orchestration prompt to all non-subagent agents
// Subagents are delegated TO, so they don't need orchestration guidance
for (const [agentName, agentConfig] of Object.entries(config.agent ?? {})) {
if (agentConfig && agentConfig.mode !== "subagent") {
const existingPrompt = agentConfig.prompt || "";
const userOverride = pluginConfig.agents?.[agentName as keyof typeof pluginConfig.agents]?.prompt || "";
config.agent[agentName] = {
...agentConfig,
prompt: existingPrompt + BUILD_AGENT_PROMPT_EXTENSION + userOverride,
};
}
}
config.tools = {