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

@@ -0,0 +1,23 @@
export const ALLOWED_AGENTS = ["explore", "librarian"] as const
export const CALL_OMO_AGENT_DESCRIPTION = `Launch a new agent to handle complex, multi-step tasks autonomously.
This is a restricted version of the Task tool that only allows spawning explore and librarian agents.
Available agent types:
{agents}
When using this tool, you must specify a subagent_type parameter to select which agent type to use.
**IMPORTANT: run_in_background parameter is REQUIRED**
- \`run_in_background=true\`: Task runs asynchronously in background. Returns immediately with task_id.
Use \`background_output\` tool with the returned task_id to check progress or retrieve results.
- \`run_in_background=false\`: Task runs synchronously. Waits for completion and returns full result.
Usage notes:
1. Launch multiple agents concurrently whenever possible, to maximize performance
2. When the agent is done, it will return a single message back to you
3. Each agent invocation is stateless unless you provide a session_id
4. Your prompt should contain a highly detailed task description for the agent to perform autonomously
5. Clearly tell the agent whether you expect it to write code or just to do research
6. For long-running research tasks, use run_in_background=true to avoid blocking`