From 3e93ccfb45dced3a2b37357f1ed253aa243a0511 Mon Sep 17 00:00:00 2001 From: Hyu Date: Sat, 4 Jul 2026 09:55:49 +0800 Subject: [PATCH] fix(mcp): use uniform session memory_mb=1024 to avoid BoxSessionConflictError (#2316) All MCPs share one Box session (mcp-shared). When session memory_mb differed by command type (512 for python, 1024 for node), the second MCP to call create_session raised BoxSessionConflictError. Fix: always use 1024 MB for the shared session so python and node MCPs coexist without conflict. Co-authored-by: dadachann <185672915+dadachann@users.noreply.github.com> --- src/langbot/pkg/provider/tools/loaders/mcp_stdio.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/langbot/pkg/provider/tools/loaders/mcp_stdio.py b/src/langbot/pkg/provider/tools/loaders/mcp_stdio.py index 57b5e60c5..a2b8ddf3d 100644 --- a/src/langbot/pkg/provider/tools/loaders/mcp_stdio.py +++ b/src/langbot/pkg/provider/tools/loaders/mcp_stdio.py @@ -146,11 +146,7 @@ class BoxStdioSessionRuntime: # load WebAssembly modules (llhttp) on startup; the default 512 MB # cgroup_mem_max is too small and causes OOM kills (return_code=137). # Auto-bump to 1024 MB when the runner is npx/bunx/pnpm dlx. - memory_mb=( - (self.config.memory_mb or 1024) - if self.server_config.get('command', '') in ('npx', 'bunx', 'pnpm') - else self.config.memory_mb - ), + memory_mb=self.config.memory_mb or 1024, pids_limit=self.config.pids_limit, persistent=True, )