You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Idea: use Turso/ZeroMQ/WebSockets for shared event bus, synchronize multiple opencode TUIs and servers #2783
Currently opencode uses an in memory event notification system, this means that you cannot have 2 opencode sessions open at the same time or use opencode serve and opencode tui at the same time.
This is a problem for kimaki: if you try to write messages in Discord and also the tui the opencode chat will hang, probably because it is in a broken state, because state is not synchronized between the 2 processes
If instead opencode uses ZeroMQ for the process notification bus
Multiple processes could publish and subscribe to same session (you can use both tui and serve at the same time
changed the title [-]Idea: use ZeroMQ for shared event bus for `client.event.subscribe`[/-][+]Idea: use ZeroMQ for shared event bus for `/event`[/+]on Sep 25, 2025
changed the title [-]Idea: use ZeroMQ for shared event bus for `/event`[/-][+]Idea: use ZeroMQ for shared event bus, synchronize multiple opencode TUIs and servers[/+]on Sep 25, 2025
changed the title [-]Idea: use ZeroMQ for shared event bus, synchronize multiple opencode TUIs and servers[/-][+]Idea: use ZeroMQ or WebSockets for shared event bus, synchronize multiple opencode TUIs and servers[/+]on Sep 26, 2025
Some of this isn't documented, or the docs are wip:
I don't know the port the server is listening to
That is either the default port 4096, or the port you nominated with opencode serve --port 1234 --hostname 127.0.0.1
Note that opencode starts a server with default port and hostname, and connects the TUI client to that.
Also doesn't work if i have an already open tui and want to start a server for the same project.
As above, when you started the TUI, it started a server (with defaults) for you.
Test:
opencode &
# Step 3: Wait briefly for server to start (adjust sleep if needed)
sleep 5
# Step 4: Check if port 4096 is listening (using ss; install net-tools if using netstat)
ss -tuln | grep 4096 # If output shows LISTEN on :::4096 or 0.0.0.0:4096, it's running
# Alternative: Use curl to verify the API docs endpoint (should return HTML if server is up)
curl -f http://127.0.0.1:4096/doc || echo "Server not responding"
# Step 5: Clean up (stop the server and any processes)
pkill -f opencode
i want to use /sessions command instead
Maybe that can be a separate issue, given this one concerns "multiple opencode TUIs and servers)"?
Still encountering this - opening multiple TUI instances for the same directory doesn't sync the session list. Would love to see this addressed. Happy to help test any solutions.
changed the title [-]Idea: use ZeroMQ or WebSockets for shared event bus, synchronize multiple opencode TUIs and servers[/-][+]Idea: use Turso/ZeroMQ/WebSockets for shared event bus, synchronize multiple opencode TUIs and servers[/+]on Jan 24, 2026
Activity
[-]Idea: use ZeroMQ for shared event bus for `client.event.subscribe`[/-][+]Idea: use ZeroMQ for shared event bus for `/event`[/+]github-actions commentedon Sep 25, 2025
This issue might be a duplicate of existing issues. Please check:
opencode serveInstance #878: Feature request for connecting TUI to existingopencode serveinstances (closed but directly related to multi-session support)Feel free to ignore if none of these address your specific case.
[-]Idea: use ZeroMQ for shared event bus for `/event`[/-][+]Idea: use ZeroMQ for shared event bus, synchronize multiple opencode TUIs and servers[/+][-]Idea: use ZeroMQ for shared event bus, synchronize multiple opencode TUIs and servers[/-][+]Idea: use ZeroMQ or WebSockets for shared event bus, synchronize multiple opencode TUIs and servers[/+]taqtiqa-mark commentedon Sep 28, 2025
@remorses I believe that the new
opencode attach <prot://host:port>resolves this?#2635 (comment) see 40c206c
remorses commentedon Sep 29, 2025
it's not a great DX. I don't know the port the server is listening to, i want to use /sessions command instead
Also doesn't work if i have an already open tui and want to start a server for the same project
This behavior needs to be baked in
taqtiqa-mark commentedon Sep 29, 2025
Some of this isn't documented, or the docs are wip:
That is either the default port
4096, or the port you nominated withopencode serve --port 1234 --hostname 127.0.0.1Note that
opencodestarts a server with default port and hostname, and connects the TUI client to that.As above, when you started the TUI, it started a server (with defaults) for you.
Test:
Maybe that can be a separate issue, given this one concerns "multiple opencode TUIs and servers)"?
athal7 commentedon Jan 2, 2026
Still encountering this - opening multiple TUI instances for the same directory doesn't sync the session list. Would love to see this addressed. Happy to help test any solutions.
[-]Idea: use ZeroMQ or WebSockets for shared event bus, synchronize multiple opencode TUIs and servers[/-][+]Idea: use Turso/ZeroMQ/WebSockets for shared event bus, synchronize multiple opencode TUIs and servers[/+]github-actions commentedon Mar 27, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.