fn snapshot_from_zai_quota(
payload: QuotaLimitData,
) -> Result<UsageSnapshot, ProbeError>Expand description
Map a Z.ai quota-limit payload into a
forge_primitives::usage::UsageSnapshot.
CREDIT_LIMIT entries carry the windows in credits: usage is the
per-window limit and consumption is usage - remaining, which is
where the utilization percentage comes from - the payload’s own
percentage field is not mapped. The unit-3 (hours) entry is the
5-hour window, unit-6 (weeks) the weekly one. An absent 5-hour
nextResetTime, the steady state before the first successful
request, maps to a window with no reset moment.
Fallible like the forge-gateway spend and window mappers: a payload with no mappable window entries is a response forge cannot read rather than a bill of zero.