Unverified 提交 ebcf89ee authored 作者: Adeniji Adekunle James's avatar Adeniji Adekunle James 提交者: GitHub

fix: hide <dyad-command> tags from generated text output (#945) (#1162)

### Summary This PR hides `<dyad-command type="refresh"></dyad-command>` tags from generated text outputs. These elements are not intended for end users and clutter the response text. ### Changes - Filter out `<dyad-command>` tags from generated text. - Ensure no regressions in rendering or formatting of user-visible output. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Hide dyad-command tags from chat output so internal commands never appear in user-visible text. Updates DyadMarkdownParser to detect and drop these tags during preprocessing, parsing, and rendering. <!-- End of auto-generated description by cubic. -->
上级 1c0255ab
...@@ -123,6 +123,7 @@ function preprocessUnclosedTags(content: string): { ...@@ -123,6 +123,7 @@ function preprocessUnclosedTags(content: string): {
"dyad-edit", "dyad-edit",
"dyad-codebase-context", "dyad-codebase-context",
"think", "think",
"dyad-command",
]; ];
let processedContent = content; let processedContent = content;
...@@ -189,6 +190,7 @@ function parseCustomTags(content: string): ContentPiece[] { ...@@ -189,6 +190,7 @@ function parseCustomTags(content: string): ContentPiece[] {
"dyad-edit", "dyad-edit",
"dyad-codebase-context", "dyad-codebase-context",
"think", "think",
"dyad-command",
]; ];
const tagPattern = new RegExp( const tagPattern = new RegExp(
...@@ -418,6 +420,10 @@ function renderCustomTag( ...@@ -418,6 +420,10 @@ function renderCustomTag(
// Don't render anything for dyad-chat-summary // Don't render anything for dyad-chat-summary
return null; return null;
case "dyad-command":
// Don't render anything for dyad-command
return null;
default: default:
return null; return null;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论