{"record":{"id":"f1e131666b93661e","repo":"ruvnet/ruflo","slug":"arch-router-returned-error","errorCode":null,"errorMessage":"[arch] router returned error","messagePattern":"\\[arch\\] router returned error","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ruflo/src/ruvocal/src/lib/server/router/arch.ts","lineNumber":196,"sourceCode":"\t\t});\n\t\tclearTimeout(to);\n\t\tif (!resp.ok) {\n\t\t\t// Extract error message from response\n\t\t\tlet errorMessage = `arch-router ${resp.status}`;\n\t\t\ttry {\n\t\t\t\tconst errorData = await resp.json();\n\t\t\t\t// Try to extract message from OpenAI-style error format\n\t\t\t\tif (errorData.error?.message) {\n\t\t\t\t\terrorMessage = errorData.error.message;\n\t\t\t\t} else if (errorData.message) {\n\t\t\t\t\terrorMessage = errorData.message;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// If JSON parsing fails, use status text\n\t\t\t\terrorMessage = resp.statusText || errorMessage;\n\t\t\t}\n\n\t\t\tlogger.warn(\n\t\t\t\t{ status: resp.status, error: errorMessage, traceId },\n\t\t\t\t\"[arch] router returned error\"\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\trouteName: \"arch_router_failure\",\n\t\t\t\terror: {\n\t\t\t\t\tmessage: errorMessage,\n\t\t\t\t\tstatusCode: resp.status,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\tconst data: { choices: { message: { content: string } }[] } = await resp.json();\n\t\tconst text = (data?.choices?.[0]?.message?.content ?? \"\").toString().trim();\n\t\tconst raw = parseRouteName(text);\n\n\t\tconst other = config.LLM_ROUTER_OTHER_ROUTE || \"casual_conversation\";\n\t\tconst chosen = raw === \"other\" ? other : raw || \"casual_conversation\";","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/ruflo/src/ruvocal/src/lib/server/router/arch.ts#L178-L214","documentation":"Log warning in archSelectRoute: the arch router HTTP call returned a non-OK status; the message (OpenAI-style error body if present, otherwise status text) is extracted so routing can degrade to the failure/fallback route.","triggerScenarios":"Thrown at ruflo/src/ruvocal/src/lib/server/router/arch.ts:196 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-14T00:17:10.932Z"}