{"record":{"id":"6f24572b6b2e57c8","repo":"mastra-ai/mastra","slug":"processor-does-not-support-input-phase","errorCode":null,"errorMessage":"Processor does not support input phase","messagePattern":"Processor does not support input phase","errorType":"validation","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"packages/server/src/server/handlers/processors.ts","lineNumber":408,"sourceCode":"      };\n\n      // Build the context based on phase\n      const baseContext = {\n        abort,\n        retryCount: 0,\n        messages: messageList.get.all.db(),\n        messageList,\n        state: {},\n      };\n\n      try {\n        let result: any;\n\n        // Execute the specific phase method on the individual processor\n        switch (phase) {\n          case 'input':\n            if (!processor.processInput) {\n              throw new HTTPException(400, { message: 'Processor does not support input phase' });\n            }\n            result = await processor.processInput({\n              ...baseContext,\n              systemMessages: [],\n            });\n            break;\n\n          case 'inputStep':\n            if (!processor.processInputStep) {\n              throw new HTTPException(400, { message: 'Processor does not support inputStep phase' });\n            }\n            result = await processor.processInputStep({\n              ...baseContext,\n              systemMessages: [],\n              stepNumber: 0,\n              steps: [],\n              // Pass empty/default values for all inputStep fields\n              model: '' as any,","sourceCodeStart":390,"sourceCodeEnd":426,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/processors.ts#L390-L426","documentation":"The processor test/exec endpoint dispatches to a phase method on the target processor. When the requested phase is 'input' but the processor class does not implement processInput, the server rejects with HTTP 400 instead of calling an undefined method. It signals a phase/processor capability mismatch, not a runtime failure inside the processor.","triggerScenarios":"POST to the processor execute endpoint with body/query phase='input' for a registered processor whose class lacks a processInput method (e.g. an output-only processor like a OutputProcessor subclass).","commonSituations":"Developers testing an output-only processor against the input phase from the playground; generic tooling that iterates all phases for every processor; processors migrated from older APIs where a single method handled all phases.","solutions":["Request a phase the processor actually implements; check the processor class for processInput/processInputStep/processOutput/processOutputStep/processOutputResult.","Implement processInput on the processor if input-phase behavior is intended.","Update the calling UI/tool to introspect supported phases before invoking the execute endpoint."],"exampleFix":"// before\nawait fetch(`/api/processors/${id}/execute`, { method: 'POST', body: JSON.stringify({ phase: 'input', messages }) });\n// after\nconst phases = processorSupportsInput(id) ? ['input'] : ['output'];\nawait fetch(`/api/processors/${id}/execute`, { method: 'POST', body: JSON.stringify({ phase: phases[0], messages }) });","handlingStrategy":"validation","validationCode":"const INPUT_PHASE_PROCS = new Set(['MyInputProc']); // or introspect class methods\nif (!INPUT_PHASE_PROCS.has(processorName)) throw new Error(`${processorName} does not implement processInput`);","typeGuard":"function supportsInput(p: any): p is { processInput: Function } {\n  return typeof p?.processInput === 'function';\n}","tryCatchPattern":"try {\n  await exec(id, 'input', ctx);\n} catch (e) {\n  if (e instanceof HTTPException && e.status === 400 && /does not support input phase/.test(e.message)) {\n    return exec(id, 'output', ctx); // fall back to an implemented phase\n  }\n  throw e;\n}","preventionTips":["Derive the phase selector UI from the processor's implemented methods, not a static list.","Check Mastra processor docs for which lifecycle hooks your processor class implements.","Cover phase capability in unit tests for custom processors."],"tags":["http-400","processors","phase-not-supported"],"backgroundTag":"processor-phase-not-supported","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}