{"record":{"id":"997654ff62f94cee","repo":"mastra-ai/mastra","slug":"invalid-signal-type-input-type-use-a-supporte","errorCode":null,"errorMessage":"Invalid signal type: ${input.type}. Use a supported signal type and set tagName for custom XML tags.","messagePattern":"Invalid signal type: (.+?)\\. Use a supported signal type and set tagName for custom XML tags\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/agent/signals.ts","lineNumber":202,"sourceCode":"  tagName: AgentSignalTagName;\n} {\n  if (input.type === 'user-message') {\n    return { type: 'user', tagName: input.tagName ?? 'user' };\n  }\n\n  if (input.type === 'system-reminder') {\n    return { type: 'reactive', tagName: input.tagName ?? 'system-reminder' };\n  }\n\n  if (input.type === 'user' || input.type === 'state' || input.type === 'notification') {\n    return { type: input.type, tagName: input.tagName ?? input.type };\n  }\n\n  if (input.type === 'reactive') {\n    return { type: 'reactive', tagName: input.tagName ?? 'system-reminder' };\n  }\n\n  throw new Error(\n    `Invalid signal type: ${input.type}. Use a supported signal type and set tagName for custom XML tags.`,\n  );\n}\n\nfunction normalizeSignal(signal: AgentSignalInput | CreatedAgentSignal) {\n  const { type, tagName } = normalizeSignalType(signal);\n  return {\n    ...signal,\n    type,\n    tagName,\n    id: signal.id ?? crypto.randomUUID(),\n    createdAt:\n      signal.createdAt instanceof Date ? signal.createdAt : signal.createdAt ? new Date(signal.createdAt) : new Date(),\n    acceptedAt:\n      signal.acceptedAt instanceof Date\n        ? signal.acceptedAt\n        : signal.acceptedAt\n          ? new Date(signal.acceptedAt)","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/agent/signals.ts#L184-L220","documentation":"Agent signals (system-reminder style injections) support a limited set of `type` values, e.g. 'reactive' and 'state' plus a custom-XML-tag type. normalizeSignalType validates the input type before building the signal; an unrecognized type string throws this error. Custom tags must supply a `tagName` since the type alone doesn't map to one.","triggerScenarios":"Calling createSignal()/createAgentSignal with `type` set to something other than the supported values (e.g. 'custom', 'note', a typo like 'reacttive'), or relying on a custom tag type without setting `tagName`.","commonSituations":"Migrating from an older signal API with different type names; typos in signal type literals; constructing signal objects from user/config input without validating the type; passing a UI data-part type that isn't a recognized signal type.","solutions":["Set `type` to a supported value, e.g. `createSignal({ type: 'reactive', contents: ... })` for reactive signals.","For a custom XML-tag signal, provide `tagName` explicitly: `createSignal({ type: 'custom', tagName: 'my-tag', contents: ... })` (verify the exact custom type name in signals.ts).","Validate signal types coming from config/user input before calling createSignal.","Check the AgentSignalInput type union for the exact accepted literals and keep your code in sync after upgrades."],"exampleFix":"// before\ncreateSignal({ type: 'note', contents: 'hello' });\n// after\ncreateSignal({ type: 'reactive', contents: 'hello' }); // or use the custom-tag type with tagName","handlingStrategy":"validation","validationCode":"const SIGNAL_TYPES = ['reactive', 'state', 'custom'] as const; // check signals.ts for exact union\nif (!SIGNAL_TYPES.includes(input.type)) {\n  throw new TypeError(`signal type must be one of ${SIGNAL_TYPES.join(', ')}`);\n}","typeGuard":"function isValidSignalType(t: string): boolean {\n  return ['reactive', 'state', 'custom'].includes(t);\n}","tryCatchPattern":"try {\n  const signal = createSignal(input);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Invalid signal type')) {\n    signal = createSignal({ ...input, type: 'reactive' });\n  } else throw e;\n}","preventionTips":["Use the AgentSignalInput type so invalid literals fail typecheck","Never pass unvalidated user/config strings as signal type","Add unit tests covering each supported signal type"],"tags":["signals","invalid-argument","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}