Spaces:
Paused
Paused
icebear0828 Claude Opus 4.6 commited on
Commit ·
247b874
1
Parent(s): 4f2220c
fix: window counter review issues — opacity modifier, catch-up spam, rounding
Browse files- text-dim color uses <alpha-value> interpolation so dark:text-text-dim/70 works
- Multi-window catch-up jumps to correct window in one step (no log spam)
- formatWindowDuration uses Math.floor instead of Math.round
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Files changed (3)
429 unmodified lines430431432433434435436437438439440441442443444445429 unmodified lines// Auto-reset window counters when window has expiredconst windowResetAt = entry.usage.window_reset_at;if (windowResetAt != null && now.getTime() / 1000 >= windowResetAt) {console.log(`[AccountPool] Window expired for ${entry.id} (${entry.email ?? "?"}), resetting window counters`);entry.usage.window_request_count = 0;entry.usage.window_input_tokens = 0;entry.usage.window_output_tokens = 0;entry.usage.window_counters_reset_at = now.toISOString();// Estimate next window end using stored durationconst windowSec = entry.usage.limit_window_seconds;if (windowSec && windowSec > 0) {entry.usage.window_reset_at = windowResetAt + windowSec;} else {entry.usage.window_reset_at = null; // Wait for backend sync to correct}429 unmodified lines430431432433434435436437438439440441442443444445446447448429 unmodified lines// Auto-reset window counters when window has expiredconst windowResetAt = entry.usage.window_reset_at;const nowSec = now.getTime() / 1000;if (windowResetAt != null && nowSec >= windowResetAt) {console.log(`[AccountPool] Window expired for ${entry.id} (${entry.email ?? "?"}), resetting window counters`);entry.usage.window_request_count = 0;entry.usage.window_input_tokens = 0;entry.usage.window_output_tokens = 0;entry.usage.window_counters_reset_at = now.toISOString();// Jump to the correct current window (handles multi-window catch-up in one step)const windowSec = entry.usage.limit_window_seconds;if (windowSec && windowSec > 0) {let nextReset = windowResetAt + windowSec;while (nextReset <= nowSec) nextReset += windowSec;entry.usage.window_reset_at = nextReset;} else {entry.usage.window_reset_at = null; // Wait for backend sync to correct}
5 unmodified lines6789101112131415161718195 unmodified linesexport function formatWindowDuration(seconds: number, isZh: boolean): string {if (seconds >= 86400) {const days = Math.round(seconds / 86400);return isZh ? `${days}天` : `${days}d`;}if (seconds >= 3600) {const hours = Math.round(seconds / 3600);return isZh ? `${hours}小时` : `${hours}h`;}const minutes = Math.round(seconds / 60);return isZh ? `${minutes}分钟` : `${minutes}m`;}5 unmodified lines6789101112131415161718195 unmodified linesexport function formatWindowDuration(seconds: number, isZh: boolean): string {if (seconds >= 86400) {const days = Math.floor(seconds / 86400);return isZh ? `${days}天` : `${days}d`;}if (seconds >= 3600) {const hours = Math.floor(seconds / 3600);return isZh ? `${hours}小时` : `${hours}h`;}const minutes = Math.floor(seconds / 60);return isZh ? `${minutes}分钟` : `${minutes}m`;}
12 unmodified lines1314151617181912 unmodified lines"card-dark": "#161b22","border-dark": "#30363d","text-main": "#e6edf3","text-dim": "#8b949e",},fontFamily: {display: [12 unmodified lines1314151617181912 unmodified lines"card-dark": "#161b22","border-dark": "#30363d","text-main": "#e6edf3","text-dim": "rgb(139 148 158 / <alpha-value>)",},fontFamily: {display: [
src/auth/account-pool.ts+6-3
web/src/utils/format.ts+3-3
web/tailwind.config.ts+1-1