shadcn-ui/ui · error

No assistant response found for this transcript.

Error message

No assistant response found for this transcript.

What it means

In the AI SDK transport produced by format.createTransport, sendMessages() resolves the matching scripted assistant turn via transportContext.resolveTurn(). If no turn matches the incoming message transcript (or the messageId on a regenerate), it throws. This means the scripted chat has been exhausted or the client sent an unexpected message order.

Source

Thrown at packages/helpers/src/ai-sdk/format.ts:257

            type: "custom",
          } as Chunk
        default:
          return assertNever(chunk)
      }
    },

    createTransport(transportContext, options = {}) {
      return {
        async sendMessages({ messages, messageId, abortSignal, trigger }) {
          // Automatic sends after tool results and approvals pass the last
          // assistant message's id; only regeneration may replay a turn by id.
          const turn = transportContext.resolveTurn(
            messages,
            trigger === "regenerate-message" ? messageId : undefined
          )

          if (!turn) {
            throw new Error("No assistant response found for this transcript.")
          }

          return transportContext.streamTurn(
            turn,
            format.encodeChunk,
            options,
            abortSignal
          )
        },

        async reconnectToStream() {
          return null
        },
      } satisfies ChatTransport<Message>
    },
  }

  return format

View on GitHub (pinned to efac598707)

Solutions

  1. Ensure the scripted transcript has a turn that matches resolveTurn's lookup for the incoming messages.
  2. Stop calling sendMessages once the transcript is exhausted (track completion on the client).
  3. For regenerate, pass the exact messageId of an existing assistant turn.

Example fix

// before
await transport.sendMessages({ messages, messageId, trigger })

// after
const turn = context.resolveTurn(messages, trigger === "regenerate-message" ? messageId : undefined)
if (!turn) return // no scripted response; end the conversation
await transport.sendMessages({ messages, messageId, trigger })
Defensive patterns

Strategy: validation

Validate before calling

const turn = context.resolveTurn(
  messages,
  trigger === "regenerate-message" ? messageId : undefined
)
if (!turn) {
  // nothing to stream; end the conversation instead of throwing
  return
}

Type guard

// resolveTurn returns ResolvedTurn | undefined; narrow before streaming
const turn = context.resolveTurn(messages, messageId)
if (!turn) return
// turn is ResolvedTurn here

Try / catch

try {
  await transport.sendMessages({ messages, messageId, trigger })
} catch (e) {
  if ((e as Error).message === "No assistant response found for this transcript.") {
    // end the chat gracefully
  } else throw e
}

Prevention

When it happens

Trigger: Calling sendMessages after all scripted turns are consumed; regenerating a messageId that has no scripted turn; sending a message sequence that does not line up with the scripted user/assistant alternation.

Common situations: A demo or scripted assistant with a finite transcript receiving extra messages; a client retrying after completion; mismatched message ids.

Related errors


AI-assisted analysis of shadcn-ui/ui@efac598707 (2026-08-12). Data as JSON: /api/errors/5dd2690c5476b619. Report an issue: GitHub.