Files
hermes-agent/apps
gilfoyle 32f146b07e fix(desktop): recover the context meter after compression instead of freezing stale (#94001)
useContextBreakdown made one refetch attempt per busy toggle, swallowed
failures, and kept serving the cached pre-compression breakdown whenever
fetched.sessionId still matched (it always does). After compression plus
a session.reclaimed resume, that single refetch races the agent rebuild:
a 4001 is swallowed and the meter freezes at the pre-compression
percentage; an in-flight rebuild answers a zeroed breakdown
(context_max: 0, the agent-is-None branch), which blanks the meter and
caches the zeros. No dep changes after the failed attempt, so nothing
ever retries — recovery required manually switching sessions.

Treat an untrustworthy answer as a transient window, not data: zeroed
breakdowns are never cached; failed fetches retry on a bounded backoff
(1s/4s/12s, re-running the fetch effect via an attempt counter); on
ladder exhaustion the cached breakdown is evicted so the meter goes dark
honestly rather than showing numbers known to be stale. Session switches
reset the retry state; the pending backoff timer is cancelled by the
fetch effect's own cleanup.

Fixes #94001 (scenarios 1, 2, 4).
2026-09-30 23:02:01 -05:00
..