Skip to content

[Bug]: Agent TUI redraws can block remote runtime RPCs #14331

Closed

Description

@blueagler

Operating system

Linux

Orca version

1.4.180

Details

Short summary:

Agent TUI redraws can make the remote runtime stop answering RPCs while TCP remains healthy.

What happened?

A Linux remote runtime repeatedly appeared offline and reconnected. During an affected session:

  • ping and TCP connections to the runtime succeeded continuously
  • orca status timed out repeatedly
  • Electron's main process used one full core
  • a CPU profile attributed 86.8% of samples to retained terminal-row finalization

The observed redraw row contained about 4,001 internal spaces followed by status text. The finalizer used /[ \t]+$/g to remove trailing whitespace. When internal whitespace is followed by text, this end-anchored regex repeatedly rescans the run before rejecting it.

How can we reproduce it?

  1. Run an agent TUI that redraws a status line about 36 times per second.
  2. Emit a retained partial row containing about 4,000 spaces followed by text.
  3. Process each redraw through retained terminal-tail finalization.
  4. Observe Electron main-process CPU and runtime RPC latency.

Additional evidence:

  • observed row arrays contained only four or nine rows, ruling out tail-array size as the cause
  • replacing the regex with the existing backward scanner changed a follow-up profile to 99.1% idle
  • status calls recovered from repeated approximately 73-second timeouts to 0.23–0.34 seconds in the affected session
  • output behavior remained unchanged

Activity

  1. added theissue type on Sep 19, 2026
  2. OrcaWin commented on Oct 9, 2026

    @OrcaWin
    Collaborator

    Fixed by #19214, which removed the quadratic whitespace trimming that let heavy TUI redraws stall the main process. #26483 also keeps the terminal tail linear under redraw floods. If you still see this on a current build, please reopen with details and we'll take another look.

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

    bugSomething isn't workingos:linuxIssues affecting Linux

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions