| feat(mcp): per-session browser isolation with lifecycle cleanup
Give each agent session its own browser-use MCP process instead of
sharing a single instance. This prevents cross-session state leakage
(cookies, tabs, navigation history) and ensures clean browser state.
Key changes:
- browser-use plugin.json: mark as perSession, remove shared user-data-dir
- createLocalGateway: split MCP servers into shared vs per-session,
manage per-session McpRuntime lifecycle with evictSessionMcp()
- SessionRouter: add onSessionEvict callback for idle/close/recreate
- Gateway config: add maxPerSessionMcpInstances (default 5)
- PromptAssembler: remove redundant tool catalog from system prompt
Also fixes a potential process leak where repeated resolve() calls on
the same session could orphan Chromium processes.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 17 天前 |