{"record":{"id":"e69ade5743f8ea11","repo":"diegosouzapw/OmniRoute","slug":"combo-combo-name-has-no-models-configured","errorCode":null,"errorMessage":"Combo \"${combo.name}\" has no models configured","messagePattern":"Combo \"(.+?)\" has no models configured","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/domain/comboResolver.ts","lineNumber":30,"sourceCode":" * @typedef {import('./types.js').Combo} Combo\n */\nimport { getComboStepTarget, getComboStepWeight } from \"@/lib/combos/steps\";\n\n/** @type {Map<string, number>} Persistent round-robin counters per combo */\nconst roundRobinCounters = new Map();\n\n/**\n * Resolve which model to use from a combo based on its strategy.\n *\n * @param {Combo} combo - The combo configuration\n * @param {{ modelUsageCounts?: Record<string, number> }} [context] - Optional context\n * @returns {{ model: string, index: number }}\n * @throws {Error} If combo has no models\n */\nexport function resolveComboModel(combo: any, context: any = {}) {\n  const models = combo.models || [];\n  if (models.length === 0) {\n    throw new Error(`Combo \"${combo.name}\" has no models configured`);\n  }\n\n  // Normalize models to { model, weight } format\n  const normalized = models\n    .map((entry) => ({\n      model: getComboStepTarget(entry) || \"\",\n      weight: getComboStepWeight(entry) || 1,\n    }))\n    .filter((entry) => entry.model);\n\n  const strategy = combo.strategy || \"priority\";\n\n  switch (strategy) {\n    case \"priority\":\n      return { model: normalized[0].model, index: 0 };\n\n    case \"round-robin\": {\n      // Persistent counter per combo for deterministic round-robin","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/domain/comboResolver.ts#L12-L48","documentation":"Error \"Combo \"${combo.name}\" has no models configured\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/domain/comboResolver.ts:30 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}