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 formatView on GitHub (pinned to efac598707)
Solutions
- Ensure the scripted transcript has a turn that matches resolveTurn's lookup for the incoming messages.
- Stop calling sendMessages once the transcript is exhausted (track completion on the client).
- 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
- Track scripted-turn exhaustion on the client and disable further sends.
- Validate that messageId exists in the transcript before requesting a regenerate.
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
- No assistant response found for this transcript.
- Only continuation turns materialize from a transcript.
- get() cannot materialize a continuation turn without a live
- count must be a non-negative integer.
- A needsApproval tool call resolves from the user's decision;
AI-assisted analysis of shadcn-ui/ui@efac598707 (2026-08-12).
Data as JSON: /api/errors/5dd2690c5476b619.
Report an issue: GitHub.