mirror of
https://github.com/ZSeven-W/openpencil.git
synced 2026-06-01 03:14:29 +07:00
Sub-agents (MiniMax M2 especially) hedge by hardcoding a "safe dark" hex (#0A0A0A, #111, etc.) on every section root they emit. That fill then completely covers the page root's intended background color — #1a1a2e in the health-tracker case — breaking theme switching and creating visible seams between sections. Two-layer fix: 1. Prompt guardrail in orchestrator-sub-agent.ts — tell the sub-agent NOT to set `fill` on its section root, and show the actual inherited background color so the model has no reason to hedge. 2. Post-pass cleanup stripRedundantSectionFills in pen-core — for each direct child of the page root frame, drop the fill if: - the child has no role or a structural role (section/row/column/ stack/container/hero/footer/cta-section/etc.), AND - the fill matches the root fill exactly OR is one of the common "safe dark" hexes sub-agents reach for. Cards, buttons, chips, badges, inputs, phone mockups, status bars, banners and other protected roles are never touched. Unknown roles are also preserved (conservative default). The pass is wired into both applyPostStreamingTreeHeuristics (streaming path, runs on the outer parent frame via getParentOf so each sub-agent's section root is visible at the strip scope) and sanitizeNodesForInsert/ Upsert (batch path). All mutations are covered by the existing forcePageResync call so the canvas re-renders without a stale frame. |
||
|---|---|---|
| .. | ||
| agent-native@a8671f8643 | ||
| pen-ai-skills | ||
| pen-codegen | ||
| pen-core | ||
| pen-engine | ||
| pen-figma | ||
| pen-mcp | ||
| pen-react | ||
| pen-renderer | ||
| pen-sdk | ||
| pen-types | ||
| CLAUDE.md | ||