feat(cli): show RAM usage in sidebar - #7371
Closed
alex-alecu wants to merge 3 commits into
Closed
Conversation
Add a lightweight /memory route to the server that returns process.memoryUsage.rss() (Bun's fast-path). Regenerate the SDK so sdk.client.memory.status() is available as a typed method.
Add memory field to the sync store, fetch it during bootstrap, and poll every 10 seconds. Uses in-process fetch so overhead is negligible. Cleans up the interval via onCleanup.
Conditionally render a Memory section between Context and MCP showing total RAM, active MCP server count, plugin count, message count, and an actionable tip (/compact or /new). Reuses existing connectedMcpCount and messages memos.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (6 files)
Reviewed by gpt-5.4-20260305 · 1,388,107 tokens |
alex-alecu
marked this pull request as draft
March 25, 2026 13:01
Contributor
Author
|
Fixed here #7617 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
When the CLI process uses a lot of memory, users have no way to know about it or what to do. They only find out when their system slows down or the process gets killed.
What changed
The TUI sidebar now shows a "Memory" section when the process uses more than 2 GB of RAM. It displays total memory in a warning color alongside what's currently active — connected MCP servers, plugins, and messages in the session — so users can understand what's contributing. It also suggests running
/compactor/newto free memory. The server exposes a lightweight memory endpoint, and the TUI polls it every 10 seconds with negligible overhead since it runs in-process.How to test
bun run devand open a sessionsidebar.tsxfrom2 * 1024 * 1024 * 1024to something small like1/compact or /newtip