-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Open
Description
Problem
Currently, sub-agent delegation in opencode appears to be synchronous or modal. When a primary agent delegates a task to a sub-agent, the interface typically switches context to that sub-agent, blocking the primary flow or requiring manual navigation. There is no native "fire-and-forget" mechanism where a sub-agent runs fully in the background while the main agent continues to be interactive, accepting new commands or performing other work simultaneously.
Proposed Solution
Implement a true asynchronous delegation flow:
- Delegation: The Main Agent delegates a task (e.g., "Run the integration tests and fix any timeouts").
- Async Execution: The Sub-Agent spins up in a dedicated background session.
- Non-Blocking: The Main Agent immediately regains control/interactive state, allowing the user to continue working on other tasks.
- Completion Notification: The Main Agent receives a signal, message, or callback when the Sub-Agent completes, allowing it to surface the results or integrate the changes.
Related Issues & Community Interest
This feature aligns with high community interest in concurrency and background workflows:
- Feature Request: Agent Session Tab Bar Navigation #5826 (Agent Session Tab Bar Navigation): Requests UI to manage "concurrent agent sessions" and an orchestrator pattern, highlighting the need to monitor parallel tasks.
- Feature Request: Add Background Bash Execution (Like Claude Code’s Ctrl+b) #1970 (Background Bash Execution): Requests async execution for long-running bash tasks (similar to
Ctrl+b), which is a foundational requirement for non-blocking sub-agent work. - [FEATURE]:Multiple AI models working concurrently with settings adjustable directly in TUI #4790: Requests fully autonomous systems working with multiple agents concurrently.
- [FEATURE]: File locks / Vim-style locks for OpenCode locks #4278 (File locks): Proposes safety mechanisms (locking) specifically to handle the "multiple agents/tools in parallel" scenario.
Use Case
- Orchestration: A main "Architect" agent delegates coding tasks to "Developer" sub-agents and a "QA" sub-agent simultaneously.
- Efficiency: A user asks the agent to "fix the build" (delegated to sub-agent) and immediately asks "explain this other file" (main agent) without waiting for the build fix to finish.
EDIT: Ofc, AI generated issue, but I did do a search of the docs and similar issues before
KoushikSahu, iamgbayer, Steffen025, betaboon, bllyanos and 8 more
Metadata
Metadata
Assignees
Labels
No labels