fix(ui): widen getCodexWindowKind parameter to accept CodexWindowSummary

The new helpers added in this PR (inferCodeReviewCadence,
getCodexWindowDisplayLabel) operate on CodexWindowSummary - a Pick subset
of CodexQuotaWindow without usedPercent/remainingPercent/resetAt. They
pass that subset into getCodexWindowKind, which was still typed as
string | CodexQuotaWindow, so tsc -b fails with TS2345 in CI. The
function only reads label/category/cadence, all of which exist on
CodexWindowSummary, so widening the parameter is safe and lets a real
CodexQuotaWindow continue to flow through unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
yousiki
2026-04-28 10:59:58 +09:00
co-authored by Claude Opus 4.7
parent a90aadd202
commit 0e602932f2
+1 -1
View File
@@ -340,7 +340,7 @@ export type CodexWindowKind =
* Map a Codex window into a semantic bucket. Prefers explicit category metadata
* (post-2026-04 windows) and falls back to label sniffing for legacy cached data.
*/
export function getCodexWindowKind(labelOrWindow: string | CodexQuotaWindow): CodexWindowKind {
export function getCodexWindowKind(labelOrWindow: string | CodexWindowSummary): CodexWindowKind {
if (typeof labelOrWindow === 'object' && labelOrWindow !== null) {
const w = labelOrWindow;
if (w.category === 'additional' && w.cadence) {