Bug Description
The field current_interval_usage_count in the quota API response is misleadingly named — it actually represents the remaining quota for the current interval, not the usage.
In dist/mmx.mjs line 117, the code shows:
let{current_interval_usage_count:_, current_interval_total_count:S}=w
k = Math.max(0, S - _) // k = used
yt = `${k.toLocaleString()} / ${S.toLocaleString()}` // displays "used / total"
The display logic calculates used = total - usage_count, which means usage_count is actually remaining quota. The variable naming is confusing and leads to misinterpretation.
Expected Behavior
Field names should match their values:
current_interval_usage_count should be renamed to current_interval_remaining_count (or similar)
- Or at minimum, add comments explaining the counterintuitive naming
Additional Inconsistency
The weekly fields use the opposite convention:
current_weekly_usage_count = actually means usage (used)
current_weekly_total_count = total
A = M - Q where A = remaining, M = total, Q = usage
This makes the API very confusing to parse.
Impact
Anyone reading the API response or source code will assume usage_count means "usage" (how much has been used), when it actually means "remaining". This has caused confusion in multiple contexts.
Suggested Fix
- Rename
current_interval_usage_count to current_interval_remaining_count in the source
- Add JSDoc comments explaining the field meanings
- Alternatively, add a comment in the quota display code explaining the counterintuitive naming
Environment: N/A
CLI Version: (latest)
Bug Description
The field
current_interval_usage_countin the quota API response is misleadingly named — it actually represents the remaining quota for the current interval, not the usage.In
dist/mmx.mjsline 117, the code shows:The display logic calculates
used = total - usage_count, which meansusage_countis actually remaining quota. The variable naming is confusing and leads to misinterpretation.Expected Behavior
Field names should match their values:
current_interval_usage_countshould be renamed tocurrent_interval_remaining_count(or similar)Additional Inconsistency
The weekly fields use the opposite convention:
current_weekly_usage_count= actually means usage (used)current_weekly_total_count= totalA = M - Qwhere A = remaining, M = total, Q = usageThis makes the API very confusing to parse.
Impact
Anyone reading the API response or source code will assume
usage_countmeans "usage" (how much has been used), when it actually means "remaining". This has caused confusion in multiple contexts.Suggested Fix
current_interval_usage_counttocurrent_interval_remaining_countin the sourceEnvironment: N/A
CLI Version: (latest)