{"record":{"id":"0a744d7b91364dfb","repo":"TencentCloud/TencentDB-Agent-Memory","slug":"module-mod-module-must-have-a-description","errorCode":null,"errorMessage":"Module '${mod.module}' must have a description","messagePattern":"Module '(.+?)' must have a description","errorType":"validation","errorClass":"ParamRegistryError","httpStatus":null,"severity":"error","filePath":"MemoryCore/src/metadata/config/param-registry.ts","lineNumber":97,"sourceCode":"  const registry: ConfigParamRegistry = new Map();\n  const seenModules = new Set<string>();\n\n  for (const mod of data.modules) {\n    if (!mod.module || typeof mod.module !== \"string\") {\n      throw new ParamRegistryError(\"Each module entry must have a 'module' string field\");\n    }\n    if (!MODULE_RE.test(mod.module)) {\n      throw new ParamRegistryError(\n        `Invalid module name '${mod.module}': must match ${MODULE_RE}`,\n      );\n    }\n    if (seenModules.has(mod.module)) {\n      throw new ParamRegistryError(`Duplicate module '${mod.module}'`);\n    }\n    seenModules.add(mod.module);\n\n    if (!mod.description) {\n      throw new ParamRegistryError(`Module '${mod.module}' must have a description`);\n    }\n    if (!Array.isArray(mod.params) || mod.params.length === 0) {\n      throw new ParamRegistryError(`Module '${mod.module}' must have at least one param`);\n    }\n\n    const seenParams = new Set<string>();\n    for (const param of mod.params) {\n      if (!param.param_name || typeof param.param_name !== \"string\") {\n        throw new ParamRegistryError(\n          `Module '${mod.module}': each param must have a 'param_name' string`,\n        );\n      }\n      if (!PARAM_NAME_RE.test(param.param_name)) {\n        throw new ParamRegistryError(\n          `Module '${mod.module}': invalid param_name '${param.param_name}': must match ${PARAM_NAME_RE}`,\n        );\n      }\n      if (seenParams.has(param.param_name)) {","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/3efcd317b84146d6a08518ac0f7ee7c8a8d200ec/MemoryCore/src/metadata/config/param-registry.ts#L79-L115","documentation":"Every module entry in the registry must carry a non-empty 'description'. buildRegistry throws this error when mod.description is missing, null, or an empty string. The description is used for documentation and introspection of the parameter registry.","triggerScenarios":"A data.modules[i] entry has no description field, description is empty (\"\"), or it is null/undefined when loadParamRegistry builds the registry.","commonSituations":"Hand-writing a new module block and forgetting the description field; a migration script that copies entries but drops unknown fields; JSON with \"description\": \"\" after a careless edit.","solutions":["Add a meaningful description string to the module entry in the registry file","If a tool generated the entry, re-run it with description output enabled or fill it in manually","Validate the registry file against a JSON schema requiring a non-empty description before loading"],"exampleFix":"// before\n{ \"module\": \"cache\", \"params\": [ ... ] }\n// after\n{ \"module\": \"cache\", \"description\": \"Tunable cache parameters (size, TTL)\", \"params\": [ ... ] }","handlingStrategy":"validation","validationCode":"for (const m of data.modules) {\n  if (typeof m.description !== 'string' || m.description.trim() === '') {\n    throw new Error(`module ${m.module} is missing a description`);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  const registry = await loadParamRegistry();\n} catch (e) {\n  if (e instanceof ParamRegistryError && e.message.includes('must have a description')) {\n    console.error('Add a description to the module named in the error');\n  } else throw e;\n}","preventionTips":["Treat description as a required field in every template/snippet for module entries","Validate the registry against a JSON schema (required: [module, description, params])","Never leave description as empty string in edits"],"tags":["configuration","validation","missing-field"],"backgroundTag":"missing-required-argument","analyzedSha":"3efcd317b84146d6a08518ac0f7ee7c8a8d200ec","analyzedAt":"2026-09-01T05:44:22.276Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}