feat(docker-git): add resource limits for MCP Playwright sidecar#264
Open
konard wants to merge 3 commits intoProverCoderAI:mainfrom
Open
feat(docker-git): add resource limits for MCP Playwright sidecar#264konard wants to merge 3 commits intoProverCoderAI:mainfrom
konard wants to merge 3 commits intoProverCoderAI:mainfrom
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: ProverCoderAI#259
Introduce configurable CPU and RAM limits for the MCP Playwright browser sidecar, separate from the main service container. - Add `--playwright-cpu`/`--playwright-cpus` and `--playwright-ram`/`--playwright-memory` CLI flags - Default to 30% of host resources, falling back to the main service limits when not set - Wire limits through template defaults, parser, apply overrides, and the docker-compose template - Mirror changes across canonical lib, app/lib, and frontend-lib paths Closes ProverCoderAI#259
Contributor
Author
Working session summaryAll 15 CI checks pass (Build, Types, Lint, Test, Lint Effect-TS, Snapshot, dist-deps-prune × 2, plus 7 E2E suites).
This summary was automatically extracted from the AI working session output. |
Contributor
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $17.724580📊 Context and tokens usage:Claude Opus 4.7: (5 sub-sessions)
Total: (13.3K new + 457.8K cache writes + 23.0M cache reads) input tokens, 132.2K output tokens, $17.724580 cost 🤖 Models used:
📎 Log file uploaded as Gist (7737KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
Contributor
Author
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This reverts commit 94783e4.
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.
Summary
Adds configurable CPU and RAM limits for the MCP Playwright browser sidecar container, separate from the main service container's limits. This addresses #259, which reported that the Playwright sidecar could consume too many host resources.
--playwright-cpu(alias--playwright-cpus) and--playwright-ram(alias--playwright-memory).parser-options,parser-apply)template-defaults)apply-overrides)resource-limits)templates/docker-compose)--cpu/--ramflags: percent (30%), absolute CPU (1.5), and absolute RAM (512m,4g, etc.).Reproduction
Before this change, the MCP Playwright sidecar inherited only the main
--cpu/--ramlimits (or none), so Chromium could consume a large share of host resources during long browsing sessions.After this change:
produces a
docker-compose.ymlwhere:servicehascpus: <50% of host>andmem_limit/memswap_limit: <50% of host>playwrighthascpus: <20% of host>andmem_limit/memswap_limit: 1500mWhen
--playwright-*flags are omitted, the sidecar falls back to the main service limits, and when those are also omitted, it uses the 30% default.Implementation notes
packages/lib, mirror atpackages/app/src/lib, and frontend subset atpackages/app/src/docker-git/frontend-lib); all three were updated together.resource-limits.ts(newresolveResourceLimitsIntenthelper) to keepcommand-builders.tsunder the 300-line ESLint cap.apply-overrides.tswas split intoapplyTokenOverrides+applyResourceOverridesto satisfy the 50-line-per-function cap.Test plan
bun run typecheckpasses (exit 0)bun run lintpasses (exit 0)bun run testpasses — 273 app tests + 173 lib testspackages/lib/tests/core/resource-limits.test.ts— defaults & explicit overrides for playwright limitspackages/lib/tests/core/templates.test.ts— docker-compose template emits separate sidecar limitspackages/app/tests/docker-git/parser-playwright-resource.test.ts— CLI parser accepts new flags and aliasesChangeset
.changeset/playwright-resource-limits.md(minor bump for@prover-coder-ai/docker-gitand@effect-template/lib)Closes #259