From 8db9e97075f09eedfe7dffba82f8e0932604dd96 Mon Sep 17 00:00:00 2001 From: Fini Date: Sat, 9 May 2026 20:59:45 +0800 Subject: [PATCH] feat(ai): per-subtask icon_font reminder in sub-agent prompt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: even after the icon-catalog skill rewrite (19ca1c66) said "ALWAYS USE icon_font, NEVER path NODES", end-to-end testing with MiniMax-M2.7 shows the model still emits ~half its icons as \`path\` nodes (Bell Icon / Cart Icon etc.) because the per-subtask CRITICAL LAYOUT CONSTRAINTS prompt — which the model treats as the prompt of record — never restated the icon convention. The skill prompt is upstream context the model can drift away from; the per-subtask block is the last thing the model reads before generating, so it carries weight. What: append a one-line ICONS rule directly to CRITICAL LAYOUT CONSTRAINTS in orchestrator-sub-agent.ts. Restates the icon_font shape inline (\`{"type":"icon_font","iconFontName":"",…}\`) and calls out the failure mode by name (resolver guess + placeholder circle) so the model sees both the right pattern and the consequence of the wrong one. The path-with-iconic-name fallback path keeps working — this is purely preventive guidance, the resolver tokenize fix (ef6f7ed3) still catches the leftover cases. 1086 / 1086 AI tests still pass. --- apps/web/src/services/ai/orchestrator-sub-agent.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/web/src/services/ai/orchestrator-sub-agent.ts b/apps/web/src/services/ai/orchestrator-sub-agent.ts index 5682b749a..c757c496f 100644 --- a/apps/web/src/services/ai/orchestrator-sub-agent.ts +++ b/apps/web/src/services/ai/orchestrator-sub-agent.ts @@ -715,6 +715,7 @@ CRITICAL LAYOUT CONSTRAINTS: - Use justifyContent="space_between" to distribute items (e.g. navbar: logo | links | CTA). ${paddingHint} - For side-by-side layouts, nest a horizontal frame with child frames using "fill_container" width. - SECTION BACKGROUND: do NOT set \`fill\` on your section root frame. ${rootBgHint} Hardcoding a "safe dark" fill (e.g. #000 / #0A0A0A / #111) will cover the intended background and break theme switching. Only set \`fill\` on cards, buttons, chips, badges, and other visually distinct components — never on the section container itself. +- ICONS: emit \`{"type":"icon_font","iconFontName":"","iconFontFamily":"lucide","width":20,"height":20,"fill":[{"type":"solid","color":""}]}\`. NEVER emit \`{"type":"path","name":"X Icon","d":"…"}\` for an icon — the path-based pattern (legacy "PascalCase + Icon suffix") needs the resolver to guess the iconic noun and frequently falls back to a placeholder circle when the model adds extra words to the name (e.g. "Search Icon Path"). icon_font is the supported, drift-free path; the icon-catalog skill above lists the role→name map (Cart→shopping-cart, Profile→user, etc). - IDs prefix="${subtask.idPrefix}-". No tags. Output \`\`\`json immediately.`; // Phone mockup guidance is only relevant when this subtask is actually