Conversation
The system info background worker was firing `nori-skillsets --version` and `nori-skillsets list-active` every 5 seconds per session via a `recv_timeout` loop that fell through to refresh on timeouts, producing a sustained ~0.4 subprocess spawns/sec per idle `nori` session. With multiple concurrent sessions this added up to hundreds of percent of CPU for footer display alone. Switch the worker to blocking `recv()` so refreshes only happen on explicit `request_system_info_refresh()` calls (startup, user submit, task complete, effective cwd change, skillset install/switch). Cache `nori-skillsets --version` in a process-wide `OnceLock` since the installed CLI version is stable for the lifetime of a TUI process; this halves the per-refresh cost by skipping the version subprocess. Tradeoff: an external `nori-skillsets switch` run in another terminal while the TUI is idle will not update the footer until the next event. 🤖 Generated with [Nori](https://noriagentic.com) Co-Authored-By: Nori <contact@tilework.tech>
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.
Summary
spawn_system_info_workerincodex-rs/tui/src/app/mod.rswas firing a fullSystemInforefresh every 5 seconds viarecv_timeoutfall-through, which in turn spawnednori-skillsets --versionandnori-skillsets list-activeas Node.js subprocesses. With several concurrentnorisessions this produced sustained CPU load just to paint the footer (see discovery notes below). Switch to blockingrecv()so refreshes only happen on explicitrequest_system_info_refresh()calls.nori-skillsets --versionin a process-wideOnceLock(NORI_VERSION_CACHE) incodex-rs/tui/src/system_info.rs. The installed CLI version is stable for the lifetime of the TUI process, so the subprocess runs at most once per session.list-activeis still re-invoked on every refresh.codex-rs/tui/docs.md.Refreshes are still triggered on: startup, user message submit, task completion, effective cwd changes (debounced 500ms by
EffectiveCwdTracker), and skillset install/switch success.Tradeoff
An external
nori-skillsets switchrun in another terminal while the TUI is idle will not be reflected in the footer until the user does something that triggers a refresh. Discussed and accepted.Impact
nori-skillsetsspawns/sec → 0 when idle.Test plan
cargo test -p nori-tui— 1199 passed, 0 failedjust fmt+just fix -p nori-tui— cleancargo build --bin nori— successcargo test -p tui-pty-e2e— all suites passnori --agent elizacpunder tmux; TUI rendered,›prompt appeared, footer populated with active skillset and cached version string; user submit triggered a refresh that updated the footer. No panics.