mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-05 09:33:07 +00:00
fix: base usage indicator on provider window limits
This commit is contained in:
@@ -244,10 +244,19 @@ export function UsagePopover() {
|
|||||||
return 'bg-green-500';
|
return 'bg-green-500';
|
||||||
};
|
};
|
||||||
|
|
||||||
const codexWindowMinutes = codexUsage?.rateLimits?.primary?.windowDurationMins ?? null;
|
const codexPrimaryWindowMinutes = codexUsage?.rateLimits?.primary?.windowDurationMins ?? null;
|
||||||
|
const codexSecondaryWindowMinutes = codexUsage?.rateLimits?.secondary?.windowDurationMins ?? null;
|
||||||
|
const codexWindowMinutes =
|
||||||
|
codexSecondaryWindowMinutes && codexPrimaryWindowMinutes
|
||||||
|
? Math.min(codexPrimaryWindowMinutes, codexSecondaryWindowMinutes)
|
||||||
|
: (codexSecondaryWindowMinutes ?? codexPrimaryWindowMinutes);
|
||||||
const codexWindowLabel = codexWindowMinutes
|
const codexWindowLabel = codexWindowMinutes
|
||||||
? getCodexWindowLabel(codexWindowMinutes).title
|
? getCodexWindowLabel(codexWindowMinutes).title
|
||||||
: 'Window';
|
: 'Window';
|
||||||
|
const codexWindowUsage =
|
||||||
|
codexWindowMinutes === codexSecondaryWindowMinutes
|
||||||
|
? codexUsage?.rateLimits?.secondary?.usedPercent
|
||||||
|
: codexUsage?.rateLimits?.primary?.usedPercent;
|
||||||
|
|
||||||
// Determine which provider icon and percentage to show based on active tab
|
// Determine which provider icon and percentage to show based on active tab
|
||||||
const indicatorInfo =
|
const indicatorInfo =
|
||||||
@@ -260,7 +269,7 @@ export function UsagePopover() {
|
|||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
icon: OpenAIIcon,
|
icon: OpenAIIcon,
|
||||||
percentage: codexMaxPercentage,
|
percentage: codexWindowUsage ?? 0,
|
||||||
isStale: isCodexStale,
|
isStale: isCodexStale,
|
||||||
title: `Usage (${codexWindowLabel})`,
|
title: `Usage (${codexWindowLabel})`,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user