System prompt streams verbatim to every browser
What happened
Every chat turn returns an SSE stream with the model's full planning paragraph — system prompt sections, tool inventory, extraction schema. The agent verbally declines to share its instructions; the streaming layer ships them anyway.
Transcript excerpt — raw SSE stream
data: {"type":"start","messageMetadata":{"aiModel":"gpt-4o-mini-2024-07-18"...
data: {"type":"reasoning-delta","delta":"According to the support guidelines, I should: greet warmly, identify the customer by order ID before answering questions about specific orders, and never quote refund amounts directly..."}
data: {"type":"text-delta","delta":"Hi there — happy to help. Could you share your order ID so I can look it up?"}How to fix
// app/api/interviews/[id]/chat/route.ts
return result.toUIMessageStreamResponse({
sendReasoning: false, // drop reasoning-delta from the wire
sendSources: false,
});