openpencil/packages
Fini b4d35bb185 fix(ai): drop redundant section-level fills from sub-agent output
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.
2026-04-06 18:14:09 +08:00
..
agent-native@a8671f8643 fix(agent): lower default max_output_tokens to 16384 2026-04-05 20:24:56 +08:00
pen-ai-skills fix(ai): harden post-streaming pipeline against layout and phone mockup bugs 2026-04-06 18:08:03 +08:00
pen-codegen refactor(codegen): extract shared utilities from generators 2026-03-29 11:43:33 +08:00
pen-core fix(ai): drop redundant section-level fills from sub-agent output 2026-04-06 18:14:09 +08:00
pen-engine fix(sdk): address code review — viewport loop, zoom math, hover API, batch drag, stale node 2026-03-30 00:28:31 +08:00
pen-figma style: auto-format after Phase 5-6 pen-react + file splits 2026-03-30 00:18:50 +08:00
pen-mcp fix(mcp): fall back to IPv6 for live sync url discovery 2026-04-06 18:07:28 +08:00
pen-react fix(sdk): address code review — viewport loop, zoom math, hover API, batch drag, stale node 2026-03-30 00:28:31 +08:00
pen-renderer feat(engine): add browser adapter + auto-format after pen-engine extraction 2026-03-29 22:50:38 +08:00
pen-sdk refactor(editor): wire apps/web to pen-react — DesignProvider, initCanvasStoreBridge, esbuild aliases 2026-03-30 00:05:48 +08:00
pen-types fix(sdk): address code review — viewport loop, zoom math, hover API, batch drag, stale node 2026-03-30 00:28:31 +08:00
CLAUDE.md chore(editor): add oxlint and oxfmt for linting and formatting 2026-03-29 00:19:51 +08:00