Bugfix: Why does the Vitto Studio preview never update after platfor...
Documentation for Sessions
🐛 Bugfix: Why does the Vitto Studio preview never update after platfor...
Date: 2026-03-17
Time: 17:05:36 UTC
Session: gspace1-230.9
Agent: angular
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
Why does the Vitto Studio preview never update after platform generation via chat?
Task: Not specified
🎯 Decision Made
Chosen:
Three-part fix: (1) Forward module-gen.started/completed/failed events from VittoChatEngineService to StudioGenerationListenerService via new moduleGenEvents$ Subject, (2) Subscribe in StudioDockShellComponent to route these events to genListener.handleEvent(), (3) Add polling fallback (200s delay + 15s interval) that polls GET /vitto-api/module-generation/active/:spaceId when SSE forwarding dies due to 180s task timeout
Options Considered:
- No alternatives documented
💭 Reasoning
Root cause: When generation is triggered via Vitto chat, SSE events flow through VittoChatEngineService. The engine has a NON_PHASE_EVENTS filter that silently DROPS module-gen.completed/failed/started events — they never reach StudioGenerationListenerService, so filesReadyForReview$ never fires and the dock-shell never switches to rspack preview mode. Second issue: the Vitto task times out at 180s but the pipeline takes ~250s, so the SSE forwarding subscription dies before module-gen.completed is even emitted. The polling fallback covers this gap.
📁 Files Involved
libs/libs-ai/vitto-chat/src/lib/services/vitto-chat-engine.service.tslibs/libs-structural/vitto-studio/src/lib/services/studio-generation-listener.service.tslibs/libs-structural/vitto-studio/src/lib/components/studio-dock-shell/studio-dock-shell.component.tsAPIs/backend-vitto-api/src/app/tools/plugins/module-gen.plugin.ts
🔗 Related
- Decision ID:
dev_1773767136840_8t4dh7g - Session: 230
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation