Architecture: How to support IDE tool delegation from backend-vitto-api to...

Documentation for Sessions

🏗️ Architecture: How to support IDE tool delegation from backend-vitto-api to...

Date: 2026-03-24
Time: 17:36:56 UTC
Session: gspace1-265.5
Agent: backend
Confidence: 90%
Status: ✅ Documented


📋 Decision Context

Question:

How to support IDE tool delegation from backend-vitto-api to VS Code extension?

Task: Not specified


🎯 Decision Made

Chosen:

ToolExecutionStrategy interface with LocalToolStrategy (wraps ToolRegistryService) and IdeToolStrategy (SSE push + Promise bridge). New POST /engine/agent-session streaming endpoint + POST /engine/agent-session/:sessionId/tool-result callback. Strategy pattern replaces hardcoded if/else in agent loop.

Options Considered:


💭 Reasoning

The existing executeToolWithVmRouting() was a growing if/else chain. The SandboxedToolProxyService already proved external tool execution works. Rather than adding another else-if for IDE tools, introduced a ToolExecutionStrategy interface that abstracts execution location. Three implementations: LocalToolStrategy (in-process, fallback), VmToolStrategy (wraps existing VM proxy), IdeToolStrategy (novel SSE+POST bridge). The streaming POST pattern matches what the extension already expects — it reads SSE from the POST response body, not a separate GET. AgentLoopOptions gains toolStrategies array; backward compatible.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation