From 7e4b633bbd73ab9d26c8630dbc342e1c027781a5 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sun, 14 Dec 2025 21:59:17 +0900 Subject: [PATCH] feat(agents): add OmO and OmO-Plan as primary agents, demote build/plan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- README.ko.md | 27 ++++++++++++++++++++++--- README.md | 27 ++++++++++++++++++++++--- src/config/schema.ts | 4 ++++ src/hooks/keyword-detector/constants.ts | 2 +- src/index.ts | 25 +++++++++++++++-------- 5 files changed, 70 insertions(+), 15 deletions(-) diff --git a/README.ko.md b/README.ko.md index db86b9f..f3b93ac 100644 --- a/README.ko.md +++ b/README.ko.md @@ -561,9 +561,14 @@ Google Gemini ๋ชจ๋ธ์„ ์œ„ํ•œ ๋‚ด์žฅ Antigravity OAuth๋ฅผ ํ™œ์„ฑํ™”ํ•ฉ๋‹ˆ๋‹ค: ### OmO Agent -OmO๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ํ™œ์„ฑํ™”๋˜๋ฉฐ, ๊ธฐ๋ณธ primary ์—์ด์ „ํŠธ๊ฐ€ ๋ฉ๋‹ˆ๋‹ค. ๋‚ด์žฅ "build" ์—์ด์ „ํŠธ๋ฅผ ๋Œ€์ฒดํ•˜๋ฉด์„œ `builtIn` ํ”Œ๋ž˜๊ทธ๋ฅผ ์œ ์ง€ํ•˜์—ฌ, OmO๊ฐ€ ์—์ด์ „ํŠธ ๋ชฉ๋ก์—์„œ ์ฒซ ๋ฒˆ์งธ๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. +ํ™œ์„ฑํ™” ์‹œ(๊ธฐ๋ณธ๊ฐ’), OmO๋Š” ๋‘ ๊ฐœ์˜ primary ์—์ด์ „ํŠธ๋ฅผ ์ถ”๊ฐ€ํ•˜๊ณ  ๋‚ด์žฅ ์—์ด์ „ํŠธ๋ฅผ subagent๋กœ ๊ฐ•๋“ฑํ•ฉ๋‹ˆ๋‹ค: -OmO๋ฅผ ๋น„ํ™œ์„ฑํ™”ํ•˜๊ณ  ์›๋ž˜ build ์—์ด์ „ํŠธ๋ฅผ ๋ณต์›ํ•˜๋ ค๋ฉด: +- **OmO**: Primary ์˜ค์ผ€์ŠคํŠธ๋ ˆ์ดํ„ฐ ์—์ด์ „ํŠธ (Claude Opus 4.5) +- **OmO-Plan**: OpenCode plan ์—์ด์ „ํŠธ์˜ ๋ชจ๋“  ์„ค์ •์„ ๋Ÿฐํƒ€์ž„์— ์ƒ์† (description์— "OhMyOpenCode version" ์ถ”๊ฐ€) +- **build**: subagent๋กœ ๊ฐ•๋“ฑ +- **plan**: subagent๋กœ ๊ฐ•๋“ฑ + +OmO๋ฅผ ๋น„ํ™œ์„ฑํ™”ํ•˜๊ณ  ์›๋ž˜ build/plan ์—์ด์ „ํŠธ๋ฅผ ๋ณต์›ํ•˜๋ ค๋ฉด: ```json { @@ -573,9 +578,25 @@ OmO๋ฅผ ๋น„ํ™œ์„ฑํ™”ํ•˜๊ณ  ์›๋ž˜ build ์—์ด์ „ํŠธ๋ฅผ ๋ณต์›ํ•˜๋ ค๋ฉด: } ``` +๋‹ค๋ฅธ ์—์ด์ „ํŠธ์ฒ˜๋Ÿผ OmO์™€ OmO-Plan๋„ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค: + +```json +{ + "agents": { + "OmO": { + "model": "anthropic/claude-sonnet-4", + "temperature": 0.3 + }, + "OmO-Plan": { + "model": "openai/gpt-5.2" + } + } +} +``` + | ์˜ต์…˜ | ๊ธฐ๋ณธ๊ฐ’ | ์„ค๋ช… | |------|--------|------| -| `disabled` | `false` | `true`๋ฉด OmO๋ฅผ ๋น„ํ™œ์„ฑํ™”ํ•˜๊ณ  ์›๋ž˜ build ์—์ด์ „ํŠธ๋ฅผ ๋ณต์›ํ•ฉ๋‹ˆ๋‹ค. `false`(๊ธฐ๋ณธ๊ฐ’)๋ฉด OmO๊ฐ€ build ์—์ด์ „ํŠธ๋ฅผ ๋Œ€์ฒดํ•˜์—ฌ ๊ธฐ๋ณธ primary ์—์ด์ „ํŠธ๊ฐ€ ๋ฉ๋‹ˆ๋‹ค. | +| `disabled` | `false` | `true`๋ฉด OmO ์—์ด์ „ํŠธ๋ฅผ ๋น„ํ™œ์„ฑํ™”ํ•˜๊ณ  ์›๋ž˜ build/plan์„ primary๋กœ ๋ณต์›ํ•ฉ๋‹ˆ๋‹ค. `false`(๊ธฐ๋ณธ๊ฐ’)๋ฉด OmO์™€ OmO-Plan์ด primary ์—์ด์ „ํŠธ๊ฐ€ ๋ฉ๋‹ˆ๋‹ค. | ### Hooks diff --git a/README.md b/README.md index 959b1d7..4bcac10 100644 --- a/README.md +++ b/README.md @@ -562,9 +562,14 @@ Available agents: `oracle`, `librarian`, `explore`, `frontend-ui-ux-engineer`, ` ### OmO Agent -OmO is enabled by default and becomes the default primary agent. It replaces the built-in "build" agent while keeping the `builtIn` flag, ensuring OmO appears first in the agent list. +When enabled (default), OmO adds two primary agents and demotes the built-in agents to subagents: -To disable OmO and restore the original build agent: +- **OmO**: Primary orchestrator agent (Claude Opus 4.5) +- **OmO-Plan**: Inherits all settings from OpenCode's plan agent at runtime (description appended with "OhMyOpenCode version") +- **build**: Demoted to subagent +- **plan**: Demoted to subagent + +To disable OmO and restore the original build/plan agents: ```json { @@ -574,9 +579,25 @@ To disable OmO and restore the original build agent: } ``` +You can also customize OmO and OmO-Plan like other agents: + +```json +{ + "agents": { + "OmO": { + "model": "anthropic/claude-sonnet-4", + "temperature": 0.3 + }, + "OmO-Plan": { + "model": "openai/gpt-5.2" + } + } +} +``` + | Option | Default | Description | |--------|---------|-------------| -| `disabled` | `false` | When `true`, disables OmO and restores the original build agent. When `false` (default), OmO replaces the build agent as the default primary agent. | +| `disabled` | `false` | When `true`, disables OmO agents and restores original build/plan as primary. When `false` (default), OmO and OmO-Plan become primary agents. | ### Hooks diff --git a/src/config/schema.ts b/src/config/schema.ts index bc839c6..5b6e512 100644 --- a/src/config/schema.ts +++ b/src/config/schema.ts @@ -28,7 +28,9 @@ export const BuiltinAgentNameSchema = z.enum([ export const OverridableAgentNameSchema = z.enum([ "build", + "plan", "OmO", + "OmO-Plan", "oracle", "librarian", "explore", @@ -78,7 +80,9 @@ export const AgentOverrideConfigSchema = z.object({ export const AgentOverridesSchema = z.object({ build: AgentOverrideConfigSchema.optional(), + plan: AgentOverrideConfigSchema.optional(), OmO: AgentOverrideConfigSchema.optional(), + "OmO-Plan": AgentOverrideConfigSchema.optional(), oracle: AgentOverrideConfigSchema.optional(), librarian: AgentOverrideConfigSchema.optional(), explore: AgentOverrideConfigSchema.optional(), diff --git a/src/hooks/keyword-detector/constants.ts b/src/hooks/keyword-detector/constants.ts index 194a8df..6ca9796 100644 --- a/src/hooks/keyword-detector/constants.ts +++ b/src/hooks/keyword-detector/constants.ts @@ -28,7 +28,7 @@ TELL THE USER WHAT AGENTS YOU WILL LEVERAGE NOW TO SATISFY USER'S REQUEST. ## WORKFLOW 1. Analyze the request and identify required capabilities 2. Spawn exploration/librarian agents via background_task in PARALLEL (10+ if needed) -3. Use planning agents to create detailed work breakdown +3. Always Use Plan agent with gathered context to create detailed work breakdown 4. Execute with continuous verification against original requirements diff --git a/src/index.ts b/src/index.ts index 751184f..be6997b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 = {