Skip to content

[bug] TUI subscribes to brain/{sessionID} but server publishes to brain/status before any session exists #134

@four-bytes-robby

Description

@four-bytes-robby

Bug

The brain TUI sidebar (src/tui.tsx) subscribes to brain/{sessionId} when a session ID is available, and brain/status otherwise. The server (src/status.ts) starts publishing on the default brain/status channel and only switches to brain/{sessionID} after a session is created (via chat.message hook).

Repro

  1. Open a project where brain has not yet indexed all files
  2. Watch the TUI sidebar during initial ingest — no status updates appear (bus subscription is on the wrong channel)
  3. HTTP fallback eventually shows the state, but real-time push is broken

Fix

TUI must always subscribe to brain/status (catches pre-session ingest), and additionally subscribe to brain/{sessionID} once a session ID is available (catches post-chat events after server switches).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions