openclaw - 💡(How to fix) Fix TUI process consumes 89-99% CPU at idle and during message turns (busy-loop) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#75137Fetched 2026-05-01 05:37:47
View on GitHub
Comments
1
Participants
2
Timeline
11
Reactions
2
Author
Timeline (top)
cross-referenced ×4mentioned ×3subscribed ×3commented ×1

openclaw-tui (the local TUI client started via openclaw chat / openclaw tui --local) sits at 89-99 % CPU for as long as the window is open — both while idle waiting for user input and while a backend turn is in flight. RSS climbs to ~550 MB, VSZ ~2 GB. End-user perceives the chat as "very laggy" even when the underlying claude-cli backend turns complete in normal time.

Root Cause

  • Heavy fan / battery drain on the host (Hetzner CAX21 ARM, but also reported by users on local machines)
  • Terminal redraws perceived as laggy because the render loop is starving on its own busy-poll
  • Ambient claude-cli backend turn duration (median 12 s in our log) feels like 30-60 s to the user because the TUI is unresponsive

Fix Action

Workaround

Avoid chat / tui --local for sessions that should stay open; either:

  • use openclaw agent --local --message "..." for one-shot turns, or
  • route via Telegram / other channel handlers

Code Example

🦞 OpenClaw 2026.4.26 (be8c246)

---

$ ps -o pid,pcpu,pmem,vsz,rss,etime,comm -p 390376
    PID %CPU %MEM    VSZ   RSS     ELAPSED COMMAND
 390376 89.8  6.9 2055712 550168     04:40 openclaw-tui
RAW_BUFFERClick to expand / collapse

TUI process consumes 89-99% CPU at idle and during message turns (busy-loop)

Summary

openclaw-tui (the local TUI client started via openclaw chat / openclaw tui --local) sits at 89-99 % CPU for as long as the window is open — both while idle waiting for user input and while a backend turn is in flight. RSS climbs to ~550 MB, VSZ ~2 GB. End-user perceives the chat as "very laggy" even when the underlying claude-cli backend turns complete in normal time.

Version

🦞 OpenClaw 2026.4.26 (be8c246)
  • node v24.14.1
  • Linux (Hetzner CAX21, ARM64, Debian)

Reproduction

  1. openclaw --profile <profile> chat (alias for tui --local)
  2. Wait at the empty prompt (no input typed).
  3. top -p $(pgrep openclaw-tui) → ~90-99 % CPU.
$ ps -o pid,pcpu,pmem,vsz,rss,etime,comm -p 390376
    PID %CPU %MEM    VSZ   RSS     ELAPSED COMMAND
 390376 89.8  6.9 2055712 550168     04:40 openclaw-tui

CPU stays high regardless of:

  • whether a turn is in flight or fully idle
  • terminal emulator (Tabby on Windows, plain SSH PTY both reproduce)
  • profile in use (dixi, default main, others)

Expected

TUI should be event-driven on stdin / WS messages and use ~0 % CPU at idle.

Observed impact

  • Heavy fan / battery drain on the host (Hetzner CAX21 ARM, but also reported by users on local machines)
  • Terminal redraws perceived as laggy because the render loop is starving on its own busy-poll
  • Ambient claude-cli backend turn duration (median 12 s in our log) feels like 30-60 s to the user because the TUI is unresponsive

Suspected cause

A render / poll loop in the TUI that does not block on a select / event-source. Likely candidates: a setImmediate-style redraw, a polling read on stdin, or a tight loop reading from the agent stream.

Happy to gather more diagnostics (strace, perf top, V8 CPU profile via --inspect) if useful.

Workaround

Avoid chat / tui --local for sessions that should stay open; either:

  • use openclaw agent --local --message "..." for one-shot turns, or
  • route via Telegram / other channel handlers

extent analysis

TL;DR

The high CPU usage in openclaw-tui can be addressed by identifying and optimizing the suspected busy-loop in the render or poll loop that doesn't block on a select or event-source.

Guidance

  • Investigate the use of setImmediate for redraws and consider replacing it with a more efficient scheduling method to reduce CPU usage.
  • Check for any polling reads on stdin and optimize or replace them with event-driven approaches to minimize unnecessary CPU cycles.
  • Review the agent stream reading loop to ensure it's not causing the high CPU usage due to a tight loop, and consider implementing a more efficient data processing mechanism.
  • Utilize diagnostic tools like strace, perf top, or V8 CPU profiles via --inspect to gather more insights into the CPU usage patterns and pinpoint the exact cause.

Example

No specific code snippet can be provided without more context, but an example of optimizing a polling loop might involve replacing a busy-wait with an event-driven approach using callbacks or promises.

Notes

The provided information suggests a performance issue rather than a functional bug, and addressing the suspected busy-loop should alleviate the high CPU usage and associated symptoms like lag and battery drain.

Recommendation

Apply a workaround by avoiding chat / tui --local for long-lived sessions and instead use openclaw agent --local --message "..." for one-shot turns or route via other channel handlers until the underlying issue is resolved.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix TUI process consumes 89-99% CPU at idle and during message turns (busy-loop) [1 comments, 2 participants]