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)
This commit is contained in:
@@ -561,19 +561,21 @@ Google Gemini 모델을 위한 내장 Antigravity OAuth를 활성화합니다:
|
|||||||
|
|
||||||
### OmO Agent
|
### OmO Agent
|
||||||
|
|
||||||
기본 OmO 에이전트 동작을 설정합니다:
|
OmO는 기본적으로 활성화되며, 기본 primary 에이전트가 됩니다. 내장 "build" 에이전트를 대체하면서 `builtIn` 플래그를 유지하여, OmO가 에이전트 목록에서 첫 번째로 표시됩니다.
|
||||||
|
|
||||||
|
OmO를 비활성화하고 원래 build 에이전트를 복원하려면:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"omo_agent": {
|
"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
|
### Hooks
|
||||||
|
|
||||||
|
|||||||
@@ -562,19 +562,21 @@ Available agents: `oracle`, `librarian`, `explore`, `frontend-ui-ux-engineer`, `
|
|||||||
|
|
||||||
### OmO Agent
|
### 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
|
```json
|
||||||
{
|
{
|
||||||
"omo_agent": {
|
"omo_agent": {
|
||||||
"disable_build": true
|
"disabled": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
| Option | Default | Description |
|
| 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
|
### Hooks
|
||||||
|
|
||||||
|
|||||||
@@ -366,41 +366,6 @@ export const omoAgent: AgentConfig = {
|
|||||||
budgetTokens: 32000,
|
budgetTokens: 32000,
|
||||||
},
|
},
|
||||||
maxTokens: 128000,
|
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,
|
prompt: OMO_SYSTEM_PROMPT,
|
||||||
color: "#00CED1",
|
color: "#00CED1",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ export const ClaudeCodeConfigSchema = z.object({
|
|||||||
})
|
})
|
||||||
|
|
||||||
export const OmoAgentConfigSchema = z.object({
|
export const OmoAgentConfigSchema = z.object({
|
||||||
disable_build: z.boolean().optional(),
|
disabled: z.boolean().optional(),
|
||||||
})
|
})
|
||||||
|
|
||||||
export const OhMyOpenCodeConfigSchema = z.object({
|
export const OhMyOpenCodeConfigSchema = z.object({
|
||||||
|
|||||||
21
src/index.ts
21
src/index.ts
@@ -279,15 +279,32 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
|||||||
const userAgents = (pluginConfig.claude_code?.agents ?? true) ? loadUserAgents() : {};
|
const userAgents = (pluginConfig.claude_code?.agents ?? true) ? loadUserAgents() : {};
|
||||||
const projectAgents = (pluginConfig.claude_code?.agents ?? true) ? loadProjectAgents() : {};
|
const projectAgents = (pluginConfig.claude_code?.agents ?? true) ? loadProjectAgents() : {};
|
||||||
|
|
||||||
const shouldHideBuild = pluginConfig.omo_agent?.disable_build !== false;
|
const isOmoEnabled = pluginConfig.omo_agent?.disabled !== true;
|
||||||
|
|
||||||
|
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 = {
|
config.agent = {
|
||||||
...builtinAgents,
|
...builtinAgents,
|
||||||
...userAgents,
|
...userAgents,
|
||||||
...projectAgents,
|
...projectAgents,
|
||||||
...config.agent,
|
...config.agent,
|
||||||
...(shouldHideBuild ? { build: { mode: "subagent" } } : {}),
|
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
config.tools = {
|
config.tools = {
|
||||||
...config.tools,
|
...config.tools,
|
||||||
|
|||||||
Reference in New Issue
Block a user