Only one opencode CLI instance available #9023

Open
opened 2026-02-16 18:11:25 -05:00 by yindo · 2 comments
Owner

Originally created by @caibingcheng on GitHub (Feb 10, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Start two opencode CLI will failed.

Plugins

omoc,auth

OpenCode version

1.1.56

Steps to reproduce

  1. start a terminal session
  2. start a opencode cli at that session
  3. start another terminal session
  4. start another opencode cli at that session

Screenshot and/or share link

The second instance can not start normally. Just wait here.

Image

Operating System

Ubuntu 20.04

Terminal

gnome terminal

Originally created by @caibingcheng on GitHub (Feb 10, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description Start two opencode CLI will failed. ### Plugins omoc,auth ### OpenCode version 1.1.56 ### Steps to reproduce 1. start a terminal session 2. start a opencode cli at that session 3. start another terminal session 4. start another opencode cli at that session ### Screenshot and/or share link The second instance can not start normally. Just wait here. <img width="370" height="50" alt="Image" src="https://github.com/user-attachments/assets/77aa17f2-9837-4248-9751-86295db0c0b9" /> ### Operating System Ubuntu 20.04 ### Terminal gnome terminal
yindo added the bug label 2026-02-16 18:11:25 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 10, 2026):

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

  • #7629: Desktop app and terminal should connect to existing server instead of starting a new one when port is already in use
  • #10357: Use incremental port assignment instead of random OS-assigned ports (proposed solution)
  • #7085: OpenCode Desktop starts multiple windows when launched once from a script (related instance management issue)

These issues describe the same core problem of multiple OpenCode instances conflicting with each other and propose various solutions. Please review them to see if your use case is already addressed.

@github-actions[bot] commented on GitHub (Feb 10, 2026): This issue might be a duplicate of existing issues. Please check: - #7629: Desktop app and terminal should connect to existing server instead of starting a new one when port is already in use - #10357: Use incremental port assignment instead of random OS-assigned ports (proposed solution) - #7085: OpenCode Desktop starts multiple windows when launched once from a script (related instance management issue) These issues describe the same core problem of multiple OpenCode instances conflicting with each other and propose various solutions. Please review them to see if your use case is already addressed.
Author
Owner

@tanaka-mambinge commented on GitHub (Feb 12, 2026):

Also facing a similar issue. I guess starting one server and attaching terminals is the way to go for now.

Start headless server: opencode serve --hostname 0.0.0.0 --port 4096
Attach tui: opencode attach http://localhost:4096 --dir /path/to/project. Important to specify the dir so that you can access/continue sessions from that folder

@tanaka-mambinge commented on GitHub (Feb 12, 2026): Also facing a similar issue. I guess [starting one server](https://opencode.ai/docs/cli/#serve) and [attaching terminals](https://opencode.ai/docs/cli/#attach) is the way to go for now. Start headless server: `opencode serve --hostname 0.0.0.0 --port 4096` Attach tui: `opencode attach http://localhost:4096 --dir /path/to/project`. Important to specify the dir so that you can access/continue sessions from that folder
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9023