fix(quota): normalize OpenCode Go reset timestamps

Go returns ISO reset dates, but the shared usage contract requires numeric timestamps. Convert dates to milliseconds before building usage windows.

Verified all three windows against the live Go API. Added numeric timestamp and partial-window regressions; 14 focused tests, web type-check, lint, and syntax checks pass.
This commit is contained in:
Bohdan Triapitsyn
2026-09-09 23:23:22 +03:00
parent 936f9b0a92
commit a8f0f99c3d
2 changed files with 27 additions and 2 deletions
@@ -25,7 +25,7 @@ export const parseOpenCodeGoUsage = (payload) => {
if (typeof resetAt !== 'string' || !Number.isFinite(new Date(resetAt).getTime())) continue;
windows[key] = toUsageWindow({
usedPercent: Math.min(100, Math.max(0, usedPercent)),
resetAt,
resetAt: new Date(resetAt).getTime(),
windowSeconds: null,
});
}