Expand description
Persistent forge state: the per-account usage cache.
It lives in the machine-local redb store (crate::store::state).
load and store are thin wrappers over that tenant;
ForgeState / CachedAccountUsage are the in-memory shapes.
The usage cache solves the cold-boot problem: Anthropicβs
/api/oauth/usage endpoint rate-limits aggressively on per-IP burst
probes, so the first launch can wait 30 s+ before the warm probe gets
through - during which the launchpad picker has no usage to show and
the walk sees every account as unknown. The cache seeds the in-memory
AccountStateMap with the last known values until the 60 s poller
refreshes them.
Failures are non-fatal: a closed store degrades to βno cache; spawn paths see empty bars until the poller succeeds.β
Re-exportsΒ§
use forge_primitives::usage::UsageSnapshot;πuse serde::Deserialize;πuse serde::Deserialize;πuse serde::Serialize;πuse serde::Serialize;π
StructsΒ§
- Cached
Account Usage - Per-account cache entry. The value type of the redb
account_usagetable; reachable only in-crate sinceaccount_cacheis a private mod. - Forge
State π - In-memory forge state read from the redb store.