Skip to content

feat: simplify event model + extract EventBus + fix CI #113 - #114

Merged
four-bytes-robby merged 1 commit into
mainfrom
feat/113-clean-event-model
Jun 8, 2026
Merged

four-bytes-robby merged 1 commit into
mainfrom
feat/113-clean-event-model

Conversation

@four-bytes-robby

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

Copy link
Copy Markdown
Member

Closes #113

Simplified Event Model

status?: "init" | "busy" | "ready" | "error"
statusText?: string
current?: number
total?: number
version?: string
error?: string

Changes

  • event-bus.ts: EventBus extracted to @four-bytes/opencode-plugin-lib v0.3.0, brain keeps only BrainStatusEvent type
  • status.ts: StatusOpts simplified (no scanning/searching/ingesting/progress), all states map to 4-status model
  • tui.tsx: handleStatus 7→4 branches, ready always shows 'ready' (toast carries result)
  • four-opencode-brain.ts: removed all flag params from updateStatus calls
  • Bugfix: toast import was missing (root cause of stuck scanning)
  • CI: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 in codeql.yml
  • v1.7.0

Summary by cubic

Simplified the event model to four statuses and moved the EventBus to @four-bytes/opencode-plugin-lib v0.3.0. This reduces TUI logic, fixes the stuck scanning bug, and ensures CodeQL uses Node 24.

  • Refactors

    • Switched to shared EventBus; BrainStatusEvent now only has status, statusText, current, total, version, error.
    • Unified status model to init/busy/ready/error; removed scanning/searching/ingesting/progress flags.
    • Simplified TUI handling to four branches; idle always shows "ready".
    • Cleaned up updateStatus calls and progress callbacks to use current/total; improved ingest/scanning toasts.
  • Bug Fixes

    • Added missing toast import that caused scanning to freeze.

Written for commit 8810a59. Summary will update on new commits.

Review in cubic

…113

- event-bus: BrainStatusEvent reduced to 6 fields (status, statusText, current, total, version, error)
- status.ts: StatusOpts simplified, removed scanning/searching/ingesting/progress flags
- tui.tsx: handleStatus simplified to 4 branches (error/init/busy/ready), ready always shows 'ready'
- four-opencode-brain.ts: removed all flag params from updateStatus calls
- toast import fixed (was missing, root cause of stuck scanning)
- EventBus extracted to @four-bytes/opencode-plugin-lib v0.3.0
- CI: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 in codeql.yml
- v1.7.0
@four-bytes-robby four-bytes-robby self-assigned this Jun 8, 2026
@four-bytes-robby
four-bytes-robby merged commit 7596665 into main Jun 8, 2026
4 checks passed
@four-bytes-robby
four-bytes-robby deleted the feat/113-clean-event-model branch June 8, 2026 15:00
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.

Simplify TUI-server communication: clean event model

1 participant