mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 06:16:37 +00:00
fix(cliproxy): tighten Codex window classification on incomplete metadata
Apply Copilot review feedback on PR #1113: - getCodexWindowKind: require cadence alongside category; fall through to label sniffing when missing instead of silently defaulting to 5h. - getCodexWindowDisplayLabel (CLI): for category 'additional', fall back through featureLabel -> window.label -> 'Additional' so partial cached windows preserve user-visible context.
This commit is contained in:
@@ -302,7 +302,7 @@ function getCodexWindowDisplayLabel(
|
||||
}
|
||||
|
||||
if (window.category === 'additional') {
|
||||
const pretty = prettifyCodexFeatureLabel(window.featureLabel || 'Additional');
|
||||
const pretty = prettifyCodexFeatureLabel(window.featureLabel || window.label || 'Additional');
|
||||
if (window.cadence === '5h') return `${pretty} (5h)`;
|
||||
if (window.cadence === 'weekly') return `${pretty} (weekly)`;
|
||||
return pretty;
|
||||
|
||||
+4
-4
@@ -343,16 +343,16 @@ export type CodexWindowKind =
|
||||
export function getCodexWindowKind(labelOrWindow: string | CodexQuotaWindow): CodexWindowKind {
|
||||
if (typeof labelOrWindow === 'object' && labelOrWindow !== null) {
|
||||
const w = labelOrWindow;
|
||||
if (w.category === 'additional') {
|
||||
if (w.category === 'additional' && w.cadence) {
|
||||
return w.cadence === 'weekly' ? 'additional-weekly' : 'additional-5h';
|
||||
}
|
||||
if (w.category === 'code-review') {
|
||||
if (w.category === 'code-review' && w.cadence) {
|
||||
return w.cadence === 'weekly' ? 'code-review-weekly' : 'code-review-5h';
|
||||
}
|
||||
if (w.category === 'usage') {
|
||||
if (w.category === 'usage' && w.cadence) {
|
||||
return w.cadence === 'weekly' ? 'usage-weekly' : 'usage-5h';
|
||||
}
|
||||
// No category metadata -> fall through to label sniffing.
|
||||
// Missing or incomplete category metadata -> fall through to label sniffing.
|
||||
return getCodexWindowKindFromLabel(w.label);
|
||||
}
|
||||
return getCodexWindowKindFromLabel(labelOrWindow);
|
||||
|
||||
Reference in New Issue
Block a user