{"record":{"id":"c5fd975d6789f332","repo":"mastra-ai/mastra","slug":"unknown-subconscious-observation-agent-name","errorCode":null,"errorMessage":"Unknown Subconscious observation agent: ${name}","messagePattern":"Unknown Subconscious observation agent: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/memory/src/processors/observational-memory/subconscious/index.ts","lineNumber":195,"sourceCode":"        extractors.push(\n          new Extractor({\n            name: custom.name,\n            instructions: custom.instructions?.trim() || `Extract ${custom.name} from the current observations.`,\n            schema: custom.schema,\n            metadataKeyPath: false,\n            includePreviousExtraction: false,\n            onExtracted: custom.onExtracted,\n          }),\n        );\n      }\n    }\n    return extractors;\n  }\n\n  #validateObservationEntry(entry: SubconsciousObservationEntry): void {\n    const name = entryName(entry);\n    if (typeof entry === 'string') {\n      if (!BUILT_IN_OBSERVATION.has(name)) throw new Error(`Unknown Subconscious observation agent: ${name}`);\n      return;\n    }\n    if (BUILT_IN_OBSERVATION.has(name)) {\n      if (name === 'capture') {\n        if ('model' in entry || 'maxSteps' in entry) {\n          throw new Error('Subconscious capture shares the Observer model and does not accept model or maxSteps.');\n        }\n        if (\n          'schema' in entry &&\n          entry.schema &&\n          (!('onExtracted' in entry) || typeof entry.onExtracted !== 'function')\n        ) {\n          throw new Error('A custom capture schema requires an onExtracted hook that handles its output.');\n        }\n      }\n      return;\n    }\n    if ('model' in entry || 'maxSteps' in entry) {","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/memory/src/processors/observational-memory/subconscious/index.ts#L177-L213","documentation":"The Subconscious processor accepts observation entries either as built-in agent names (strings) or custom extractor objects. When a plain string is given, it must be one of the known built-in observation agent names tracked in BUILT_IN_OBSERVATION; otherwise the constructor throws immediately during validation. This fails fast on configuration mistakes rather than at runtime.","triggerScenarios":"Passing new Subconscious({...observation: ['captre']...}) or any string entry in the observation array that is not in BUILT_IN_OBSERVATION. Thrown synchronously from #validateObservationEntry during construction.","commonSituations":"Typo in a built-in agent name; copying a reflection-agent name into the observation list; upgrading/downgrading the library where the set of built-in names changed; assuming arbitrary custom names are allowed as strings instead of objects.","solutions":["Check the allowed built-in observation names in BUILT_IN_OBSERVATION (constants/types in packages/memory/src/processors/observational-memory/subconscious) and correct the spelling.","If you want a custom extractor, pass an object with schema and onExtracted instead of a bare string.","Pin/align the @mastra/memory version so documented built-in names match the installed code."],"exampleFix":"// before\nnew Subconscious({ observation: ['summarizer'] });\n// after\nnew Subconscious({ observation: ['capture'] }); // valid built-in, or an object entry\nnew Subconscious({ observation: [{ name: 'summarizer', schema: MySchema, onExtracted: async (r) => r }]);","handlingStrategy":"validation","validationCode":"import { BUILT_IN_OBSERVATION } from './subconscious/constants';\nconst observation = ['capture'];\nconst invalid = observation.filter(o => typeof o === 'string' && !BUILT_IN_OBSERVATION.has(o));\nif (invalid.length) throw new Error(`Unknown observation agents: ${invalid.join(', ')}`);","typeGuard":"function isBuiltInObservation(name: string): boolean {\n  return BUILT_IN_OBSERVATION.has(name);\n}","tryCatchPattern":"try {\n  const sub = new Subconscious({ observation: names });\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Unknown Subconscious observation agent')) {\n    console.error(`Config typo in observation entry: ${e.message}`);\n  } else throw e;\n}","preventionTips":["Use the exported union type for observation entry names so typos fail at compile time.","Keep observation/reflection name lists in one typed constant in your app config.","Add a unit test that constructs Subconscious with your production config.","Re-validate names after upgrading @mastra/memory versions."],"tags":["configuration","validation","observational-memory"],"backgroundTag":"invalid-configuration-value","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}