Skip to content

fix: restore file I/O + TUI status fixes + v1.6.0 #102 - #104

Merged
four-bytes-robby merged 1 commit into
mainfrom
fix/102-init-emit-dup-slot
Jun 8, 2026
Merged

four-bytes-robby merged 1 commit into
mainfrom
fix/102-init-emit-dup-slot

Conversation

@four-bytes-robby

@four-bytes-robby four-bytes-robby commented Jun 8, 2026 •

Copy link
Copy Markdown
Member

Closes #102

Root Cause

opencode runs server plugins in a Bun Worker thread and TUI in the main thread — separate JS contexts. ESM singletons are NOT shared. File I/O is the only reliable cross-context channel.

Changes

  • Restore file I/O: getBrainStatusFile() in shared.ts, file write in status.ts write(), file polling in tui.tsx alongside event bus subscription
  • TUI idle fix: setStatus(data.statusText || 'ready') instead of hardcoded 'ready'
  • Status bar text: 16 updateStatus() calls now include text: (status bar) alongside toast: (notification)
  • Version: 1.6.0 (minor bump for event bus)
  • ROADMAP: A2.1 note explains Worker architecture constraint
  • Duplicate slot: removed home_footer, keep home_bottom only
  • BrainStatusBar export: exposed for custom slot registration

Summary by cubic

Restores reliable cross-context status updates by bringing back file-based I/O as a fallback alongside the event bus, fixing missing/incorrect TUI status text. Bumps @four-bytes/four-opencode-brain to v1.6.0.

  • Bug Fixes

    • Re-added status file fallback: server writes status, TUI polls every 200ms via getBrainStatusFile(), while keeping the event bus as fast-path.
    • TUI now uses statusText for init and idle states (no more hardcoded "ready").
    • Standardized all updateStatus() calls to include both text (status bar) and toast (notification).
  • Refactors

    • Exported BrainStatusBar for custom slot registration; removed duplicate home_footer slot (kept home_bottom).
    • Added Worker-architecture note to ROADMAP and initialized status with versioned payload and safe file writes.
    • Version bump to 1.6.0.

Written for commit 14552f9. Summary will update on new commits.

Review in cubic



- Restore getBrainStatusFile + file write in status.ts (opencode Worker architecture)
- TUI polls file every 200ms alongside event bus (fast-path)
- TUI idle handler uses data.statusText instead of hardcoded 'ready'
- 16 updateStatus calls now include text: alongside toast:
- Version bumped to 1.6.0 (minor, event bus functionality)
- ROADMAP A2.1 updated with architecture note
@four-bytes-robby four-bytes-robby self-assigned this Jun 8, 2026
@four-bytes-robby
four-bytes-robby merged commit 4af0e5a into main Jun 8, 2026
4 checks passed
@four-bytes-robby
four-bytes-robby deleted the fix/102-init-emit-dup-slot branch June 8, 2026 12:30
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.

Fix: missing initial status emit + duplicate home slot

1 participant