fix: per-agent state isolation to prevent cross-agent instance contamination
When multiple Cowork agents/tasks share a single MCP server process, selecting a Unity instance in one agent would override the selection for all other agents. This happened because instance selection state was stored in shared global variables. Convert all shared state to per-agent Maps keyed by agent ID: - _agentInstances: Map<agentId, instanceInfo> - _agentSelectionRequired: Map<agentId, boolean> - _contextInjectedPerAgent: Map<agentId, boolean> - _discoveryDonePerAgent: Map<agentId, boolean> Each tool handler now calls setCurrentAgent(agentId) before execution, ensuring all state reads/writes target the correct agent's Map entry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
A
AnkleBreaker Studio committed
031393f6c52a63376ca02b5676a1d106a6d575b6
Parent: 25b8896