fix(mcp): cap ui-apps build concurrency to avoid oom#60156
Merged
Conversation
Contributor
|
Reviews (1): Last reviewed commit: "fix(mcp): cap ui-apps build concurrency ..." | Re-trigger Greptile |
Contributor
MCP UI Apps size report
|
Contributor
|
Size Change: 0 B Total Size: 80.1 MB ℹ️ View Unchanged
|
skoob13
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The MCP container image build OOM-kills Vite (exit 137, e.g.
generated/session-summary) at thebuild:ui-appsstep.build-ui-apps.tsdefaulted concurrency toapps.lengthand only capped it to 4 whenprocess.env.CIwas set — but DockerRUNlayers don't inherit the runner'sCIenv, so inside the image build all 28 apps spawned at once and saturated the builder (~98% peak memory in Depot telemetry).Changes
Cap the default to
Math.min(apps.length, 4)and drop theCIgating. The constraint is memory, not which environment we run in, so the default should be safe everywhere — CI, the Docker build, and local dev — with no Dockerfile or Depot changes.How did you test this code?
Agent-authored (Claude Code), automated only — no manual UI testing. Ran the full
build:ui-appsat concurrency 4 (the path this fix selects) end-to-end: all 28 apps built successfully, includinggenerated/session-summary. Confirmed via Depot build telemetry that the failing builds peaked at 97–98% memory and OOM-killed a Vite process.Publish to changelog?
no
Docs update
No docs change needed.
🤖 Agent context
Authored with Claude Code (Bash, Edit, Depot telemetry probing via session cookie).
Diagnosed from the failing Depot builds: 28 Vite processes ran concurrently because the existing 4-worker limiter was gated on
CI, which BuildKitRUNsteps never see. Considered and rejected the env-based fixes —ENV CI=truein the Dockerfile (overloads a semantic flag, bakes build intent into an image layer) and a--max-old-space-size=512heap cap (a singlesession-summarybuild already peaks at ~650 MB RSS, so the cap has no headroom and would turn an intermittent infra OOM into a deterministic per-app crash). Chose to fix the actual defect: the unbounded default. Requires human review.