Architecture: Should Computer Use sandboxes be persistent per-user (keep-a...

Documentation for Sessions

๐Ÿ—๏ธ Architecture: Should Computer Use sandboxes be persistent per-user (keep-a...

Date: 2026-02-24
Time: 19:11:25 UTC
Session: gspace1-139.4
Agent: backend
Confidence: 94%
Status: โœ… Documented


๐Ÿ“‹ Decision Context

Question:

Should Computer Use sandboxes be persistent per-user (keep-alive) vs disposable per-task? And should Vitto orchestrate Computer Use?

Task: Persistent sandbox architecture for Computer Use


๐ŸŽฏ Decision Made

Chosen:

Persistent per-user sandboxes with TTL-based lifecycle. Vitto orchestration deferred to S140 but architecturally planned.

Options Considered:

  1. Disposable per-task (current)
  2. Persistent per-user with 30min TTL
  3. Persistent per-user with 24h TTL
  4. Pre-warmed sandbox pool (complex)

๐Ÿ’ญ Reasoning

Two critical architectural decisions: (1) PERSISTENT SANDBOXES: Current model spins up a fresh E2B Firecracker VM per task (~2-3s boot + Chrome launch + login = 35s overhead). For repeat tasks on the same service (Gmail, GitHub), the user must re-authenticate every time. With persistent sandboxes: first task boots and authenticates normally, subsequent tasks reuse the same VM with browser sessions intact. E2B supports long-running sandboxes (up to 24h). Implementation: Map<userId, { sandbox, lastUsed, createdAt }>. TTL of 30 minutes of inactivity. Max 1 sandbox per user (cost control). On new task: check if user has an active sandbox โ†’ reuse it. On timeout: destroy sandbox. Trade-offs: +52% faster repeat tasks, +Jarvis-like continuity, -Higher E2B cost (sandbox alive while idle), -Security risk (browser sessions persist). Mitigation: 30min TTL is aggressive enough. E2B free tier handles this. (2) VITTO ORCHESTRATION: Computer Use should be a Vitto tool, not a standalone system. When user says 'send email' in Chat, Vitto's agent loop should dispatch to Computer Use. Current architecture bypasses Vitto entirely โ€” frontend calls backend-ai-api directly. Fix: register Computer Use as a Vitto tool in tool-registry. The Chatโ†’Vittoโ†’ComputerUse flow gives us: memory (Vitto remembers what tasks ran), learning (outcome tracking), proactive suggestions ('you usually check email at 9am'). Deferred to S140 because Computer Use infrastructure needed to be solid first.


๐Ÿ“ Files Involved


๐Ÿ”— Related


Auto-generated by MCP Smart Consolidation