Repository navigation
Conversation
onlynet
force-pushed
the
pr/idle-cpu-optimizations
branch
2 times, most recently
from
October 18, 2026 02:56
8cf9982 to
90b9ced
Compare
Idle terminals and waiting agent sessions no longer redraw the whole window at display refresh rate: - Spinner badges run one 80 ms timer chain with real-time phase advance (vsync-rate redraws were the largest idle-CPU item, measured in the Fleet fork); a packed latch+epoch (SpinnerChain) guarantees at most one chain and tears down in-flight chains when the badge hides. - Cursor blink stops toggling after 8 s of total silence and stays solid: a motionless terminal produces zero render frames; input restarts it immediately, PTY output restarts it only when paused. - PTY output frames coalesce to at most one frame per 8 ms (≤125 fps) with a bounded trailing frame; hiding a pane clears the merge baseline. - The 1 Hz watchdog's ps enumeration moves off the UI thread behind cached_activity_evidence (250 ms shared snapshot); stale batches are dropped by command identity. - Agent identify/detect gain a single-slot memo keyed by manifest generation; sampling cadence is untouched (the Fleet regression where caching short-circuited refresh_agent_screen_state and pinned agents at Running is documented in the note). Decision functions are pure and unit-tested. Co-Authored-By: Claude Code <noreply@anthropic.com>
onlynet
force-pushed
the
pr/idle-cpu-optimizations
branch
from
October 18, 2026 03:20
90b9ced to
5432487
Compare
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.
Result / 用户结果
Idle terminals and waiting agent sessions no longer redraw the whole
window at display refresh rate. Previously a parked agent turn kept the
spinner (and therefore the window) at vsync rate, the cursor blink chain
ticked forever on unattended panes, every PTY read batch issued a frame,
and the 1 Hz watchdog ran a full-machine
psenumeration on the UIthread (up to ~1 s of input latency per probe with large process tables,
measured in the Fleet fork on 2026-10-12). All of these costs now have a
local budget; a motionless terminal produces zero render frames.
Design / 设计边界
terminal/view.rs(cursor blinkidle pause, output frame coalescing),
workspace/agents.rs(SPINNER_TICK 80 ms chain, real-time phase),
process_tree.rs(
cached_activity_evidence, background thread + 250 ms sharedsnapshot),
ai_agents.rs(identify/detect single-slot memo keyed bymanifest generation),
agent_detection/claude.toml(prompt_idle regionwidened to six bottom non-empty lines for the Claude CLI 2.x chrome).
throttling and no semantic change: blink restarts on any input, output
storms neither keep the cursor lit nor add restart churn, spinner
animation speed is unchanged (phase advances by real elapsed time).
on the UI thread and stale batches are dropped by command identity.
Fleet regression where caching short-circuited
refresh_agent_screen_stateand pinned agents at Running is recordedin the note and explicitly avoided (cache key includes the manifest
generation so rule edits invalidate old conclusions).
Evidence / 验证依据
cargo test -p nebula— full suite green on Windows; includes newunit tests for the pure decision functions
(
blink_silence_pauses_only_after_the_full_threshold,output-frame timing cases, spinner phase wrap).
python scripts/check_architecture.py --base upstream/main— exit 0(587 counted source lines incl. the note).
(2026-10-12): vsync-rate spinner redraws were the single largest
idle-CPU item; watchdog stalls reproducible as periodic input latency.
After: 12.5 Hz spinner chain, zero frames for motionless terminals,
≤125 fps output ceiling, UI thread never blocks on
ps.machine); no platform-specific code is touched beyond the shared
watchdog path.
architecture/notes/nebula_app/gpui_shell/terminal/2026-10-12-idle-render-frame-budgets.md(a future render-snapshot cache stays a separate design gate and is
deliberately not part of this PR).
Required Review / 必须确认
CONTRIBUTING.md,docs/architecture.md, anddocs/project-constraints.md.python3 scripts/check_architecture.py --base <PR-base-commit>passes; budgets were not inflated to fit the change.🤖 Generated with Claude Code