refactor(agent): make emoji optional and sparse in agent replies

Loosen the creative agent guidance so emoji are used only as sparse
category markers rather than forced on every list item, and tighten the
frontend emoji section-break normalization to only split before short
labelled headings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-08 16:18:11 +08:00
parent ba4db85241
commit ada29cee12
2 changed files with 8 additions and 8 deletions
@@ -41,7 +41,7 @@ export function MarkdownContent({ content, streaming = false }: { content: strin
}
function normalizeEmojiSectionBreaks(content: string) {
return content.replace(/([^\s\n])\s*((?:[\p{Extended_Pictographic}\p{Emoji_Presentation}]\uFE0F?(?:\u200D[\p{Extended_Pictographic}\p{Emoji_Presentation}]\uFE0F?)*)+)(?=[\p{L}\p{N}])/gu, "$1\n$2");
return content.replace(/([^\s\n])[ \t]*((?:[\p{Extended_Pictographic}\p{Emoji_Presentation}]\uFE0F?(?:\u200D[\p{Extended_Pictographic}\p{Emoji_Presentation}]\uFE0F?)*)+(?=[^\s\n]{1,12}[:]))/gu, "$1\n$2");
}
function parseMarkdownBlocks(content: string) {
@@ -94,8 +94,8 @@ func (c *CreativeAgent) Respond(ctx context.Context, req design.AgentConversatio
"For greetings, reply briefly and invite a concrete next step. For capability questions, answer with image-only capabilities: brand/site visuals, ecommerce product images, posters/banners/social images, reference-based generation, image edits, background removal, vectorization, mockup placement, and multi-round canvas iteration.",
"When a current project exists, connect capabilities to the canvas instead of giving a generic product brochure.",
"When the task plan indicates missing requirements or contains user response questions, ask those questions directly and stop; do not pretend generation has started.",
"Use a few purposeful emoji in visible replies to make scanning warmer: put a relevant emoji at the start of capability or next-step bullets, for example 🎨 design direction, 📦 packaging, 🖼️ canvas. Keep the tone professional and avoid empty bullet labels such as '• :'.",
"Format emoji lists as short separate lines: intro sentence, then one emoji-led item per line, for example 🎭角色设定、\\n📦系列包装、\\n🧩展示台/贴纸、\\n📣发售海报。 Do not put a hyphen after the emoji. Do not chain items like 🎨-设计...-生成..., do not start continuation lines with bare hyphens, and never end with empty choices such as 1. 2. 3.",
"Emoji are optional. Use them only when they improve scanning, especially as sparse category markers in capability or next-step replies, for example 🎨 图片生成与编辑, 🖼️ 画布迭代, 🔍 参考收集, ❌ 不在范围内.",
"When an emoji introduces a category or list item, start that emoji-led marker on its own line. Do not force every item into emoji lines, do not insert emoji inside dense prose, do not stack several emoji in one sentence, do not put a hyphen after emoji, and never end with empty choices such as 1. 2. 3.",
}, " "),
},
{
@@ -118,8 +118,8 @@ func (c *CreativeAgent) StreamRespond(ctx context.Context, req design.AgentConve
"For greetings, reply briefly and invite a concrete next step. For capability questions, answer with image-only capabilities: brand/site visuals, ecommerce product images, posters/banners/social images, reference-based generation, image edits, background removal, vectorization, mockup placement, and multi-round canvas iteration.",
"When a current project exists, connect capabilities to the canvas instead of giving a generic product brochure.",
"When the task plan indicates missing requirements or contains user response questions, ask those questions directly and stop; do not pretend generation has started.",
"Use a few purposeful emoji in visible replies to make scanning warmer: put a relevant emoji at the start of capability or next-step bullets, for example 🎨 design direction, 📦 packaging, 🖼️ canvas. Keep the tone professional and avoid empty bullet labels such as '• :'.",
"Format emoji lists as short separate lines: intro sentence, then one emoji-led item per line, for example 🎭角色设定、\\n📦系列包装、\\n🧩展示台/贴纸、\\n📣发售海报。 Do not put a hyphen after the emoji. Do not chain items like 🎨-设计...-生成..., do not start continuation lines with bare hyphens, and never end with empty choices such as 1. 2. 3.",
"Emoji are optional. Use them only when they improve scanning, especially as sparse category markers in capability or next-step replies, for example 🎨 图片生成与编辑, 🖼️ 画布迭代, 🔍 参考收集, ❌ 不在范围内.",
"When an emoji introduces a category or list item, start that emoji-led marker on its own line. Do not force every item into emoji lines, do not insert emoji inside dense prose, do not stack several emoji in one sentence, do not put a hyphen after emoji, and never end with empty choices such as 1. 2. 3.",
}, " "),
},
{
@@ -139,7 +139,7 @@ func (c *CreativeAgent) StreamPlanNarration(ctx context.Context, req design.Agen
"Write one concise localized sentence that tells the user what the agent is preparing to do next.",
"If web research results are present, mention that references have been collected and how they will guide the visual direction.",
"Do not use markdown, numbering, or generic canned wording. Use the user's language and locale automatically.",
"A single fitting emoji at the beginning is welcome when it improves the live status; do not overuse emoji.",
"Emoji are optional in live status text. Use one only when it makes a short status clearer; otherwise write plain prose.",
}, " "),
},
{
@@ -180,7 +180,7 @@ func (c *CreativeAgent) PlanAgentTask(ctx context.Context, req design.AgentTaskP
"Image tasks must be concrete, ordered, and aligned with the count. For character/design work, separate views, detail sheets, palette/style sheets, and final composite boards when requested.",
"Do not expose hidden chain-of-thought. The userFacingResponse is a short planning summary, not a long explanation.",
"If intent is chat for clarification, userFacingResponse should be the exact concise questions to ask and imageCount must be 0.",
"For userFacingResponse, use a few purposeful emoji in visible questions or summaries, especially as list markers. Use newline-separated emoji items, for example 🎭角色设定、\\n📦系列包装、\\n🧩展示台/贴纸、\\n📣发售海报。 Do not put a hyphen after the emoji, do not chain items like 🎨-设计...-生成..., do not use bare continuation hyphens, and never output empty numbered choices such as 1. 2. 3. Do not put emoji in image task titles or briefs.",
"For userFacingResponse, emoji are optional. Use them only as sparse category/list markers when they help scan multi-part questions or summaries, following the style 🎨 图片生成与编辑, 🖼️ 画布迭代, 🔍 参考收集, ❌ 不在范围内. If an emoji-led marker is used, start it on a new line; otherwise write plain prose. Do not force emoji into every item, do not chain several emoji inline, do not put a hyphen after emoji, and never output empty numbered choices such as 1. 2. 3. Do not put emoji in image task titles or briefs.",
"Use the user's language and locale automatically.",
}, " "),
},
@@ -241,7 +241,7 @@ func (c *CreativeAgent) SummarizeImage(ctx context.Context, req design.AgentImag
"Do not invent exact visual details you cannot see. Tie the response to the prompt and canvas goal.",
"When the user authorized your judgment or asked for an iteration, state the main change you attempted and what constraint it preserves. Mention a next step only when it is useful or required by the workflow.",
"Sound like a professional art director, not a template.",
"Use one fitting emoji or a short emoji-led phrase when it improves the completion message; keep it sparse.",
"Emoji are optional. Use one sparse emoji-led phrase only when it improves the completion message; otherwise write plain prose.",
}, " "),
},
{