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
tui: tab state not keyed by server — dead tabs across --server connections #62063
The TUI's persisted tab state (~/.local/state/opencode/latest/tui/tabs.json) is keyed by working directory only, not by the connected server. Two TUI clients running from the same directory against different servers (local background service vs. a remote server via --server) write their session ids into the same key, so each TUI's tab strip lists the other server's sessions. Clicking such a tab fails with "session not found" because the id does not exist on the connected server.
Active plugins: ./plugins/opencode-secrets, ./plugins/rtk, ./plugins/sound-notify, @tarquinen/opencode-dcp@latest
Reproduction
From directory D, launch the local TUI (opencode) — it connects to the shared background service. Open or create a session; it appears in the tab strip.
Make a second opencode server reachable (e.g. opencode serve --port 49380 on another host, forwarded with ssh -L 49380:127.0.0.1:49380 <host>).
From the SAME directory D, launch a second TUI against that server: opencode --server http://127.0.0.1:49380 -s <session-id-on-that-server>.
Both TUIs now list each other's session ids as tabs in their tab strips.
Click the foreign tab in either TUI → error: "session not found".
Expected Behavior
Tab state should be scoped per connected server (include the server identity in the tabs.json key), and a tab whose session id does not exist on the connected server should be dropped from the strip rather than erroring when clicked.
Actual Behavior
The tabs.json cwd key accumulates session ids from whichever TUI last wrote it, regardless of server; foreign ids render as tabs that error "session not found" on click. Reproduces consistently.
The tabs.scope setting (cwd|global) only changes the grouping key; neither value is scoped by server.
Workaround: launch each TUI against a different server from a distinct working directory so the cwd keys never collide and the tab strips stay isolated.
Thanks for the clear report and reproduction! I think this is a duplicate of #47998, which reports that saved TUI tabs in tui/tabs.json are shared between the local server and --server connections because nothing in the key records which server a tab belongs to. That issue has been reproduced, and its comments confirm the cwd scope case and the same workaround you found (a different launch directory per server). The current dev code still saves tabs without any server identity.
Possible duplicates and related issues, ordered from most to least likely:
Please follow #47998 for updates. Your note about also dropping tabs whose session doesn't exist on the connected server would be useful there. The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.
Closing this as a duplicate of #47998, since there hasn't been a reply in the past day. In both, the TUI saves tabs in tui/tabs.json without recording which server each tab belongs to. So a local TUI and a --server TUI in the same directory list each other's sessions, and clicking one of those tabs gives "session not found". Please follow #47998 for updates. Your suggestion to drop tabs whose session doesn't exist on the connected server would be a useful addition there. If your problem turns out to be different, reply here and we can reopen.
Activity
opencodejr commentedon Nov 5, 2026
Thanks for the clear report and reproduction! I think this is a duplicate of #47998, which reports that saved TUI tabs in
tui/tabs.jsonare shared between the local server and--serverconnections because nothing in the key records which server a tab belongs to. That issue has been reproduced, and its comments confirm thecwdscope case and the same workaround you found (a different launch directory per server). The currentdevcode still saves tabs without any server identity.Possible duplicates and related issues, ordered from most to least likely:
--servertargets, causingSessionNotFound(closed as a duplicate of tui: saved tabs are shared between local and remote servers #47998)Please follow #47998 for updates. Your note about also dropping tabs whose session doesn't exist on the connected server would be useful there. The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.
opencodejr commentedon Nov 6, 2026
Closing this as a duplicate of #47998, since there hasn't been a reply in the past day. In both, the TUI saves tabs in
tui/tabs.jsonwithout recording which server each tab belongs to. So a local TUI and a--serverTUI in the same directory list each other's sessions, and clicking one of those tabs gives "session not found". Please follow #47998 for updates. Your suggestion to drop tabs whose session doesn't exist on the connected server would be a useful addition there. If your problem turns out to be different, reply here and we can reopen.