feat(agents): add OmO and OmO-Plan as primary agents, demote build/plan

- OmO: Primary orchestrator (Claude Opus 4.5)
- OmO-Plan: Inherits ALL settings from OpenCode's plan agent at runtime
  - description appended with '(OhMyOpenCode version)'
  - Configurable via oh-my-opencode.json agents.OmO-Plan
- build/plan: Demoted to subagent when OmO enabled
- Add plan and OmO-Plan to OverridableAgentNameSchema

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2025-12-14 21:59:17 +09:00
parent f44555a021
commit 7e4b633bbd
5 changed files with 70 additions and 15 deletions

View File

@@ -283,19 +283,28 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
if (isOmoEnabled && builtinAgents.OmO) {
// TODO: When OpenCode releases `default_agent` config option (PR #5313),
// remove this hack and use `config.default_agent = "OmO"` instead.
// This hack works by:
// 1. Setting build agent's display name to "OmO" (builtIn: true, appears first in TUI)
// 2. Adding OmO as a subagent (actual execution target when "OmO" is selected)
// use `config.default_agent = "OmO"` instead of demoting build/plan.
// Tracking: https://github.com/sst/opencode/pull/5313
const { OmO: omoConfig, ...restAgents } = builtinAgents;
const { name: _planName, ...planConfigWithoutName } = config.agent?.plan ?? {};
const omoPlanOverride = pluginConfig.agents?.["OmO-Plan"];
const omoPlanBase = {
...builtinAgents.OmO,
...planConfigWithoutName,
description: `${config.agent?.plan?.description ?? "Plan agent"} (OhMyOpenCode version)`,
color: config.agent?.plan?.color ?? "#6495ED",
};
const omoPlanConfig = omoPlanOverride ? deepMerge(omoPlanBase, omoPlanOverride) : omoPlanBase;
config.agent = {
...restAgents,
OmO: builtinAgents.OmO,
"OmO-Plan": omoPlanConfig,
...Object.fromEntries(Object.entries(builtinAgents).filter(([k]) => k !== "OmO")),
...userAgents,
...projectAgents,
...config.agent,
build: { ...omoConfig, name: "OmO" },
OmO: { ...omoConfig, mode: "subagent" },
build: { ...config.agent?.build, mode: "subagent" },
plan: { ...config.agent?.plan, mode: "subagent" },
};
} else {
config.agent = {