Skip to content

TUI freezes during operations: event loop and rendering bottlenecks #499

@bug-ops

Description

@bug-ops

Problem

The TUI interface sometimes freezes during operations, preventing input in the text field. Root cause analysis identified two categories of issues:

  1. Event loop starvation -- the tui_loop processes one event per iteration then draws a full frame. During fast streaming or parallel tool execution, agent events flood the queue while keyboard events are starved.

  2. Expensive synchronous rendering -- tree-sitter syntax highlighting and markdown parsing run on every frame for all visible messages, adding latency proportional to content size.

Sub-issues

Analysis

Full analysis: .local/plan/tui-freeze-analysis.md

Acceptance Criteria

  • Keyboard input remains responsive during fast LLM streaming
  • Keyboard input remains responsive during parallel tool execution
  • Frame time stays under 16ms for typical chat content

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingepicMilestone-level tracking issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions