Skip to content

Commit f44555a

Browse files
committed
feat(agents): make OmO default agent via build name hack
- Set build agent's display name to 'OmO' (keeps builtIn: true priority) - Add OmO as subagent (actual execution target when selected) - Remove explicit tools list from OmO agent (inherit all) - Rename omo_agent.disable_build to omo_agent.disabled This hack works around OpenCode's agent selection by key name. TODO: Use config.default_agent when PR #5313 is released. 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
1 parent cccc7b7 commit f44555a

File tree

5 files changed

+37
-51
lines changed

5 files changed

+37
-51
lines changed

README.ko.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,19 +561,21 @@ Google Gemini 모델을 위한 내장 Antigravity OAuth를 활성화합니다:
561561

562562
### OmO Agent
563563

564-
기본 OmO 에이전트 동작을 설정합니다:
564+
OmO는 기본적으로 활성화되며, 기본 primary 에이전트가 됩니다. 내장 "build" 에이전트를 대체하면서 `builtIn` 플래그를 유지하여, OmO가 에이전트 목록에서 첫 번째로 표시됩니다.
565+
566+
OmO를 비활성화하고 원래 build 에이전트를 복원하려면:
565567

566568
```json
567569
{
568570
"omo_agent": {
569-
"disable_build": true
571+
"disabled": true
570572
}
571573
}
572574
```
573575

574576
| 옵션 | 기본값 | 설명 |
575577
|------|--------|------|
576-
| `disable_build` | `true` | `true`기본 Build 에이전트를 숨깁니다. OmO가 유일한 primary 에이전트가 됩니다. `false`로 설정하면 Build 에이전트가 OmO와 함께 표시됩니다. |
578+
| `disabled` | `false` | `true`OmO를 비활성화하고 원래 build 에이전트를 복원합니다. `false`(기본값)면 OmO가 build 에이전트를 대체하여 기본 primary 에이전트가 됩니다. |
577579

578580
### Hooks
579581

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,19 +562,21 @@ Available agents: `oracle`, `librarian`, `explore`, `frontend-ui-ux-engineer`, `
562562

563563
### OmO Agent
564564

565-
Configure the default OmO agent behavior:
565+
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.
566+
567+
To disable OmO and restore the original build agent:
566568

567569
```json
568570
{
569571
"omo_agent": {
570-
"disable_build": true
572+
"disabled": true
571573
}
572574
}
573575
```
574576

575577
| Option | Default | Description |
576578
|--------|---------|-------------|
577-
| `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. |
579+
| `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. |
578580

579581
### Hooks
580582

src/agents/omo.ts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -366,41 +366,6 @@ export const omoAgent: AgentConfig = {
366366
budgetTokens: 32000,
367367
},
368368
maxTokens: 128000,
369-
tools: {
370-
read: true,
371-
write: true,
372-
edit: true,
373-
multiedit: true,
374-
patch: true,
375-
glob: true,
376-
grep: true,
377-
list: true,
378-
bash: true,
379-
batch: true,
380-
webfetch: true,
381-
websearch: true,
382-
codesearch: true,
383-
todowrite: true,
384-
todoread: true,
385-
task: true,
386-
lsp_hover: true,
387-
lsp_goto_definition: true,
388-
lsp_find_references: true,
389-
lsp_document_symbols: true,
390-
lsp_workspace_symbols: true,
391-
lsp_diagnostics: true,
392-
lsp_rename: true,
393-
lsp_prepare_rename: true,
394-
lsp_code_actions: true,
395-
lsp_code_action_resolve: true,
396-
lsp_servers: true,
397-
ast_grep_search: true,
398-
ast_grep_replace: true,
399-
skill: true,
400-
call_omo_agent: true,
401-
background_task: true,
402-
background_output: true,
403-
},
404369
prompt: OMO_SYSTEM_PROMPT,
405370
color: "#00CED1",
406371
}

src/config/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const ClaudeCodeConfigSchema = z.object({
9696
})
9797

9898
export const OmoAgentConfigSchema = z.object({
99-
disable_build: z.boolean().optional(),
99+
disabled: z.boolean().optional(),
100100
})
101101

102102
export const OhMyOpenCodeConfigSchema = z.object({

src/index.ts

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -279,15 +279,32 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
279279
const userAgents = (pluginConfig.claude_code?.agents ?? true) ? loadUserAgents() : {};
280280
const projectAgents = (pluginConfig.claude_code?.agents ?? true) ? loadProjectAgents() : {};
281281

282-
const shouldHideBuild = pluginConfig.omo_agent?.disable_build !== false;
283-
284-
config.agent = {
285-
...builtinAgents,
286-
...userAgents,
287-
...projectAgents,
288-
...config.agent,
289-
...(shouldHideBuild ? { build: { mode: "subagent" } } : {}),
290-
};
282+
const isOmoEnabled = pluginConfig.omo_agent?.disabled !== true;
283+
284+
if (isOmoEnabled && builtinAgents.OmO) {
285+
// TODO: When OpenCode releases `default_agent` config option (PR #5313),
286+
// remove this hack and use `config.default_agent = "OmO"` instead.
287+
// This hack works by:
288+
// 1. Setting build agent's display name to "OmO" (builtIn: true, appears first in TUI)
289+
// 2. Adding OmO as a subagent (actual execution target when "OmO" is selected)
290+
// Tracking: https://github.com/sst/opencode/pull/5313
291+
const { OmO: omoConfig, ...restAgents } = builtinAgents;
292+
config.agent = {
293+
...restAgents,
294+
...userAgents,
295+
...projectAgents,
296+
...config.agent,
297+
build: { ...omoConfig, name: "OmO" },
298+
OmO: { ...omoConfig, mode: "subagent" },
299+
};
300+
} else {
301+
config.agent = {
302+
...builtinAgents,
303+
...userAgents,
304+
...projectAgents,
305+
...config.agent,
306+
};
307+
}
291308

292309
config.tools = {
293310
...config.tools,

0 commit comments

Comments
 (0)