{"record":{"id":"9a389b24c0da5e89","repo":"mastra-ai/mastra","slug":"processor-does-not-support-outputresult-phase","errorCode":null,"errorMessage":"Processor does not support outputResult phase","messagePattern":"Processor does not support outputResult phase","errorType":"validation","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"packages/server/src/server/handlers/processors.ts","lineNumber":438,"sourceCode":"            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,\n              tools: {},\n              toolChoice: undefined,\n              activeTools: [],\n              providerOptions: undefined,\n              modelSettings: undefined,\n              structuredOutput: undefined,\n            });\n            break;\n\n          case 'outputResult':\n            if (!processor.processOutputResult) {\n              throw new HTTPException(400, { message: 'Processor does not support outputResult phase' });\n            }\n            result = await processor.processOutputResult({\n              ...baseContext,\n              state: {},\n              result: {\n                text: extractTextFromMessages(messages),\n                usage: { inputTokens: 0, outputTokens: 0, totalTokens: 0 },\n                finishReason: 'unknown',\n                steps: [],\n              },\n            });\n            break;\n\n          case 'outputStep':\n            if (!processor.processOutputStep) {\n              throw new HTTPException(400, { message: 'Processor does not support outputStep phase' });\n            }\n            result = await processor.processOutputStep({","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/processors.ts#L420-L456","documentation":"For phase 'outputResult' the handler requires the processor to implement processOutputResult (the hook run once on the final model result). If it does not, the server throws HTTP 400. This is a capability check before invocation.","triggerScenarios":"POSTing phase='outputResult' to the processor execute endpoint for a processor class lacking processOutputResult (e.g. input-only processors).","commonSituations":"Validating final-output transformations on an input-side processor; test harnesses that run the full phase matrix; processors copied from templates implementing only some hooks.","solutions":["Use a phase the processor implements (inspect the class methods).","Implement processOutputResult on the processor.","Update client code to skip phases the processor does not advertise."],"exampleFix":"// before\nawait executeProcessor(id, 'outputResult', { messages });\n// after\nconst supported = Object.getOwnPropertyNames(Object.getPrototypeOf(processor));\nif (!supported.includes('processOutputResult')) return;\nawait executeProcessor(id, 'outputResult', { messages });","handlingStrategy":"type-guard","validationCode":"const canRun = ['processInput','processInputStep','processOutput','processOutputStep','processOutputResult'].filter(m => typeof (processorRef as any)[m] === 'function');\nif (!canRun.includes('processOutputResult')) skip('outputResult');","typeGuard":"function supportsOutputResult(p: any): p is { processOutputResult: Function } {\n  return typeof p?.processOutputResult === 'function';\n}","tryCatchPattern":"try {\n  return await exec(id, 'outputResult', ctx);\n} catch (e) {\n  if (e instanceof HTTPException && e.status === 400 && e.message.includes('outputResult')) {\n    return exec(id, 'output', ctx);\n  }\n  throw e;\n}","preventionTips":["Match the phase to the processor category (input vs output vs result) from the class definition.","Prefer 'output' as the generic default when unsure which output hooks exist.","Regenerate phase lists from the OpenAPI/schema rather than hardcoding."],"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"}