M1: Implement Z.ai quota response parser #6
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
P1
P2
P3
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Creatidy/scarcity-router#6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implement the first provider-edge parser: Z.ai Coding Plan quota response → normalized capacity contract v1.
Scope (strictly pure parsing + normalization):
CapacitySnapshot(provider=zai,source=zai_usage_endpoint).Behavior:
code/msg/success/data.level/data.limits[]) deliberately; structurally incompatible successful responses map toschema_changedwith no partial decoding.TOKENS_LIMIT (unit=3, number=5)→ five_hour tokens (18000s);TOKENS_LIMIT (unit=6, number=1)→ weekly tokens (604800s). Never by array position.TIME_LIMIT→resource=time,kind=unknown(no inferred period).(unit, number)/ missingunit/number→kind=unknown, window preserved with a deterministic safewindow_id, no invented duration.percentageis used-oriented (evidenced): valid int 0..100 →used_percent+remaining_percent=100-used; otherwise omit the pair and emitpercentage_unknown. Missing ≠ zero.nextResetTimeis epoch milliseconds → canonical UTCYYYY-MM-DDTHH:MM:SS.sssZ; unusable values omitresets_atand emitreset_unknown.data.levelonly when it already satisfies the v1 safe-ID grammar; otherwise omitted.auth_requiredwith no synthesized windows; provider error text never enters normalized output.Constraints:
recommendedgate must stay 0 errors / 0 warnings / 0 notes viamake check.One issue → one branch → one PR → human review.
kilo referenced this issue2026-10-18 01:19:02 +00:00
kilo referenced this issue2026-10-24 09:01:55 +00:00