mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-15 08:56:07 +00:00
fix(mcp): bump default memory to 1024MB for node (npx) stdio MCP servers (#2313)
Node.js MCP servers (npx/bunx) were being OOM-killed (return_code=137) by the default 512MB nsjail cgroup_mem_max. Node V8 reserves large virtual address space and instantiates WebAssembly modules (undici llhttp) on startup, easily exceeding 512MB resident. This caused every node-based MCP (memory, sequential-thinking, filesystem, weather, docker, excel) to crash-loop. Fix: when the stdio command is npx/bunx/pnpm, default memory_mb to 1024 unless the operator explicitly set a value. Python/uvx servers keep the 512MB default. Co-authored-by: dadachann <185672915+dadachann@users.noreply.github.com>
This commit is contained in:
@@ -142,7 +142,15 @@ class BoxStdioSessionRuntime:
|
||||
read_only_rootfs=self.config.read_only_rootfs if self.config.read_only_rootfs is not None else False,
|
||||
image=self.config.image,
|
||||
cpus=self.config.cpus,
|
||||
memory_mb=self.config.memory_mb,
|
||||
# Node.js runtimes (npx/bunx) reserve large virtual address space and
|
||||
# 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
|
||||
),
|
||||
pids_limit=self.config.pids_limit,
|
||||
persistent=True,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user