Skip to content

[bug] cross-session bleeding in brain TUI status #143

Description

@four-bytes-robby

Problem

The brain plugin TUI receives status updates from the shared brain/status bus channel without filtering by session ID. When multiple opencode sessions run in parallel (e.g. via separate terminal tabs/instances), each TUI sees status updates from ALL server instances — not just its own.

Root Cause

In src/status.ts, the write() function publishes payloads to the bus channel without including the session ID. The TUI subscriber in src/tui.tsx processes every message it sees, regardless of which session/server produced it.

The per-session channel brain/${sessionId} was added as a fix (commit 5a0625c) for pre-session ingest, but brain/status is still subscribed unfiltered.

Fix

  1. src/status.ts — include sessionId in the published payload (when known)
  2. src/tui.tsx — filter brain/status subscription by sessionId when both sides have it

Acceptance

  • Two concurrent opencode sessions show independent status (no bleed)
  • Single session still works (no regression)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions