diff --git a/README.ko.md b/README.ko.md index b652182..db86b9f 100644 --- a/README.ko.md +++ b/README.ko.md @@ -561,19 +561,21 @@ Google Gemini 모델을 위한 내장 Antigravity OAuth를 활성화합니다: ### OmO Agent -기본 OmO 에이전트 동작을 설정합니다: +OmO는 기본적으로 활성화되며, 기본 primary 에이전트가 됩니다. 내장 "build" 에이전트를 대체하면서 `builtIn` 플래그를 유지하여, OmO가 에이전트 목록에서 첫 번째로 표시됩니다. + +OmO를 비활성화하고 원래 build 에이전트를 복원하려면: ```json { "omo_agent": { - "disable_build": true + "disabled": true } } ``` | 옵션 | 기본값 | 설명 | |------|--------|------| -| `disable_build` | `true` | `true`면 기본 Build 에이전트를 숨깁니다. OmO가 유일한 primary 에이전트가 됩니다. `false`로 설정하면 Build 에이전트가 OmO와 함께 표시됩니다. | +| `disabled` | `false` | `true`면 OmO를 비활성화하고 원래 build 에이전트를 복원합니다. `false`(기본값)면 OmO가 build 에이전트를 대체하여 기본 primary 에이전트가 됩니다. | ### Hooks diff --git a/README.md b/README.md index bd8cabf..959b1d7 100644 --- a/README.md +++ b/README.md @@ -562,19 +562,21 @@ Available agents: `oracle`, `librarian`, `explore`, `frontend-ui-ux-engineer`, ` ### OmO Agent -Configure the default OmO agent behavior: +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. + +To disable OmO and restore the original build agent: ```json { "omo_agent": { - "disable_build": true + "disabled": true } } ``` | Option | Default | Description | |--------|---------|-------------| -| `disable_build` | `true` | When `true`, hides the default Build agent. OmO becomes the only primary agent. Set to `false` to show Build agent alongside OmO. | +| `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. | ### Hooks diff --git a/src/agents/omo.ts b/src/agents/omo.ts index 4094294..932488a 100644 --- a/src/agents/omo.ts +++ b/src/agents/omo.ts @@ -366,41 +366,6 @@ export const omoAgent: AgentConfig = { budgetTokens: 32000, }, maxTokens: 128000, - tools: { - read: true, - write: true, - edit: true, - multiedit: true, - patch: true, - glob: true, - grep: true, - list: true, - bash: true, - batch: true, - webfetch: true, - websearch: true, - codesearch: true, - todowrite: true, - todoread: true, - task: true, - lsp_hover: true, - lsp_goto_definition: true, - lsp_find_references: true, - lsp_document_symbols: true, - lsp_workspace_symbols: true, - lsp_diagnostics: true, - lsp_rename: true, - lsp_prepare_rename: true, - lsp_code_actions: true, - lsp_code_action_resolve: true, - lsp_servers: true, - ast_grep_search: true, - ast_grep_replace: true, - skill: true, - call_omo_agent: true, - background_task: true, - background_output: true, - }, prompt: OMO_SYSTEM_PROMPT, color: "#00CED1", } diff --git a/src/config/schema.ts b/src/config/schema.ts index 1beea29..bc839c6 100644 --- a/src/config/schema.ts +++ b/src/config/schema.ts @@ -96,7 +96,7 @@ export const ClaudeCodeConfigSchema = z.object({ }) export const OmoAgentConfigSchema = z.object({ - disable_build: z.boolean().optional(), + disabled: z.boolean().optional(), }) export const OhMyOpenCodeConfigSchema = z.object({ diff --git a/src/index.ts b/src/index.ts index 12279f0..751184f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -279,15 +279,32 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { const userAgents = (pluginConfig.claude_code?.agents ?? true) ? loadUserAgents() : {}; const projectAgents = (pluginConfig.claude_code?.agents ?? true) ? loadProjectAgents() : {}; - const shouldHideBuild = pluginConfig.omo_agent?.disable_build !== false; + const isOmoEnabled = pluginConfig.omo_agent?.disabled !== true; - config.agent = { - ...builtinAgents, - ...userAgents, - ...projectAgents, - ...config.agent, - ...(shouldHideBuild ? { build: { mode: "subagent" } } : {}), - }; + 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) + // Tracking: https://github.com/sst/opencode/pull/5313 + const { OmO: omoConfig, ...restAgents } = builtinAgents; + config.agent = { + ...restAgents, + ...userAgents, + ...projectAgents, + ...config.agent, + build: { ...omoConfig, name: "OmO" }, + OmO: { ...omoConfig, mode: "subagent" }, + }; + } else { + config.agent = { + ...builtinAgents, + ...userAgents, + ...projectAgents, + ...config.agent, + }; + } config.tools = { ...config.tools,