{"record":{"id":"713a6512fe364081","repo":"mastra-ai/mastra","slug":"processor-does-not-support-outputstep-phase","errorCode":null,"errorMessage":"Processor does not support outputStep phase","messagePattern":"Processor does not support outputStep phase","errorType":"validation","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"packages/server/src/server/handlers/processors.ts","lineNumber":454,"sourceCode":"          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({\n              ...baseContext,\n              systemMessages: [],\n              stepNumber: 0,\n              steps: [],\n              finishReason: 'stop',\n              toolCalls: [],\n              text: extractTextFromMessages(messages),\n              usage: { inputTokens: undefined, outputTokens: undefined, totalTokens: undefined },\n            });\n            break;\n\n          case 'outputStream':\n            // outputStream is for streaming chunks, not a simple execute\n            throw new HTTPException(400, {\n              message: 'outputStream phase cannot be executed directly. Use streaming instead.',\n            });","sourceCodeStart":436,"sourceCodeEnd":472,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/processors.ts#L436-L472","documentation":"For phase 'outputStep' the handler checks that the processor implements processOutputStep (per-step output hook). Missing implementation results in HTTP 400. Like inputStep, this hook only exists on processors designed for the agentic loop.","triggerScenarios":"Executing phase='outputStep' against a processor whose class has no processOutputStep method via the server's processor execute handler.","commonSituations":"Testing streaming/step processors generically; older processors written before outputStep was introduced; UIs that list all phases uniformly.","solutions":["Execute an implemented phase instead (e.g. 'output').","Add processOutputStep to the processor class.","Filter available phases per processor in the calling tool."],"exampleFix":"// before\nexecuteProcessor(id, 'outputStep', stepContext);\n// after\nif ('processOutputStep' in processor) {\n  executeProcessor(id, 'outputStep', stepContext);\n} else {\n  executeProcessor(id, 'output', stepContext);\n}","handlingStrategy":"type-guard","validationCode":"if (phase === 'outputStep' && !('processOutputStep' in processorRef)) {\n  return res.status(400).json({ message: 'Processor lacks outputStep support' });\n}","typeGuard":"function supportsOutputStep(p: any): p is { processOutputStep: Function } {\n  return typeof p?.processOutputStep === 'function';\n}","tryCatchPattern":"try {\n  await exec(id, 'outputStep', ctx);\n} catch (e) {\n  if (e instanceof HTTPException && e.status === 400 && e.message.includes('outputStep')) {\n    return; // degrade gracefully: this processor simply has no per-step output hook\n  }\n  throw e;\n}","preventionTips":["Treat outputStep/outputStep hooks as opt-in capabilities, not guaranteed API surface.","When migrating processors across Mastra versions, re-verify implemented hooks.","Write tests enumerating supported phases per custom processor."],"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"}