Overview
Thetask tool provides full-featured agent delegation with category-based model selection, skill loading, and both synchronous and asynchronous execution modes. This is the primary tool for delegating work to subagents.
Source: src/tools/delegate-task/
Distinction from call_omo_agent
| Aspect | task | call_omo_agent |
|---|---|---|
| Selection | Category or subagent_type | Named agent only |
| Skill loading | load_skills[] supported | Not supported |
| Model selection | From category config | From agent’s fallback chain |
| Use case | Full delegation with skills | Quick direct agent call |
Parameters
Skill names to inject into agent contextREQUIRED - Pass
[] if no skills needed.Examples:[]- No skills["code-review"]- Single skill["mintlify", "doc-author"]- Multiple skills
Short task description (3-5 words)Example:
"Fix type errors"Full detailed prompt for the agentMust be in English. Provide clear, specific instructions.Example:
Execution mode
false: Synchronous execution, waits for completion (recommended)true: Asynchronous execution, returns task_id immediately
false for most tasks. Use true ONLY for parallel exploration with 5+ independent queries.Task category for model and prompt selectionREQUIRED if
subagent_type not provided.Built-in categories:visual-engineering- Frontend, UI/UX, design, styling, animationultrabrain- Hard logic-heavy tasks (use sparingly)deep- Goal-oriented autonomous problem-solvingartistry- Creative approaches beyond standard patternsquick- Trivial tasks, single file changesunspecified-low- Moderate effort, unclassified tasksunspecified-high- High effort, unclassified taskswriting- Documentation, prose, technical writing
category and subagent_type.Direct agent selection (explore, librarian, oracle, metis, momus)REQUIRED if
category not provided.Use for specific agent invocation without category system.Do NOT provide both category and subagent_type.Existing task session to continuePass this to resume a previous task with full context preserved.When to use:
- Task failed/incomplete → session_id with “fix: [specific issue]”
- Need follow-up on previous result → session_id with additional question
- Multi-turn conversation with same agent → always session_id instead of new task
"task-1234567890"The slash command that triggered this task (optional)Used for tracking command-triggered delegations.
Response
Task execution result or task_idSynchronous mode (Asynchronous mode (
run_in_background=false):run_in_background=true):Categories
visual-engineering
Model:google/gemini-3.1-pro (high variant)
Best for:
- Frontend development
- UI/UX implementation
- Styling and CSS
- Animations and interactions
- Design system work
ultrabrain
Model:openai/gpt-5.3-codex (xhigh variant)
Best for:
- Genuinely hard, logic-heavy tasks
- Complex architecture decisions
- Deep reasoning problems
- System design
deep
Model:openai/gpt-5.3-codex (medium variant)
Best for:
- Goal-oriented autonomous problem-solving
- Hairy problems requiring deep understanding
- Tasks requiring extensive codebase exploration
- Multi-file refactoring
artistry
Model:google/gemini-3.1-pro (high variant)
Best for:
- Highly creative tasks
- Unconventional approaches
- Novel solutions
- Artistic expression
quick
Model:anthropic/claude-haiku-4-5
Best for:
- Trivial tasks
- Single file changes
- Typo fixes
- Simple modifications
- MUST DO: List every required action
- MUST NOT DO: List forbidden actions
- EXPECTED OUTPUT: Concrete success criteria
unspecified-low
Model:anthropic/claude-sonnet-4-6
Best for:
- Moderate effort tasks
- Tasks that don’t fit other categories
- Contained scope (few files/modules)
unspecified-high
Model:anthropic/claude-opus-4-6 (max variant)
Best for:
- High effort tasks
- Broad impact changes
- Tasks that don’t fit other categories
- Multi-system coordination
writing
Model:kimi-for-coding/k2p5
Best for:
- Documentation
- READMEs
- Technical writing
- Articles and prose
Usage patterns
Basic delegation
Delegation with skills
Session continuation
Parallel background tasks
Direct agent selection
Model selection
Model resolution follows a 4-step process:- Category/Agent override - Explicit model in config
- Category default - Built-in category model
- Provider fallback - Next available model from provider
- System default - OpenCode default model
ultrabrain category:
- Check user config for
categories.ultrabrain.model - Use default
openai/gpt-5.3-codex - If unavailable, try fallback chain
- Fall back to system default
Model variants
Variants control effort level:xhigh- Maximum reasoninghigh- High effortmedium- Medium effortlow- Low effort- No variant - Default
"openai/gpt-5.3-codex medium" → model=gpt-5.3-codex, variant=medium
Skill loading
Skills are loaded from:- Project (
.opencode/skills/) - User (
~/.config/opencode/skills/) - Built-in (plugin skills)
- Detailed instructions
- Step-by-step guidance
- Embedded MCP servers
- Tool restrictions
- Best practices
Error handling
Missing category and subagent_type
Missing run_in_background
Missing load_skills
Invalid category
Skill not found
Model unavailable
If the category’s model is unavailable, the tool automatically falls back to the next available model in the fallback chain.Unstable agent handling
Some categories use models known to be unstable (e.g., free models). When detected:- Synchronous execution is forced to background mode
unstableAgentBabysitterhook monitors execution- User is notified about background execution
Custom categories
Define custom categories inoh-my-opencode.json:
Implementation details
Execution flow
Synchronous:- Resolve category/agent and model
- Load skills
- Build system prompt
- Create OpenCode session
- Send prompt
- Poll until idle
- Extract result
- Return to caller
- Resolve category/agent and model
- Load skills
- Build system prompt
- Launch via BackgroundManager
- Return task_id immediately
- Background polling continues
- User polls with background_output
Prompt building
System prompt includes:- Agent instructions
- Skill content
- Category-specific guidance
- Available categories (for nested delegation)
- Available skills (for nested delegation)
- Token limits based on model
Session continuation
Whensession_id is provided:
- Session is resumed (not created)
- New prompt is sent to existing session
- Full context is preserved
- Model and agent remain unchanged
Related tools
- call_omo_agent - Quick direct agent invocation
- skill - Load skills and commands
- background_output - Poll background results
- background_cancel - Cancel background tasks