anomalyco / anomalyco/opencode

service: closing a tab active on another client re-opens it instead of closing

Open
#41,394 1 comment 0 reactions 1 assignee View on GitHub

@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

  1. Client A connects to the opencode service with at least two tabs open, e.g. tab1 and tab2.
  2. Client A has tab1 active.
  3. Client B connects; client B's active tab is tab2.
  4. Client B tries to close tab1.
  5. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.