feat(combos): add per-combo round-robin strategy

Add ability to configure round-robin strategy for individual combos,
similar to per-provider strategy overrides.

Changes:
- Add comboStrategies setting to store per-combo strategy overrides
- Add Round Robin toggle to each combo card in combos page
- Update chat handler to check combo-specific strategy before global
- Combo-specific strategy takes precedence over global comboStrategy

When enabled, each request to that combo will cycle through providers
instead of always starting with the first one.

Made-with: Cursor
This commit is contained in:
decolua
2026-03-23 10:08:24 +07:00
parent 96f5e5c92a
commit 3e694a383f
3 changed files with 70 additions and 20 deletions
+10 -2
View File
@@ -84,7 +84,11 @@ export async function handleChat(request, clientRawRequest = null) {
// Check if model is a combo (has multiple models with fallback)
const comboModels = await getComboModels(modelStr);
if (comboModels) {
const comboStrategy = settings.comboStrategy || "fallback";
// Check for combo-specific strategy first, fallback to global
const comboStrategies = settings.comboStrategies || {};
const comboSpecificStrategy = comboStrategies[modelStr]?.fallbackStrategy;
const comboStrategy = comboSpecificStrategy || settings.comboStrategy || "fallback";
log.info("CHAT", `Combo "${modelStr}" with ${comboModels.length} models (strategy: ${comboStrategy})`);
return handleComboChat({
body,
@@ -111,7 +115,11 @@ async function handleSingleModelChat(body, modelStr, clientRawRequest = null, re
const comboModels = await getComboModels(modelStr);
if (comboModels) {
const chatSettings = await getSettings();
const comboStrategy = chatSettings.comboStrategy || "fallback";
// Check for combo-specific strategy first, fallback to global
const comboStrategies = chatSettings.comboStrategies || {};
const comboSpecificStrategy = comboStrategies[modelStr]?.fallbackStrategy;
const comboStrategy = comboSpecificStrategy || chatSettings.comboStrategy || "fallback";
log.info("CHAT", `Combo "${modelStr}" with ${comboModels.length} models (strategy: ${comboStrategy})`);
return handleComboChat({
body,