Bugfix: Session 181: Why was Vitto completely blind to the user's cu...
Documentation for Sessions
🐛 Bugfix: Session 181: Why was Vitto completely blind to the user's cu...
Date: 2026-03-06
Time: 14:42:29 UTC
Session: gspace1-183.2
Agent: angular
Confidence: 97%
Status: ✅ Documented
📋 Decision Context
Question:
Session 181: Why was Vitto completely blind to the user's current page in web chat?
Task: Fix Vitto chat intelligence — page awareness, screenshots, web prompt
🎯 Decision Made
Chosen:
Three-part fix: (1) Wire pageContext into sendMessageViaVitto POST body, (2) Upgrade buildWebSystemPrompt to full intelligence parity with channel prompt, (3) Add capture_user_screen tool via WebSocket for real visual awareness
Options Considered:
- Wire pageContext only (quick fix)
- Upgrade web prompt only (medium fix)
- Full three-part fix: pageContext + prompt parity + screen capture tool (chosen)
- Remove screenshot tools entirely and rely on text context only
💭 Reasoning
Root cause was a silent data loss chain: sendMessageViaVitto() sent {message, spaceId} but omitted pageContext — the controller accepted it, the engine used it, but frontend never populated it. This meant the LLM had zero page awareness on the primary (tool-enabled) pipeline. Additionally, buildWebSystemPrompt was a stripped-down version with no semantic recall, no learning intelligence, no awareness hub, no emotional arc — features the WhatsApp channel got. The web panel — where users actually interact with Vitto — was a second-class citizen. Finally, browser_screenshot used server-side Playwright with no page loaded, returning blank screenshots. Created capture_user_screen tool that requests viewport capture from user's actual browser via LocalBridge WebSocket.
📁 Files Involved
libs/libs-ai/vitto-chat/src/lib/services/vitto-chat-engine.service.tsAPIs/backend-vitto-api/src/app/engine/context-assembly.service.tsAPIs/backend-vitto-api/src/app/tools/tool-registry.service.tsAPIs/backend-vitto-api/src/app/engine/agent-loop.service.tsAPIs/backend-vitto-api/src/app/engine/vitto-engine.service.tsAPIs/backend-vitto-api/src/app/engine/local-bridge.gateway.tslibs/libs-ai/vitto-core/src/lib/services/vitto-screen-capture.service.tslibs/libs-ai/vitto-core/src/lib/services/vitto-page-context-registry.service.ts
🔗 Related
- Decision ID:
dev_1772808149371_0ogp56n - Session: 183
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation