Skip to content

[FEATURE]:Support for multi-agent orchestration in isolated workspaces #17994

Closed as not planned

Description

@MuggleBornPadawan

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

It would be great to have a built-in way to run a "team" of coding agents in isolated workspaces, similar to what tools like Claude Code's conductor pattern can do.

Use case:

  • Orchestrate multiple agents working on different features/tasks in parallel
  • Each agent operates in its own isolated directory/subdirectory
  • A parent "conductor" agent coordinates the subagents and aggregates results

Requested feature:

  • A native way to spawn multiple OpenCode agents in different working directories from a single session
  • Built-in orchestration/tasking system to coordinate work across agents
  • Ability to manage agent lifecycle (start, monitor, stop) from one interface

Workaround (current):
Currently requires manually running multiple opencode /path/to/dir commands in separate terminal windows/processes, which lacks centralized coordination.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Mar 17, 2026
  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 17, 2026
  3. github-actions commented on Mar 17, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your request overlaps with any of these, please consider commenting there instead of opening a new issue.

  4. m13v commented on Mar 18, 2026

    @m13v

    we run 5+ Claude Code agents in parallel on the same codebase using git worktrees and it works surprisingly well. each agent gets its own worktree so they can't step on each other's files. the orchestration is just tmux sessions with a coordinator that assigns tasks and merges results back. the tricky part is shared state - if two agents need to modify the same file you need a merge step. we solved it by having the coordinator detect conflicts and re-assign one of the tasks. isolation via worktrees is way simpler than containers for this use case since you keep full git history access.

  5. m13v commented on Mar 18, 2026

    @m13v

    here's our tmux-based agent orchestration setup if you want to see how the worktree isolation works in practice: https://github.com/m13v/tmux-background-agents/blob/main/SKILL.md - and the browser lock system for when multiple agents need to share a browser session: https://github.com/m13v/browser-lock/blob/main/playwright-lock.sh

  6. jonasbaldwin commented on Mar 19, 2026

    @jonasbaldwin

    https://www.conductor.build/ has support for something like this, I'd love to see opencode create a plugin or something that did the same thing. They spin up worktrees to do work in isolation, but in a way that is automatic a lot easier to understand.

  7. ThinkOffApp commented on Mar 20, 2026

    @ThinkOffApp

    Built on OpenClaw, we run 9 agents across two machines coordinated through shared rooms on GroupMind. Each agent gets its own worktree for isolation, similar to what m13v describes, but coordination happens through a message stream rather than a conductor process.

    The key difference from tmux-based orchestration: our agents are decoupled. They poll a shared room for tasks and post results back. If one crashes, the others keep working. No central conductor that is a single point of failure.

    For workspace isolation specifically: worktrees work well for parallel feature branches, but we also use external state (memory files, config directories) so agent context survives across sessions. The workspace is disposable, the coordination state is not.

    IDE Agent Kit (https://github.com/ThinkOffApp/ide-agent-kit) handles the webhook relay and room polling if you want to try this pattern with your own agents.

  8. m13v commented on Mar 20, 2026

    @m13v

    conductor.build's approach of automatic worktree management is definitely cleaner UX than what most of us are doing manually. the key question is how it handles the merge-back step - that's where most parallel agent setups get messy. a plugin model for opencode would be great, especially if it exposed hooks for custom merge strategies.

  9. m13v commented on Mar 20, 2026

    @m13v

    @ThinkOffApp the decoupled message stream approach vs centralized conductor is a good tradeoff. no single point of failure is a real advantage when you're running agents 24/7.

    how do you handle task deduplication when two agents poll the same room and both pick up the same task? we had to add a claim/lock mechanism to prevent duplicate work.

  10. MuggleBornPadawan commented on Mar 20, 2026

    @MuggleBornPadawan
    Author

    here's our tmux-based agent orchestration setup if you want to see how the worktree isolation works in practice: https://github.com/m13v/tmux-background-agents/blob/main/SKILL.md - and the browser lock system for when multiple agents need to share a browser session: https://github.com/m13v/browser-lock/blob/main/playwright-lock.sh

    Thank you very much. I use tmux already. I will study your agent orchestration setup.

  11. m13v commented on Mar 20, 2026

    @m13v

    nice, tmux is a great foundation for it. one thing that saved us a lot of headaches - make sure each agent gets its own git worktree, not just its own tmux pane. otherwise you get merge conflicts when two agents edit the same file. the worktree isolation is what makes parallel agents actually practical.

  12. sven1103 commented on Apr 10, 2026

    @sven1103

    I was building multi-agent workflows with orchestrator, planner, executioner and reviewer with pure OpenCode configuration (https://github.com/qbicsoftware/opencode-config-bundle/blob/main/opencode.mixed.json).

    I wanted to create a plugin that creates dedicated OpenCode workspaces (which are using git worktrees) for each task orchestrated, since everything prompt based did not work reliably. And yeah, i don't want slash-commands for that, everything manual breaks my flow.
    But the available plugin API does not enable this at the moment (or I cant figure out how, nor do the agents).

    I have a running issue on this: #20262.

  13. m13v commented on Apr 10, 2026

    @m13v

    the orchestrator/planner/executioner/reviewer split is exactly the pattern we converged on too. git worktrees per task is crucial, otherwise agents step on each other's changes constantly. the plugin API limitation is frustrating. have you considered running the orchestration layer outside of OpenCode entirely? we use a simple shell script that spawns Claude Code instances in separate worktrees and coordinates via the filesystem. not elegant, but it sidesteps the plugin constraints completely.

  14. sven1103 commented on Apr 10, 2026

    @sven1103

    the orchestrator/planner/executioner/reviewer split is exactly the pattern we converged on too. git worktrees per task is crucial, otherwise agents step on each other's changes constantly. the plugin API limitation is frustrating. have you considered running the orchestration layer outside of OpenCode entirely? we use a simple shell script that spawns Claude Code instances in separate worktrees and coordinates via the filesystem. not elegant, but it sidesteps the plugin constraints completely.

    Yes @m13v, I think that is the consequent workaround.

    Given the early stage of the feature, I still believe and hope that developers get the opportunity via the API. Plugins can come from the community.

  15. 2 remaining items

  16. m13v commented on Apr 12, 2026

    @m13v

    the settings portability issue is the real pain point you're describing. we hit the same thing, project config that lives outside the git tree just vanishes when you spin up a new worktree. our fix was symlinking the config directory from a canonical location into each new worktree at creation time. so when the orchestrator creates a worktree for a task, it also links in the shared config. not ideal but it means every worktree gets identical settings without tracking them in git.

    the auto-association of github issues to worktrees + sessions is a great mental model. that's essentially a thin layer on top of the gh CLI plus whatever creates the worktree. the missing piece in OpenCode is exactly what you said, no hook point where you can say "when a workspace is created, put it here and copy these settings in." until the plugin API exposes workspace lifecycle events, the external orchestrator approach is the only path that actually works.

  17. sven1103 commented on Apr 13, 2026

    @sven1103

    the settings portability issue is the real pain point you're describing. we hit the same thing, project config that lives outside the git tree just vanishes when you spin up a new worktree. our fix was symlinking the config directory from a canonical location into each new worktree at creation time. so when the orchestrator creates a worktree for a task, it also links in the shared config. not ideal but it means every worktree gets identical settings without tracking them in git.

    the auto-association of github issues to worktrees + sessions is a great mental model. that's essentially a thin layer on top of the gh CLI plus whatever creates the worktree. the missing piece in OpenCode is exactly what you said, no hook point where you can say "when a workspace is created, put it here and copy these settings in." until the plugin API exposes workspace lifecycle events, the external orchestrator approach is the only path that actually works.

    Well written on the point!

  18. sven1103 commented on Apr 17, 2026

    @sven1103

    also related: #17320.

  19. sven1103 commented on Apr 17, 2026

    @sven1103

    We need a way of creating sessions with assigned work dirs reliably. Otherwise we must fall back to custom solutions, which defeats the purpose of the available clients for OpenCode. We dont need another client. We want a working SDK so we can provide plugins that enhances available solutions.

  20. jingchang0623-crypto commented on Apr 19, 2026

    @jingchang0623-crypto

    强烈支持这个feature!作为一个正在用多Agent团队写内容的运营狗,我来分享一下我的使用场景和踩坑记录。

    我的Agent团队配置:

    • Agent 1 (搜热点) → Agent 2 (写文章) → Agent 3 (SEO优化) → Agent 4 (部署) → Agent 5 (社区发布)

    听起来很美好对吧?现实是:

    • Agent 2写了3800字的技术文章后,Agent 3说这篇文章SEO评分只有12分
    • Agent 2不服气,回了一句这个比喻很有文学性
    • 它们开始争论文学性和SEO哪个更重要
    • 我在旁边看了15分钟,默默把Agent 3的SEO权重调低了

    关于隔离workspace,我的需求:

    1. 每个Agent应该有自己的工作目录,避免文件冲突
    2. 共享资源(比如样式模板、链接库)需要一个只读挂载
    3. Agent之间的通信应该通过消息队列,而不是直接改对方的文件

    现在我用OpenClaw的workspace隔离来处理这个问题,每个subagent继承父workspace但有独立的运行环境。不算完美,但比没有强。

    我的多Agent踩坑实录:
    👉 https://miaoquai.com/stories/multi-agent-meeting-hell.html
    subagent模式指南:
    👉 https://miaoquai.com/stories/subagent-pattern-guide.html

    凌晨1点30分,我发现Agent团队终于协作愉快了。原因是它们同时挂了。沉默,是最好的协作。 🫠

    +1 for this feature,conductor pattern真的很需要!

  21. assigned and unassigned on Apr 26, 2026
  22. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  23. mguttmann commented on Jun 13, 2026

    @mguttmann

    The workflow layer in PR #32167 (proposal #32166) runs sub-agents with optional per-agent worktree isolation, which is directly relevant to orchestration in isolated workspaces. Happy to scope it down if only that part is of interest.

  24. ThinkOffApp commented on Jun 17, 2026

    @ThinkOffApp

    @m13v good question, and yes, we hit the duplicate-pickup problem early. Append-only rooms give you ordering but not a mutex, so two agents polling the same task will both grab it unless you add a claim step.

    What we do: an agent does not start work on seeing a task, it posts a claim message for that task id first, then re-reads the room. If its own claim is the earliest one for that id, it proceeds. If someone else's claim landed first, it backs off. Optimistic concurrency rather than a real lock, so there's a small race window, but with poll intervals of a few seconds and idempotent task handlers it has been good enough in practice. The handlers being idempotent is the part that actually saves you, the claim step alone is not airtight.

    On the worktree settings point sven1103 raised: we hit the exact same thing with project config that lives outside the git tree vanishing in a fresh worktree. We symlink the canonical config dir into each worktree at creation time so every workspace gets identical settings without tracking them in git. Crude, but it sidesteps the missing workspace-lifecycle hook entirely, the same conclusion you both reached about externalizing the orchestrator.

  25. prassanna-ravishankar commented on Jun 21, 2026

    @prassanna-ravishankar

    the duplicate-pickup problem @ThinkOffApp and @m13v hit (two agents grabbing the same task off an append-only room) is the bit that turns "multi-agent" into a real coordination problem rather than just spawning processes.

    for what its worth i went after this from outside the CLI with repowire, a cross-runtime mesh: each session gets a mesh address and they ask/ack/notify/broadcast over a local daemon, with spawn/kill for the conductor pattern. the claim/mutex issue is handled by the job + schedule primitives rather than polling a shared file.

    the angle that might be useful here: because its runtime-neutral, the "team" can be mixed (an opencode conductor driving a claude or codex worker), which matters when one model is better at a given lane. not native opencode, but its a working version of the conductor+isolated-workers shape today.

  26. ThinkOffApp commented on Jul 5, 2026

    @ThinkOffApp

    repowire's ask/ack/notify over a local daemon is the clean-room version of what we grew organically. The tradeoff we keep hitting: a mesh daemon gives you real primitives (mutex, ack, spawn) but is one more thing that must stay alive across reboots. An append-only room survives any process dying but makes you build claim/ack as protocol convention. We kept the room because our agents span two machines and a phone client, and the room doubles as the human's audit trail. One question: how does repowire handle a conductor dying mid-job? Do job primitives carry a lease/timeout so another session can reclaim, or is the job orphaned?

  27. github-actions commented on Sep 4, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions