feat(core): implement towards policy-driven model fallback mechanism (#13781)

This commit is contained in:
Adam Weidman
2025-11-26 12:36:42 -08:00
committed by GitHub
parent 0f12d6c426
commit 87edeb4e32
8 changed files with 550 additions and 40 deletions

View File

@@ -30,7 +30,7 @@ export interface ModelAvailabilitySnapshot {
}
export interface ModelSelectionResult {
selected: ModelId | null;
selectedModel: ModelId | null;
attempts?: number;
skipped: Array<{
model: ModelId;
@@ -107,12 +107,12 @@ export class ModelAvailabilityService {
const state = this.health.get(model);
// A sticky model is being attempted, so note that.
const attempts = state?.status === 'sticky_retry' ? 1 : undefined;
return { selected: model, skipped, attempts };
return { selectedModel: model, skipped, attempts };
} else {
skipped.push({ model, reason: snapshot.reason ?? 'unknown' });
}
}
return { selected: null, skipped };
return { selectedModel: null, skipped };
}
resetTurn() {