{"record":{"id":"3b498c24d8aa4d7a","repo":"mastra-ai/mastra","slug":"aisdkv5-chunk-type-redacted-reasoning-not-suppor","errorCode":null,"errorMessage":"AISDKv5 chunk type \"redacted-reasoning\" not supported","messagePattern":"AISDKv5 chunk type \"redacted-reasoning\" not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/stream/aisdk/v5/transform.ts","lineNumber":476,"sourceCode":"      };\n    }\n    case 'reasoning-start':\n      return {\n        type: 'reasoning-start',\n        id: chunk.payload.id,\n        providerMetadata: chunk.payload.providerMetadata,\n      };\n    case 'reasoning-delta':\n      return {\n        type: 'reasoning-delta',\n        id: chunk.payload.id,\n        text: chunk.payload.text,\n        providerMetadata: chunk.payload.providerMetadata,\n      };\n    case 'reasoning-signature':\n      throw new Error('AISDKv5 chunk type \"reasoning-signature\" not supported');\n    case 'redacted-reasoning':\n      throw new Error('AISDKv5 chunk type \"redacted-reasoning\" not supported');\n\n    case 'reasoning-end':\n      return {\n        type: 'reasoning-end',\n        id: chunk.payload.id,\n        providerMetadata: chunk.payload.providerMetadata,\n      };\n    case 'source':\n      if (chunk.payload.sourceType === 'url') {\n        return {\n          type: 'source',\n          sourceType: 'url',\n          id: chunk.payload.id,\n          url: chunk.payload.url!,\n          title: chunk.payload.title,\n          providerMetadata: chunk.payload.providerMetadata,\n        };\n      } else {","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/stream/aisdk/v5/transform.ts#L458-L494","documentation":"The AISDKv5 stream transformer converts Mastra internal stream chunks into AI SDK v5 UI-message stream parts. The 'redacted-reasoning' chunk type (a provider-emitted placeholder for reasoning content the provider withheld, e.g. OpenAI o-series encrypted reasoning) has no equivalent representation in the v5 mapping, so the transformer throws rather than emitting a malformed or silently dropped part. It is thrown synchronously from convertMastraChunkToAISDKv5 while the stream is being consumed.","triggerScenarios":"Streaming a model response through the AISDK v5 transform when the provider emits a 'redacted-reasoning' chunk into the Mastra stream — i.e. consuming the agent/network stream via the toAISDKv5-style conversion path with a reasoning model that redacts its chain-of-thought.","commonSituations":"Using OpenAI o-series/gpt-5 style models (or other providers that redact reasoning) with a UI that consumes AI SDK v5 stream parts; upgrading providers or models so redacted reasoning chunks start appearing in a stream that previously worked.","solutions":["Use a provider/model that does not emit redacted reasoning chunks, or disable sending reasoning/encrypted reasoning in the provider options (e.g. set reasoning effort/summary options so redaction items are not returned).","Filter out 'reasoning-signature' and 'redacted-reasoning' chunks from the Mastra stream before piping it into the v5 transformer (e.g. a TransformStream that drops those chunk types).","Catch the error at the consumer and fall back to non-streaming (generate) output for reasoning models, where redacted reasoning does not surface as a stream chunk.","Upgrade @mastra/core — support for mapping these chunk types may have been added in a newer version."],"exampleFix":"// before: piping raw mastra stream into AI SDK v5 transform\nresult.toAISDKv5Stream().pipeTo(uiStream);\n\n// after: drop unsupported chunk types first\nconst filtered = result.fullStream.pipeThrough(new TransformStream({\n  transform(chunk, controller) {\n    if (chunk.type !== 'redacted-reasoning' && chunk.type !== 'reasoning-signature') {\n      controller.enqueue(chunk);\n    }\n  }\n}));","handlingStrategy":"try-catch","validationCode":"// Inspect the stream for chunk types the v5 transform cannot map before consuming\nconst hasUnsupported = false;\nconst reader = result.fullStream.getReader();\n// alternatively, filter:\nconst safe = result.fullStream.pipeThrough(new TransformStream({\n  transform(chunk, controller) {\n    if (chunk.type !== 'redacted-reasoning' && chunk.type !== 'reasoning-signature') controller.enqueue(chunk);\n  }\n}));","typeGuard":null,"tryCatchPattern":"try {\n  result.toAISDKv5Stream().pipeTo(writable);\n} catch (err) {\n  if (err instanceof Error && /chunk type .* not supported/.test(err.message)) {\n    // fall back to non-streaming or a filtered stream\n    await generateFallback();\n  } else throw err;\n}","preventionTips":["Avoid reasoning models that emit redacted-reasoning chunks on v5-consumed streams, or disable redacted reasoning in provider options.","Filter reasoning-signature/redacted-reasoning chunks before the v5 transform as a standing pipeline step.","Keep @mastra/core updated; chunk-mapping coverage improves over time.","Test streaming with your exact model before wiring the UI stream."],"tags":["streaming","ai-sdk-v5","reasoning","unsupported-type"],"backgroundTag":"unsupported-stream-chunk-type","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}