Skip to content

feat: migrate brain to bus system — real-time push with HTTP fallback - #130

Merged
four-bytes-robby merged 7 commits into
mainfrom
feat/bus-migration
Jun 14, 2026
Merged

four-bytes-robby merged 7 commits into
mainfrom
feat/bus-migration

Conversation

@four-bytes-robby

@four-bytes-robby four-bytes-robby commented Jun 13, 2026

Copy link
Copy Markdown
Member

Summary

  • Migrate brain plugin to use plugin bus for real-time status push (WebSocket) with HTTP fallback
  • Update @four-bytes/opencode-plugin-lib dependency from v0.3.0 → v0.4.0 (adds BusClient/BusTui)
  • status.ts: publish status via BusClient.publish() on every write
  • tui.tsx: subscribe to bus via BusTui.connect() for real-time push, HTTP polling as fallback

Changes

  • src/status.ts — Import and use BusClient for real-time bus push on status updates
  • src/tui.tsx — Import and use BusTui for WebSocket subscription alongside HTTP fallback polling
  • package.json — Bump plugin-lib to v0.4.0 for bus classes
  • bun.lock — Updated lockfile

Summary by cubic

Migrate the brain plugin to the plugin bus for real-time WebSocket updates with HTTP fallback. Adds session-scoped channels, ingest progress, and safe reconnect/unmount handling; stops polling once the socket connects and uses @four-bytes/opencode-plugin-lib v0.5.0.

  • New Features

    • Publish status to brain/{sessionID} via BusClient (fallback to brain/status when no session).
    • Wire session IDs end-to-end: set on chat.message via setSessionId; pass session_id to the sidebar TUI.
    • TUI subscribes via BusTui; keeps HTTP polling as fallback; shows ingest progress with ProgressBar.
  • Bug Fixes

Written for commit 21c8b33. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 4 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread src/tui.tsx
Comment thread src/tui.tsx
Comment thread src/status.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread src/tui.tsx Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread package.json Outdated
Comment thread src/tui.tsx Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread src/tui.tsx
@four-bytes-robby
four-bytes-robby merged commit 01f96d2 into main Jun 14, 2026
5 checks passed
@four-bytes-robby
four-bytes-robby deleted the feat/bus-migration branch June 14, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant