fix oauth identity and codex reset credits

This commit is contained in:
ZheFox
2026-09-04 11:34:41 +08:00
parent 4cf47b1dee
commit fe8ff268df
7 changed files with 545 additions and 13 deletions
+11 -2
View File
@@ -1153,6 +1153,7 @@ import {
getCodexResetCreditAvailableCount,
getCodexResetCreditReservationIdempotencyKey,
getVisibleCodexResetCreditItems,
mergeCodexQuotaDisplays,
readPendingCodexResetCreditIdempotencyKey,
rememberPendingCodexResetCreditIdempotencyKey,
} from '@/features/providers/components/codex-reset-credit-display'
@@ -2235,9 +2236,17 @@ function applyQuotaRefreshResultToCurrentPage(result: Awaited<ReturnType<typeof
}
function getCodexResetCredits(key: PoolKeyDetail) {
return getQuotaSnapshotProviderType(key) === 'codex'
? key.status_snapshot?.quota?.reset_credits ?? null
if (getQuotaSnapshotProviderType(key) !== 'codex') return null
const snapshot = key.status_snapshot?.quota?.reset_credits
const snapshotUpdatedAt = key.status_snapshot?.quota?.updated_at
const snapshotDisplay = snapshot
? {
...(typeof snapshotUpdatedAt === 'number' ? { updated_at: snapshotUpdatedAt } : {}),
reset_credits: snapshot,
}
: null
return mergeCodexQuotaDisplays(snapshotDisplay, key.upstream_metadata?.codex)?.reset_credits ?? null
}
function getCodexCredentialGeneration(key: PoolKeyDetail): string | null | undefined {