[PR #6402] fix(tui): enable threaded rendering to prevent UI freezing #11882

Closed
opened 2026-02-16 18:16:49 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6402

State: closed
Merged: No


Summary

  • Enable useThread: true option in @opentui render config
  • Moves native FFI rendering calls to a separate thread
  • Prevents 6+ second event loop blocks during normal typing

Root Cause

Bun FFI calls are synchronous and block the JS event loop. The @opentui native library was making rendering calls that blocked for ~6.5 seconds every ~5 seconds.

Test plan

  • Run opencode TUI and type normally - no freezing
  • Verified with perf diagnostics showing zero [BLOCKED] messages

🤖 Generated with Claude Code

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6402 **State:** closed **Merged:** No --- ## Summary - Enable `useThread: true` option in @opentui render config - Moves native FFI rendering calls to a separate thread - Prevents 6+ second event loop blocks during normal typing ## Root Cause Bun FFI calls are synchronous and block the JS event loop. The @opentui native library was making rendering calls that blocked for ~6.5 seconds every ~5 seconds. ## Test plan - [x] Run opencode TUI and type normally - no freezing - [x] Verified with perf diagnostics showing zero `[BLOCKED]` messages 🤖 Generated with [Claude Code](https://claude.com/claude-code)
yindo added the pull-request label 2026-02-16 18:16:49 -05:00
yindo closed this issue 2026-02-16 18:16:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11882