shadcn-ui/ui · error
No assistant response found for this transcript.
Error message
No assistant response found for this transcript.
What it means
The TanStack AI connection adapter's connect() calls context.resolveTurn(messages); if no scripted assistant turn matches the UIMessage/ModelMessage history, it throws. This is the same root cause as the AI SDK variant (error 7) but reached through the TanStack connect lifecycle.
Source
Thrown at packages/helpers/src/tanstack-ai/format.ts:309
TanStackEventData,
TanStackToolSet<TOOLS>
>,
options: TurnStreamOptions
): ConnectConnectionAdapter {
return {
connect(
messages: UIMessage[] | ModelMessage[],
_data?: Record<string, unknown>,
abortSignal?: AbortSignal,
runContext?: RunAgentInputContext
) {
// The chat client hands custom adapters the full UIMessage history.
const turn = context.resolveTurn(
messages as ClientUIMessage<TOOLS, DATA>[]
)
if (!turn) {
throw new Error("No assistant response found for this transcript.")
}
const encode = createRunEncoder<
TanStackEventData,
TanStackToolSet<TOOLS>
>({
threadId: runContext?.threadId ?? "thread-chat",
runId: runContext?.runId ?? "run-chat",
messageId: turn.message.id,
})
return streamToAsyncIterable(
context.streamTurn(turn, encode, options, abortSignal)
)
},
}
}
View on GitHub (pinned to efac598707)
Solutions
- Call context.resolveTurn(messages) before connect and handle undefined gracefully.
- Stop the TanStack client once the transcript is exhausted.
- Align message ids with scripted assistant turns.
Example fix
// before // client auto-connects after exhaustion and throws // after const turn = context.resolveTurn(messages as ClientUIMessage[]) if (!turn) return // no scripted response; end the conversation
Defensive patterns
Strategy: validation
Validate before calling
const turn = context.resolveTurn(messages as ClientUIMessage[])
if (!turn) {
// no scripted response; return a terminal/empty stream instead of connecting
return
} Type guard
const hasMatchingTurn = (messages: unknown[]): boolean => Boolean(context.resolveTurn(messages as ClientUIMessage[]))
Try / catch
try {
await adapter.connect(messages, data, abortSignal, runContext)
} catch (e) {
if ((e as Error).message === "No assistant response found for this transcript.") {
// gracefully end the conversation
} else throw e
} Prevention
- Disable further sends once scripted turns are consumed.
- Validate the message history shape before calling connect.
When it happens
Trigger: A TanStack chat client sending a message after the scripted transcript is exhausted; a message history that does not align with scripted turns; reconnecting after completion.
Common situations: TanStack-based demos with finite scripts; client reconnects once the conversation is done.
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/5e5d91884553faec.
Report an issue: GitHub.