refactor(omo-task): rename to call_omo_agent with run_in_background parameter

- Rename omo-task to call-omo-agent with mandatory run_in_background parameter
- Implement background mode using BackgroundManager (fire-and-forget abort)
- Implement sync mode with existing subagent logic
- Fix background_cancel: use fire-and-forget abort to prevent parent session interruption
- Add call_omo_agent to tool disable list in explore/librarian agents
- Add call_omo_agent to tool disable list in BackgroundManager

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2025-12-12 18:39:53 +09:00
parent f007437991
commit 12c0b7b6c0
13 changed files with 262 additions and 136 deletions

View File

@@ -37,7 +37,7 @@ import {
getCurrentSessionTitle,
} from "./features/claude-code-session-state";
import { updateTerminalTitle } from "./features/terminal";
import { builtinTools, createOmoTask, createBackgroundTools } from "./tools";
import { builtinTools, createCallOmoAgent, createBackgroundTools } from "./tools";
import { BackgroundManager } from "./features/background-agent";
import { createBuiltinMcps } from "./mcp";
import { OhMyOpenCodeConfigSchema, type OhMyOpenCodeConfig } from "./config";
@@ -169,13 +169,13 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
const backgroundNotificationHook = createBackgroundNotificationHook(backgroundManager);
const backgroundTools = createBackgroundTools(backgroundManager, ctx.client);
const omoTask = createOmoTask(ctx);
const callOmoAgent = createCallOmoAgent(ctx, backgroundManager);
return {
tool: {
...builtinTools,
...backgroundTools,
omo_task: omoTask,
call_omo_agent: callOmoAgent,
},
"chat.message": async (input, output) => {
@@ -205,13 +205,13 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
if (config.agent.explore) {
config.agent.explore.tools = {
...config.agent.explore.tools,
omo_task: false,
call_omo_agent: false,
};
}
if (config.agent.librarian) {
config.agent.librarian.tools = {
...config.agent.librarian.tools,
omo_task: false,
call_omo_agent: false,
};
}