Skip to content

[bug] Throttle too slow + ProgressBar wraps sidebar to second line #139

Description

@four-bytes-robby

Problem

Two related display/perf issues in the brain plugin's TUI sidebar:

1. Throttle too aggressive (2s)

In src/four-opencode-brain.ts, the progress callback throttles status updates to once every 2 seconds. For small/medium ingests this means the progress bar barely moves — the user sees mostly stale frames. The ingest itself is fast enough to warrant sub-second updates.

Lines:

  • L127: auto-ingest progressCallback — < 2000
  • L257: brain_ingest tool progressCallback — < 2000

Both should drop to 500 so the user sees smoother progress.

2. ProgressBar wraps onto a new line in sidebar

In src/tui.tsx, the inline <ProgressBar> inside the status row causes the row to break into two lines (ProgressBar on line 2, status text on line 1).

Root cause: @four-bytes/opencode-plugin-lib/tui-components ProgressBar hardcodes <box flexDirection="row" width="100%" ...> on its outer container. When placed inline next to text, that 100% width forces the row to wrap.

Fix

Fix 1 (brain): Change 2000500 in both throttle checks.

Fix 2 (plugin-lib + brain):

  • In opencode-plugin-lib: add a width?: string prop to ProgressBar (default "100%" for backward compat).
  • In tui.tsx: pass width="auto" at the two ProgressBar call sites so it shrinks to content + label.

Branch

fix/throttle-layout

Related

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