{"record":{"id":"56fa6e77c3a7ff71","repo":"Mintplex-Labs/anything-llm","slug":"description-is-required-for-llm-rules-describe-wh","errorCode":null,"errorMessage":"Description is required for LLM rules. Describe when this rule should match.","messagePattern":"Description is required for LLM rules\\. Describe when this rule should match\\.","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/endpoints/modelRouter.js","lineNumber":126,"sourceCode":"      }\n    }\n  );\n\n  app.post(\n    \"/model-routers/:id/rules/new\",\n    [validatedRequest, flexUserRoleValid([ROLES.admin])],\n    async (request, response) => {\n      try {\n        const { id } = request.params;\n        const user = await userFromSession(request, response);\n        const data = reqBody(request);\n        const routerId = Number(id);\n        const { rule, error } = await ModelRouterRule.create(\n          routerId,\n          data,\n          user?.id || null\n        );\n        if (error) return response.status(400).json({ rule, error });\n\n        await Telemetry.sendTelemetry(\"model_router_rule_created\");\n        ModelRouterService.invalidateRouter(routerId);\n        return response.status(200).json({ rule });\n      } catch (e) {\n        console.error(e);\n        response.sendStatus(500);\n      }\n    }\n  );\n\n  app.put(\n    \"/model-routers/:id/rules/reorder\",\n    [validatedRequest, flexUserRoleValid([ROLES.admin])],\n    async (request, response) => {\n      try {\n        const { id } = request.params;\n        const { ruleUpdates } = reqBody(request);","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/endpoints/modelRouter.js#L108-L144","documentation":"Validation error propagated from ModelRouterRule.create: an LLM-type rule was submitted without a description; since LLM rules rely on a natural-language description of when they should match, it is mandatory and creation is refused.","triggerScenarios":"Thrown at server/endpoints/modelRouter.js:126 when the library encounters an invalid state.","commonSituations":"Creating an LLM-type routing rule without the required description.","solutions":["Add a description explaining when this LLM rule should match.","Make the description specific so the router LLM can classify correctly."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}