Skip to content

tui: notifications fire in every attached TUI for a single session completion #59386

Closed as duplicate

Description

@fmichaut-diff

Summary

With multiple TUI clients attached to the same opencode server, a single session completion produces one desktop notification per attached TUI. The built-in opencode.notifications plugin has no notion of which client owns the session, so every client fires its own notification.

Environment

  • opencode version: v2.1.4
  • OS: Darwin 25.6.0 (darwin arm64)
  • Terminal: iTerm.app (TERM=xterm-256color, COLORTERM=truecolor)
  • Shell: /bin/zsh
  • Install/channel: latest
  • Active plugins: none configured (only a local worktrunk.ts plugin)

Reproduction

  1. Open three opencode TUI instances in three terminal tabs, all attached to the same server.
  2. In one instance, send a prompt and let the session complete.
  3. Observe desktop notifications.

Expected Behavior

A single "Session done" notification (or one per TUI that actually owns/initiated the session).

Actual Behavior

All three TUIs fire the same "Session done" notification — three notifications for one completion.

Additional Context

The built-in opencode.notifications plugin registers a handler per TUI process:

t.data.on("session.execution.succeeded", (f) => c(f.data.sessionID))

and calls:

t.attention.notify({
  title: i ?? u?.title,
  message: r,
  notification: c ? false : { when: "blurred" },
  sound: { name: o, when: "always" }
})

Every TUI subscribes to the same shared server event stream, and the plugin does not check whether the session belongs to the current client. So each attached TUI emits its own notification. With when: "blurred", every terminal that is not focused notifies — N attached TUIs produce N notifications.

Workaround: launch secondary TUIs with OPENCODE_CLI_CONFIG_CONTENT='{"plugins":["-opencode.notifications"]}' to disable the plugin in those instances.

Frequency: consistently reproducible.

Activity

  1. opencode-agent commented on Oct 26, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report and the workaround! I think this is a duplicate of #51014, which reports the same thing: several TUIs attached to one server each send their own notification for the same session event.

    Possible duplicates and related issues, most likely first:

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. rekram1-node commented on Oct 28, 2026

    @rekram1-node
    Collaborator

    Closing as a duplicate of the issue linked above. If this turns out to be a different problem, comment here and we'll reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions