{"record":{"id":"a89a42f670aec773","repo":"TencentCloud/TencentDB-Agent-Memory","slug":"module-mod-module-each-param-must-have-a-pa","errorCode":null,"errorMessage":"Module '${mod.module}': each param must have a 'param_name' string","messagePattern":"Module '(.+?)': each param must have a 'param_name' string","errorType":"validation","errorClass":"ParamRegistryError","httpStatus":null,"severity":"error","filePath":"MemoryCore/src/metadata/config/param-registry.ts","lineNumber":106,"sourceCode":"        `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)) {\n        throw new ParamRegistryError(\n          `Module '${mod.module}': duplicate param_name '${param.param_name}'`,\n        );\n      }\n      seenParams.add(param.param_name);\n\n      if (param.param_value === undefined || param.param_value === null) {\n        throw new ParamRegistryError(\n          `Module '${mod.module}', param '${param.param_name}': param_value is required`,","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/3efcd317b84146d6a08518ac0f7ee7c8a8d200ec/MemoryCore/src/metadata/config/param-registry.ts#L88-L124","documentation":"Each param object inside a module must have a 'param_name' that is a non-empty string. buildRegistry throws this when param.param_name is missing, empty, or not a string. Parameter names are the registry's lookup keys, so they must be well-formed before anything else is validated.","triggerScenarios":"A param object in data.modules[i].params lacks param_name, has param_name: \"\", or param_name of a non-string type (number, object, etc.) during loadParamRegistry.","commonSituations":"Hand-authored JSON with the key misspelled (\"name\" instead of \"param_name\"); numeric IDs pasted without quotes; deserialized data where a field got renamed upstream.","solutions":["Add a string param_name to every param object in the module","Fix misspelled keys so the field is exactly param_name","Quote numeric/identifier values so param_name is a JSON string","Run a pre-load lint that asserts typeof p.param_name === 'string' for all params"],"exampleFix":"// before\n{ \"param_value\": 10, \"description\": \"...\" }\n// after\n{ \"param_name\": \"max_entries\", \"param_value\": 10, \"description\": \"...\" }","handlingStrategy":"validation","validationCode":"for (const m of data.modules) {\n  for (const p of m.params ?? []) {\n    if (typeof p.param_name !== 'string' || p.param_name === '') {\n      throw new Error(`param in ${m.module} missing string param_name`);\n    }\n  }\n}","typeGuard":"function hasParamName(p) {\n  return typeof p?.param_name === 'string' && p.param_name.length > 0;\n}","tryCatchPattern":"try {\n  const registry = await loadParamRegistry();\n} catch (e) {\n  if (e instanceof ParamRegistryError && e.message.includes(\"must have a 'param_name' string\")) {\n    console.error('Add a string param_name to each param in the named module');\n  } else throw e;\n}","preventionTips":["Use the exact key param_name; avoid shorthand like name","Quote identifier values in JSON so they stay strings","Lint registry files for required param keys before loading"],"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"}