Fix parsing dyad tags with nested tags: < > (#445)

Fixes #441
This commit is contained in:
Will Chen
2025-06-19 10:08:26 -07:00
committed by GitHub
parent b044bb69f7
commit 8464609ba8
8 changed files with 424 additions and 21 deletions

View File

@@ -1,4 +1,5 @@
import { safeSend } from "../utils/safe_sender";
import { cleanFullResponse } from "../utils/cleanFullResponse";
// e.g. [dyad-qa=add-dep]
// Canned responses for test prompts
@@ -18,6 +19,12 @@ const TEST_RESPONSES: Record<string, string> = {
<dyad-add-dependency packages="react-router-dom react-query"></dyad-add-dependency>
EOM`,
"string-literal-leak": `BEFORE TAG
<dyad-write path="src/pages/locations/neighborhoods/louisville/Highlands.tsx" description="Updating Highlands neighborhood page to use <a> tags.">
import React from 'react';
</dyad-write>
AFTER TAG
`,
};
/**
@@ -64,6 +71,7 @@ export async function streamTestResponse(
// Add the word plus a space
fullResponse += chunk + " ";
fullResponse = cleanFullResponse(fullResponse);
// Send the current accumulated response
safeSend(event.sender, "chat:response:chunk", {