mastra-ai/mastra · error

AISDKv5 chunk type "redacted-reasoning" not supported

Error message

AISDKv5 chunk type "redacted-reasoning" not supported

What it means

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.

Source

Thrown at packages/core/src/stream/aisdk/v5/transform.ts:476

      };
    }
    case 'reasoning-start':
      return {
        type: 'reasoning-start',
        id: chunk.payload.id,
        providerMetadata: chunk.payload.providerMetadata,
      };
    case 'reasoning-delta':
      return {
        type: 'reasoning-delta',
        id: chunk.payload.id,
        text: chunk.payload.text,
        providerMetadata: chunk.payload.providerMetadata,
      };
    case 'reasoning-signature':
      throw new Error('AISDKv5 chunk type "reasoning-signature" not supported');
    case 'redacted-reasoning':
      throw new Error('AISDKv5 chunk type "redacted-reasoning" not supported');

    case 'reasoning-end':
      return {
        type: 'reasoning-end',
        id: chunk.payload.id,
        providerMetadata: chunk.payload.providerMetadata,
      };
    case 'source':
      if (chunk.payload.sourceType === 'url') {
        return {
          type: 'source',
          sourceType: 'url',
          id: chunk.payload.id,
          url: chunk.payload.url!,
          title: chunk.payload.title,
          providerMetadata: chunk.payload.providerMetadata,
        };
      } else {

View on GitHub (pinned to 75dd419e61)

Solutions

  1. 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).
  2. 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).
  3. 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.
  4. Upgrade @mastra/core — support for mapping these chunk types may have been added in a newer version.

Example fix

// before: piping raw mastra stream into AI SDK v5 transform
result.toAISDKv5Stream().pipeTo(uiStream);

// after: drop unsupported chunk types first
const filtered = result.fullStream.pipeThrough(new TransformStream({
  transform(chunk, controller) {
    if (chunk.type !== 'redacted-reasoning' && chunk.type !== 'reasoning-signature') {
      controller.enqueue(chunk);
    }
  }
}));
Defensive patterns

Strategy: try-catch

Validate before calling

// Inspect the stream for chunk types the v5 transform cannot map before consuming
const hasUnsupported = false;
const reader = result.fullStream.getReader();
// alternatively, filter:
const safe = result.fullStream.pipeThrough(new TransformStream({
  transform(chunk, controller) {
    if (chunk.type !== 'redacted-reasoning' && chunk.type !== 'reasoning-signature') controller.enqueue(chunk);
  }
}));

Try / catch

try {
  result.toAISDKv5Stream().pipeTo(writable);
} catch (err) {
  if (err instanceof Error && /chunk type .* not supported/.test(err.message)) {
    // fall back to non-streaming or a filtered stream
    await generateFallback();
  } else throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30). Data as JSON: /api/errors/3b498c24d8aa4d7a. Report an issue: GitHub.