Summary
With two TUI clients connected to the same opencode service, a client cannot
close a tab that the other client has active: the tab closes and immediately
re-opens.
Environment
- opencode version: v0.0.0-next-17041
- OS: Darwin 25.5.0 (darwin arm64)
- Terminal: TERM_PROGRAM=ghostty, TERM=xterm-ghostty, COLORTERM=truecolor
- Shell: /bin/zsh
- Install/channel: next
- Active plugins: ~/.config/opencode/plugins/cliproxy.ts
Reproduction
- Client A connects to the opencode service with at least two tabs open, e.g. tab1 and tab2.
- Client A has tab1 active.
- Client B connects; client B's active tab is tab2.
- Client B tries to close tab1.
- tab1 closes and immediately re-opens (refuses to close).
Expected Behavior
A tab should close when any client requests it, even if another client has it
active. The other client should just reflect the tab as closed.
Actual Behavior
The tab closes and re-opens right away. The close is effectively refused.
Additional Context
Consistently reproducible in this two-client setup.
Likely cause: when a "close tab" signal arrives from the closing client, the
other client (which has the tab active) responds by syncing its state — since
the now-closing client no longer has the tab the other client has active, the
other client sends an "open this tab for them" signal, recreating the tab.
Frequency: consistent.
Summary
With two TUI clients connected to the same opencode service, a client cannot
close a tab that the other client has active: the tab closes and immediately
re-opens.
Environment
Reproduction
Expected Behavior
A tab should close when any client requests it, even if another client has it
active. The other client should just reflect the tab as closed.
Actual Behavior
The tab closes and re-opens right away. The close is effectively refused.
Additional Context
Consistently reproducible in this two-client setup.
Likely cause: when a "close tab" signal arrives from the closing client, the
other client (which has the tab active) responds by syncing its state — since
the now-closing client no longer has the tab the other client has active, the
other client sends an "open this tab for them" signal, recreating the tab.
Frequency: consistent.