Bugfix: VNC stream and sandbox management endpoints hardcoded to E2B...
Documentation for Sessions
🐛 Bugfix: VNC stream and sandbox management endpoints hardcoded to E2B...
Date: 2026-02-28
Time: 19:48:09 UTC
Session: gspace1-154.3
Agent: backend
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
VNC stream and sandbox management endpoints hardcoded to E2BDesktopService instead of routing through SandboxProviderFactory
Task: Fix VNC stream routing hardcoded to E2B
🎯 Decision Made
Chosen:
Injected SandboxProviderFactory into ComputerUseController and replaced all 5 direct E2BDesktopService calls with factory-routed provider calls. Also added GET /infrastructure/observatory/sandbox-providers endpoint for frontend provider comparison UI.
Options Considered:
- No alternatives documented
💭 Reasoning
Lines 230-274 in computer-use.controller.ts called this.e2bDesktop directly for getStreamUrl, getActiveSandboxes, destroySessionSandbox, and destroyUserSandboxes. When self-hosted provider is active (SANDBOX_SERVER_URL configured), these endpoints silently fail because E2BDesktopService isn't the active provider. The fix routes all calls through sandboxFactory.getProvider() which returns whichever provider is active. For getStreamUrlByUser and destroyUserSandboxes, we iterate getActiveSandboxes() filtered by userId since the generic interface doesn't have user-scoped convenience methods.
📁 Files Involved
APIs/backend-ai-api/src/app/infrastructure/controllers/computer-use.controller.tsAPIs/backend-ai-api/src/app/infrastructure/controllers/observatory.controller.ts
🔗 Related
- Decision ID:
dev_1772308085736_48i3f1g - Session: 154
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation