Safe send (#421)

This commit is contained in:
Will Chen
2025-06-16 21:58:20 -07:00
committed by GitHub
parent 30b5c0d0ef
commit d6d6918d1b
5 changed files with 50 additions and 13 deletions

View File

@@ -1,3 +1,5 @@
import { safeSend } from "../utils/safe_sender";
// e.g. [dyad-qa=add-dep]
// Canned responses for test prompts
const TEST_RESPONSES: Record<string, string> = {
@@ -64,7 +66,7 @@ export async function streamTestResponse(
fullResponse += chunk + " ";
// Send the current accumulated response
event.sender.send("chat:response:chunk", {
safeSend(event.sender, "chat:response:chunk", {
chatId: chatId,
messages: [
...updatedChat.messages,