vercel/ai · error · Error
HarnessAgent: pipeUIMessageStreamToResponse is not implement
Error message
HarnessAgent: pipeUIMessageStreamToResponse is not implemented yet. Track the foundation review for follow-up.
What it means
pipeUIMessageStreamToResponse on HarnessStreamTextResult is a stub that unconditionally throws this 'not implemented yet' error; the harness result does not yet support piping a UI message stream directly to a server Response. (pipeTextStreamToResponse is similarly unimplemented.) It is an intentional placeholder, not an environmental failure.
Source
Thrown at packages/harness/src/agent/internal/harness-stream-text-result.ts:763
toUIMessageStreamHelper<TOOLS, UI_MESSAGE>({
stream: this.stream,
tools: this.tools,
originalMessages,
generateMessageId,
onEnd,
onFinish,
messageMetadata,
sendReasoning,
sendSources,
sendStart,
sendFinish,
onError,
}),
) as AsyncIterableStream<InferUIMessageChunk<UI_MESSAGE>>;
}
pipeUIMessageStreamToResponse(): never {
throw notSupportedYet('pipeUIMessageStreamToResponse');
}
pipeTextStreamToResponse(): never {
throw notSupportedYet('pipeTextStreamToResponse');
}
toUIMessageStreamResponse<UI_MESSAGE extends UIMessage>({
originalMessages,
generateMessageId,
onEnd,
onFinish,
messageMetadata,
sendReasoning,
sendSources,
sendStart,
sendFinish,
onError,
...initView on GitHub (pinned to 69428b1f8b)
Solutions
- Use result.toUIMessageStream() and write the chunks to your Response manually.
- Alternatively pipe result.textStream into a plain-text Response yourself.
- Track the foundation review; avoid calling this method until it is implemented.
Example fix
// before
result.pipeUIMessageStreamToResponse();
// after
const stream = result.toUIMessageStream({ onError });
return new Response(stream, { headers: { 'Content-Type': 'text/event-stream' } }); Defensive patterns
Strategy: fallback
Try / catch
// Avoid the stub entirely; build the response from the UI message stream:
const stream = result.toUIMessageStream({ onError });
return new Response(stream, { headers: { 'Content-Type': 'text/event-stream' } }); Prevention
- Never call pipeUIMessageStreamToResponse on harness results; it always throws.
- Use toUIMessageStream() plus a manual Response in route handlers.
- Check the harness package API surface before porting code that uses `ai` result helpers.
When it happens
Trigger: Calling result.pipeUIMessageStreamToResponse() on any HarnessStreamTextResult — the method is `: never` and always throws.
Common situations: Porting route handlers from the core AI SDK useChat/server examples to a harness agent and calling the same pipe helper; expecting feature parity between `ai` result objects and harness results.
Related errors
- HarnessAgent: element streams in ${this.outputSpecification?
- HarnessAgent: structured output is not implemented yet. Trac
- No tool invocation found for tool call ID "${toolCallId}".
- Received text-delta for missing text part with ID "${chunk.i
- Received text-end for missing text part with ID "${chunk.id}
AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30).
Data as JSON: /api/errors/b0bedbc475b9a0f0.
Report an issue: GitHub.