{"record":{"id":"c23477a16b2f818a","repo":"mastra-ai/mastra","slug":"agent-input-step-processor-error","errorCode":"AGENT_INPUT_STEP_PROCESSOR_ERROR","errorMessage":"[Agent:${this.name}] - Input step processor error","messagePattern":"\\[Agent:(.+?)\\] - Input step processor error","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/agent/agent.ts","lineNumber":4443,"sourceCode":"\n          nextTools = convertedTools;\n        }\n      } catch (error) {\n        if (error instanceof TripWire) {\n          tripwire = {\n            reason: error.message,\n            retry: error.options?.retry,\n            metadata: error.options?.metadata,\n            processorId: error.processorId,\n          };\n          this.logger.warn('Input step processor tripwire triggered', {\n            agent: this.name,\n            reason: error.message,\n            processorId: error.processorId,\n            retry: error.options?.retry,\n          });\n        } else {\n          throw new MastraError(\n            {\n              id: 'AGENT_INPUT_STEP_PROCESSOR_ERROR',\n              domain: ErrorDomain.AGENT,\n              category: ErrorCategory.USER,\n              text: `[Agent:${this.name}] - Input step processor error`,\n            },\n            error,\n          );\n        }\n      }\n    }\n\n    return {\n      messageList,\n      tools: nextTools,\n      tripwire,\n    };\n  }","sourceCodeStart":4425,"sourceCodeEnd":4461,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/agent/agent.ts#L4425-L4461","documentation":"A MastraError (id AGENT_INPUT_STEP_PROCESSOR_ERROR, category USER) thrown when an input *step* processor fails while processing the agent's input step (workflow-style input processing). Like the plain input-processor error, it wraps the underlying processor error with the agent name, processorId, and retry metadata.","triggerScenarios":"Calling `agent.generate()`/`stream()` with multi-step input processors configured, where one step processor throws instead of returning a result; non-recoverable failure after any configured retry was exhausted.","commonSituations":"Step processors performing DB lookups, auth checks, or enrichment that fail at runtime; steps that assume prior step output exists but it was filtered out; version drift where a step returns an unexpected shape and downstream code throws.","solutions":["Inspect `details.processorId` to identify the failing step processor and fix its implementation","Make the step tolerate missing/empty prior-step output (validate before operating)","Configure retry options on the processor if the failure is transient (network flake)","Temporarily remove the step processor to confirm it is the source, then reinstate with guards"],"exampleFix":"// before\nconst step = { process: async ({ data }) => enrich(await db.find(data.id)) };\n// after\nconst step = { process: async ({ data }) => {\n  if (!data?.id) return { data };\n  const rec = await db.find(data.id);\n  return rec ? { data: enrich(rec) } : { data };\n} };","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function isInputStepProcessorError(e) {\n  return e instanceof Error && 'id' in e && e.id === 'AGENT_INPUT_STEP_PROCESSOR_ERROR';\n}","tryCatchPattern":"try {\n  await agent.stream(prompt, opts);\n} catch (e) {\n  if (e?.id === 'AGENT_INPUT_STEP_PROCESSOR_ERROR') {\n    logger.error(`step ${e.details.processorId} failed: ${e.details.reason}`, { retry: e.details.retry });\n    return degradedResponse();\n  }\n  throw e;\n}","preventionTips":["Validate prior-step output shape at the start of each step processor","Configure retry options for transient failures in step processors","Make every step return a well-defined no-op result when inputs are missing","Integration-test the full processor chain, not each step in isolation"],"tags":["agent","step-processor","user-code","mastra-error"],"backgroundTag":"custom-processor-threw","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}