Sessions were the answer
Key point
Dropping stateless execution in favor of attached sessions stabilized 3-agent collaboration.
Details
When building a local 3-agent coding system, the key wasn't individual execution but shared session state.
Initially, running opencode run separately for each agent meant Architect, Executor, and Reviewer couldn't share state, so the Executor would ignore the Architect's plan and re-plan its own way, and the Reviewer couldn't see the actual output to review. This also frequently resulted in empty responses.
The solution was the combination of opencode serve and opencode run --attach <url>.
- The three agents share the same session
- Conversation context accumulates across the entire workflow
- The Architect's output, the Executor's work, and the Reviewer's review connect without separate plumbing
The setup is as follows.
- OpenCode headless server: port 4096
- qwen3-coder:30b: local inference via Ollama
- Python + discord.py: bot control
- Target git repo: the workspace the agents read and write to
The author also released the full implementation, running on about 180 lines of Python, including an architecture diagram and a threat model. It's a real-world case study showing what actually works and what breaks in a local multi-agent coding flow.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.