anomalyco / anomalyco/opencode
service: closing a tab active on another client re-opens it instead of closing
@jlongster is already working on this.
Since Aug 9, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.