{"record":{"id":"39a160c3c5ebe921","repo":"ruvnet/ruflo","slug":"router-failed-to-load-models-for-tools-lookup","errorCode":null,"errorMessage":"[router] failed to load models for tools lookup","messagePattern":"\\[router\\] failed to load models for tools lookup","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ruflo/src/ruvocal/src/lib/server/router/endpoint.ts","lineNumber":222,"sourceCode":"\t\t\t\tlogger.error(\n\t\t\t\t\t{\n\t\t\t\t\t\troute: ROUTER_MULTIMODAL_ROUTE,\n\t\t\t\t\t\tmodel: multimodalCandidate,\n\t\t\t\t\t\terr: message,\n\t\t\t\t\t\t...(statusCode && { status: statusCode }),\n\t\t\t\t\t},\n\t\t\t\t\t\"[router] multimodal fallback failed\"\n\t\t\t\t);\n\t\t\t\tthrow statusCode ? new HTTPError(message, statusCode) : new Error(message);\n\t\t\t}\n\t\t}\n\n\t\tasync function findToolsCandidateModel(): Promise<ProcessedModel | undefined> {\n\t\t\ttry {\n\t\t\t\tconst all = await getModels();\n\t\t\t\treturn pickToolsCapableModel(all);\n\t\t\t} catch (e) {\n\t\t\t\tlogger.warn({ err: String(e) }, \"[router] failed to load models for tools lookup\");\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\n\t\tif (routerToolsEnabled && hasToolsActive) {\n\t\t\tconst toolsModel = await findToolsCandidateModel();\n\t\t\tconst toolsCandidate = toolsModel?.id ?? toolsModel?.name;\n\t\t\tif (!toolsCandidate) {\n\t\t\t\t// No tool-capable model found — continue with normal routing instead of hard failing\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tlogger.info(\n\t\t\t\t\t\t{ route: ROUTER_TOOLS_ROUTE, model: toolsCandidate },\n\t\t\t\t\t\t\"[router] tools active; bypassing Arch selection\"\n\t\t\t\t\t);\n\t\t\t\t\tconst ep = await createCandidateEndpoint(toolsCandidate);\n\t\t\t\t\tconst gen = await ep({ ...params });\n\t\t\t\t\treturn metadataThenStream(gen, toolsCandidate, ROUTER_TOOLS_ROUTE);","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/ruflo/src/ruvocal/src/lib/server/router/endpoint.ts#L204-L240","documentation":"Log warning in findToolsCandidateModel: getModels() threw while trying to pick a tools-capable model, so the tools lookup returns undefined and routing falls back to Arch selection.","triggerScenarios":"Thrown at ruflo/src/ruvocal/src/lib/server/router/endpoint.ts:222 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the router's upstream model catalog is reachable and loaded; retry after the model list loads successfully.","Inspect router logs for the underlying selection error and fix the failing candidate/endpoint."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}