#127647·hermes-agent

Tracker: Desktop idle resource burn — renderer CPU/GPU, backend serve CPU, and memory (scope map for #122413 / #88288)

Author: kshitijk4poorCreated Sep 29, 2026Updated Oct 2, 2026
Labelstype/perfP2comp/desktopcomp/dashboardarea/memory

Index: Triage plan · Related PRs, all states · Which changes introduced each mechanism · 2026-09-29 triage-bot pass (status changes, missing mechanisms) · Interactive map · open issues are attached as sub-issues.

Why this tracker exists

Desktop idle resource burn has been reported and fixed piecemeal for about three months (June to September 2026), across more than 130 issues and PRs. Each fix closed one mechanism, then the next report brought the symptom back, and nothing recorded in one place what is fixed, what is open and what is still unexplained. This issue maps that scope and sets the order of work. It does not replace the individual issues: fixes land against them, and this list is updated as they do.

Anchors: #122413 (renderer at about 0.8 of a core while idle, macOS, open) and #88288 (renderer hot loop plus a spinning backend hermes serve, closed as cannot-reproduce until someone supplies a profile).

Checked against:

  • Sections 1–3 were first checked against origin/main @ ea114c3e98 (2026-09-28).
  • The rows added on 2026-09-29 came from the triage pass, which checked them at e408d36339.
  • The key code claims were re-checked at b8a8be185d (2026-09-29): host-backend-singleton.ts, NVIDIA_BROKEN_EGL_MAJORS, methods_tools.py:495, runGit, fs.watch, idx_messages_session_id.
  • GitHub states were read on 2026-09-29.
  • "Hypothesis" means no profile has proven it yet.

Rules for every item:

  • Fixed mechanisms stay fixed. Do not reopen one without a profile taken after the fix.
  • Every fix carries before/after numbers:
    • same machine and same scenario for both;
    • median of 3 runs;
    • per-process CPU-time deltas, not %CPU.
  • Say so when nothing changes. If a scenario shows no difference, the PR says that instead of claiming a saving.

Scope: four separate costs

The reports all say "Hermes is heavy", but they mix four different things:

  1. Renderer CPU/GPU while idle: Hermes Helper (Renderer), the GPU helper, and WindowServer compositing.
  2. Backend serve CPU while idle: Python polling paths, plus the gateway-side spins in the same family.
  3. Memory (RAM): renderer native memory, Electron main-process heap, and resident backends and MCP children that never exit.
  4. The Electron main process and the processes it spawns: file-watcher storms, git probes, nvidia-smi, orphan GUI processes. It also covers one power issue: keep-awake stops the machine sleeping.

#122413 and #88288 are about costs 1 and 2. Neither reports memory growth: #88288's roughly 825 MB total is a normal Electron plus Python footprint.


Triage plan

Work runs in waves:

  • Wave 0 comes first because every later wave needs its numbers.
  • Waves 1 and 2 are independent and can run in parallel.
  • Wave 5 is mostly retests, and several of them depend on waves 1 and 2 landing.

Per item: reproduce on current main → record a before profile → fix the mechanism (the whole class, not one call site) → record an after profile on the same machine → close with both numbers.

Wave 0: measurement (blocks the rest of section 1)

  • Lint gates plus the idle contract: #127719, armed (CI: one flaky UI test re-run pending).
    • A new ungated setInterval fails lint, and so does a new infinite animation the hidden-window pause cannot reach.
    • It adds a written "what may run when" contract to apps/desktop/AGENTS.md.
    • It pauses 10 infinite animations that were missing from the pause list.
  • idle-burn perf scenario plus a core-E2E idle gate: #128134 (open, @kshitijk4poor).
    • idle-burn (report-only) measures per-process CPU (renderer / GPU / browser), recalcs, layouts and running animations in three phases: viewed-quiet, viewed with N busy sessions, and hidden-busy. --attribute prices each animation by pausing it (the #89732 method).

    • The gate counts motion, not CPU %: running infinite CSS animations plus rAF callbacks/s. Idle must be still, a running turn must move, a hidden window must be still, and a finished turn must be still. 10/10 green locally; two mutations go red.

    • Baseline on main b8a8be185d (macOS, 3 busy sessions, median of 3, % of one core):

      Phase Renderer GPU Recalcs/s Running animations
      Viewed, nothing busy 1.1 1.3 3 0
      Viewed, 3 busy 13.0 14.6 85 3 × arc-border
      Hidden, 3 busy 4.5 1.5 17 0

      Pausing only arc-border saves 8.1 renderer, 12.2 GPU and 65 recalcs/s. It still triggers style recalcs every frame, about 22/s per row.

    • The gate's first catch is fixed in the same PR: a pause controller created in an already-hidden window thought the window was shown (the working pulse replayed while hidden in 4/8 runs). Introduced by 7a5d534f5b (#72388).

    • Follow-up, pre-existing: window state is pushed only on change, plus one seed push for the main window. A secondary or session window created already minimized starts as "shown" until its next change. Fix: pull the state on first subscribe (an invoke that returns getWindowState).

    • Not yet covered: a visible-but-unfocused phase (waits on the unfocused-window policy decision), and a real hide on macOS (Electron emits no hide event for a programmatic hide of a test-launched window; the scenario forces the pause attribute and says so).

Wave 1: visible-idle renderer, the biggest cost users feel (#122413, #89732)

Measured on #89732: 74.8% of a core with the app as shipped, against 1.3% with reduced motion (Windows, Intel iGPU). About half of it is .arc-border::before and the rest is .glyph-spinner__strip.

  • arc-border composited area.
    • The problem: ::before is a 300% × 300% gradient layer under mask-composite: exclude, about 9× the ring's visible area, and it is recomposited every frame (styles.css:1112, :1207).
    • The fix: shrink the layer to the host plus a margin, or drop the masked composite.
    • Also: it renders on the empty-pane placeholder, where no work is running.
  • glyph-spinner strip. It is compositor-only but still costs GPU-process time. Measure it before choosing a fix.
  • tw-shimmer: #115274 (stop after three passes).
  • Policy (maintainer decision, needed before the items above can be closed).
    • The question: does a visible but unfocused window animate?
    • The history: #86587 paused animations on blur, and #106225 reverted that.
    • Candidates: #92463 (pause on invisibility, not blur; a review blocker remains), #89839, and the reduced-effects preference #79071.
    • The proposed rule: decorative motion runs only while real work is running, not merely while the window is visible.
  • Renderer work at idle:
    • #100768: a 30 s re-graft rewrites 2k–13k DOM nodes.
    • #100675: a split pane rebuilds every ~5 s after the Bots page has been visited.
    • #104111 / #106604: the same fix twice; pick one. The whole chat shell re-renders on every sessions.changed tick.
    • #98644, #98719: sidebar working rings, and a browser-overlay pulse that keeps running after the turn ends.
    • #106951: artifact indexing that was abandoned keeps running.
  • Retest with idle-burn after the arc-border, glyph-spinner and shimmer items land: #122413, #42109, #79853 (same hot-frame signature) and #37893.

Wave 2: backend idle (cheap, high confidence)

  • #119403: a covering index for the per-session MAX(m.timestamp) subquery (reported 416 MB → 2 MB per query). No PR yet, and it is a one-line change. Idle sessions.changed refreshes multiplied this cost; #126752 fixed that part.
  • #104849: the skill command catalog rescans every SKILL.md about 3× every 5 s. _catalog_skills calls scan_skill_commands() directly (tui_gateway/methods_tools.py:495), so it bypasses the cache. #104864's multi-slot cache alone therefore does not fix it; both parts are needed.
  • #95767: tile reconcile fetches 120 messages per tile per tick before checking whether anything changed.
  • #66315, #58332: the messaging sidebar poll fans out across every profile's backend (profile=all), and a 10 s cross-profile poll spawns CLI plugin discovery.
  • #108088: needs a maintainer decision between option A and option B in that thread. #108111 no longer exists, so it is dropped from this item.
  • #88288: new reopen condition.
    • Use a build from 2026-09-20 or later. Builds from 2026-09-17 to 2026-09-19 carry the unrelated #115983 spin (f1df0aa01b → 6fc43ca6ed), which runs on the mcp-event-loop thread.
    • Include the thread name in the py-spy dump.
  • Gateway-side spins:
    • #85838: retest on a build with fe0a56ed16b and 857e651b5fc.
    • #96181 with #110285.
    • #53362 with #53381: the SIGINT handling still needs to be coordinated with the Node parent process.

Wave 3: the Electron main process and its children (new section 4)

  • #125243 — bundle-skew git rev-list probes.
    • What happens: they pile up on tree:0 partial clones, lazy-fetch objects, and survive an app restart: 21 at once, about 4.8 cores.
    • The code today: runGit (electron/main.ts:3310) has no timeout, no tracking and no GIT_NO_LAZY_FETCH.
    • Next step: merge #125861, #124590 and #123039 into one fix.
  • #118974 — a Windows fs.watch IOCP rename storm pins the main thread at 100%.
    • Still present: electron/main.ts:6243 and :6331 still use fs.watch.
    • Next step: a new PR is needed, because the only fix PR (#118980) no longer exists. #75608 is an earlier report of the same loop.
  • #120262 — nvidia-smi is spawned twice every 5 s, at 32–44% of a core per spawn.
    • Fix PR: #120285.
    • Its blocker: it must parse each field separately and tolerate N/A, or backend detection can flip from CUDA to CPU.
  • #102274: scope keep-awake to active agent runs. It is a power issue, not a CPU one.
  • #51215: Windows update/restart leaves old Hermes.exe GUI processes behind: 5 or more, up to about 541 MB each.

Wave 4: GPU process and driver loops (platform-specific)

  • #124255: narrowed but not fixed. #123213 limits the NVIDIA fallback to the 580 series, and this issue's reporter is on 580.
    • Next step: a behaviour probe, or the Electron 42 upgrade (#124032).
    • Related: #124842 (bundled with an unrelated change) and #124275 (a warning only).
  • #124843: Mesa/Wayland GPU-child init loop at about 350% CPU. It needs a maintainer decision on the marker rule in #124898.
    • Related: #85803 (--no-zygote, reported 66% → 8.4%).
    • Related: #99628 (--disable-gpu, so that desktop.disable_gpu actually removes the GPU process).
  • #89967: retest (#101182).

Wave 5: memory

  • #105239: retest first. #118246 routes every local profile to one host serve.
    • The test: open N local profiles and expect exactly 1 serve.
    • If it passes, what is left is the pool cap for remote/SSH profiles and for HERMES_DESKTOP_ISOLATED_BACKEND=1.
    • Retest the same way: #46975, #107828, #98746, #98157.
  • #121735: re-capture Windows native memory after wave 1, since the PaintChunk churn is tied to the animations.
  • #58485: ask for a heap snapshot taken before the crash. Related: #99187.
  • Renderer retention:
    • #108172: the artifact registry keeps up to 19.2k content strings.
    • #117901 / #117903: finished agent terminals pin their backlog, about 195 MB.
    • #95302 and #49020.
    • #62964: retest on current main.
  • Process lifecycle:
    • #81275
    • #76244: serve hangs on SIGTERM and is orphaned to PID 1.
    • #95041
    • #102549
    • #108665: idle execute_code kernels.
    • #91564 (open half).
  • MCP children:
    • Windows: #108084, #63675, #61089.
    • uvx reconnect without backoff: #72069.
    • Mid-process reaper: #101979.
  • Dashboard / TUI gateway:
    • #62743, with #108141, #49756 and #50403.
    • #46082, #80527, #76759, #64488.
    • #103777 (#103784 vs #105285).
    • #58694.
    • PRs: #63551, #76768, #53308, #64534.
    • Close #63708 as superseded by #76905 unless something differs.

1. Renderer CPU/GPU while idle

Fixed on main (do not reopen without a profile taken after the fix)

Issue Mechanism Fix
#51927 Static backgroundThrottling: false plus process-wide switches that turn throttling off, which pinned visibilityState to visible #75218 / 8ccb4c2cee: throttling becomes a runtime setting, used only while a turn streams
#53902, #73082 arc-border / progress-slide animated non-compositor properties: about 3.6k style recalcs per minute at idle, with hot frames in fontations + temporal_rs #91383 / 443d4387b5 (−96% idle renderer work); #91450 / d4725254 (stale busy flags)
#72844 GlyphSpinner ran setInterval + setState: 12.6 commits/s #78266, then #91473 / 76e0ca88 (compositor transform)
#88275 HUD setInterval(measure, 300) b9fea361ec, #106602
#98394 DecodeText placeholder looped a 45 ms setState forever #117689 / 56af2bdf7e
(#99889 in part) Four components inserted <style>@keyframes</style> on every mount #117102 / efa09f49c1
(#74844) Infinite animate-ping / animate-pulse status dots #77651 / 9d76d48d0a (StatusPulse)
(#72388 family) About 1/s no-op session.info heartbeats republished $sessionStates (GC starvation) #72388
(JS loops) rAF loops with no budget #88588 (createBudgetedLoop), #88564, #88406
(hidden tiles) Hidden kept-alive tiles polled process.list / subagent.* #106603, #117066
(polls) Seven always-on desktop polls (~89 round trips/min at idle) #73673, replaced by gateway broadcasts

Open mechanisms

# Mechanism Evidence Next step
1.8 tw-shimmer paint cost #121735 fixture, #89732 #115274 (wave 1)
1.9 Visible but unfocused window animates at full rate (#106225 reverted #86587) #122413, #89732 Maintainer policy decision (wave 1)
1.11 #122413 residual, about 0.8 core at idle, cause not named #122413 idle-burn attribution (wave 0)
1.12 arc-border ::before is 9× the visible area, masked and recomposited every frame, including on empty panes #89732 (royhemi): arc-border ≈ half of 74.8% Wave 1
1.13 glyph-spinner strip compositing #89732: ≈ the other half Measure, then wave 1
1.14 Renderer work at idle: re-graft, split-pane wipe, whole-shell re-render on sessions.changed #100768, #100675, #104111 / #106604 Wave 1
1.15 Per-frame work that grows with transcript length #126486, #118782; #127062 merged #125851, #125866, #103448
1.16 GPU process: driver loops and fallbacks #124255 (narrowed by #123213), #124843, #89967 Wave 4

Also open (interaction cost, same style/layout path): #99889 (needs a SelectorStats trace).

What the #122413 evidence says (hypothesis until wave 0 measures it)

  • Its hot-frame signature matches #53902. #53902 turned out to be CSS animation and style recalc, not JavaScript. #42109 is the earliest report with the same signature.
  • The JS clocks #122413 names are mostly already gated on main:
    • cron-jobs-section.tsx:156 is gated on usePaneVisible().
    • agents/index.tsx:228 runs only while active > 0 and the pane is visible.
    • lib/time.ts shares its formatter instances.
  • #121735: pausing all CSS animations took the renderer from 86% to 0%.
  • #89732 attributes the visible-idle cost to arc-border plus glyph-spinner compositing. --disable-gpu-compositing moves the cost to the CPU instead of removing it.
  • #122446 and #122437 are correct for their own timers, but are not expected to move #122413's numbers.

2. Backend serve CPU while idle

Fixed on main

  • #108005: the notification poller's cost grew with open sessions squared. Fixed by #117063. Related: #60861 (busy requeue hot-spin) and #112267 (bot mailbox poll opened state.db twice a second per session).
  • #114041: list_profiles() → _count_skills() → rglob ran on every polled caller. Fixed by #114879. Related: #117601 and #106609 (roster and project-tree scans), and #120402 / #120407 (dashboard).
  • #98005 / #104094: heartbeat and last_activity_at writes moved state.db's modification time, so sessions.changed fired while idle and the session list refreshed every 25–60 s. Fixed by #126752 (defaf5e, 2026-09-28). The 0.5 s mtime watch came from #73673.
  • #115483: a dead stdio MCP child spun the lifecycle loop on timeout=0. It was introduced by f1df0aa01b (2026-09-17) and fixed by #115983 / 6fc43ca6ed (2026-09-19). It is a different bug from #88288.
  • #91564, loopback half: #95634.

Open

# Mechanism Evidence Next step
2.3 Session-list MAX(m.timestamp) subquery planned onto idx_messages_session_id, which does not cover timestamp #119403 Covering index, no PR yet (wave 2)
2.4 Bot Mode relay keeps the local backend alive #108088 Maintainer decision
2.5 macOS serve kqueue loop, cause unknown #88288, a second report in its comments New reopen condition (wave 2)
2.6 Skill command catalog bypasses its cache and rescans about 3× every 5 s #104849 Fix the bypass and #104864
2.7 Tile reconcile fetches 120 messages per tick; messaging poll fans out across profiles #95767, #66315, #58332 Wave 2
Gateway Spins on a stuck session, auto-resume replays, TUI ignores SIGINT #85838, #96181, #53362 Wave 2

3. Memory (RAM)

Desktop renderer / main process

  • #121735: the Windows renderer reaches 3.2–3.6 GB private memory, with about 2.7 GiB native. The PaintChunk path churns about 11.8 GiB in 3 minutes, so it is tied to section 1.
  • #58485: the main process runs out of V8 heap after about an hour. No heap snapshot exists. Related: #99187 (activity-timer maps and main-process caches that only grow).
  • #62964: needs a retest. The renderer heap ceiling (7d2d634708) and the bounded auto-reload (60329f766f) have landed since.
  • Retention: #108172 (artifact registry), #117901 / #117903 (terminal backlog), #95302 (unreconciled snapshots), #49020 (deleted sessions keep their store entries), #95189 (WSL2 reconnect churn).
  • Landed: #117681, #118014 (closing #77311), #108156, #117067.

Resident backends and MCP children

  • #105239 (pool pinned tier): probably fixed for local profiles by #118246 (25c74f731c, 2026-09-21).
    • How: sharesHostBackend() routes every local profile to one host backend, and assertNoSecondLocalBackend() refuses to spawn a second.
    • Still pooled: remote/SSH profiles, HERMES_DESKTOP_ISOLATED_BACKEND=1, and mutating requests that cannot be scoped to a profile.
    • The pool code still has no cap on the pinned tier.
    • Status: not measured; the retest is in wave 5.
    • Siblings to retest: #46975, #107828, #98746, #98157.
  • #81275 (orphans), #76244 (SIGTERM hang), #95041, #102549, #91564 (open half: a second serve next to the local gateway duplicates every MCP), #108665 (idle kernels; #122263 covers session end only).
  • MCP: #108084, #63675, #61089 (Windows), #72069 (uvx reconnect storm), #101979 (mid-process reaper). #81880 is closed as not planned.
  • Landed: #117068 (hover prewarm cascade, #100548), #108134 / #108069 (a backend per profile), #101598 / #77511 (MCP supervisor, lazy startup), #71006 (slash workers on demand).

Dashboard / TUI gateway (not the desktop, same class of symptom)

  • #62743 (#108141, #49756, #50403), #46082, #80527, #76759, #64488, #103777, #58694. PRs: #63551, #76768, #53308, #64534, #58721 / #61121,

Source: NousResearch/hermes-agent