maxpool 1.8.1 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/account-manager.js +14 -13
package/package.json
CHANGED
package/src/account-manager.js
CHANGED
|
@@ -3055,19 +3055,20 @@ export class AccountManager {
|
|
|
3055
3055
|
* covers the case where the old stamp was never learned. */
|
|
3056
3056
|
noteCapacityWindowAdvance(accountName, window, prevResetAt, nextResetAt) {
|
|
3057
3057
|
if (!prevResetAt || !nextResetAt) return;
|
|
3058
|
-
//
|
|
3059
|
-
//
|
|
3060
|
-
//
|
|
3061
|
-
//
|
|
3062
|
-
//
|
|
3063
|
-
//
|
|
3064
|
-
//
|
|
3065
|
-
//
|
|
3066
|
-
// (>=5h)
|
|
3067
|
-
//
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3058
|
+
// TWO guards, both learned from live data (2026-08-23):
|
|
3059
|
+
// 1. PAST stamp = a probe that answered late (its window rolled mid-request) or
|
|
3060
|
+
// vendor clock skew — honoring it closed a minutes-long "cycle" sliver. Close
|
|
3061
|
+
// at NOW instead: the window genuinely rolled, just later than the stale stamp.
|
|
3062
|
+
// 2. JITTER: OAuth stamps derive per-response as Date.now()+delay*1000
|
|
3063
|
+
// (parseResetHeader), so one boundary reads ~2s later on every response; a
|
|
3064
|
+
// bare `>` comparison shredded one real 5h window into 9-10 fake cycles and
|
|
3065
|
+
// dated a "weekly" cycle a week into the future. A real advance moves a whole
|
|
3066
|
+
// window (>=5h) — the 60s epsilon separates it by three orders of magnitude.
|
|
3067
|
+
// Provider stamps (z.ai/Kimi probe) are absolute and never jitter.
|
|
3068
|
+
const nowMs = Date.now();
|
|
3069
|
+
const boundary = nextResetAt <= nowMs ? nowMs : nextResetAt;
|
|
3070
|
+
if (boundary - prevResetAt < WINDOW_ADVANCE_EPSILON_MS) return;
|
|
3071
|
+
this.capacity.closeCycle(accountName, window, boundary, { resetAt: prevResetAt });
|
|
3071
3072
|
}
|
|
3072
3073
|
|
|
3073
3074
|
/**
|