feat: increase default agent memory limit to 6GB and enable swap#1360
feat: increase default agent memory limit to 6GB and enable swap#1360
Conversation
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
There was a problem hiding this comment.
Pull request overview
This PR increases the agent container’s default memory limit and changes swap configuration to reduce OOM-kills (exit 137) when running heavier workloads on GitHub Actions runners.
Changes:
- Increase default agent
mem_limitfrom2gto6g. - Change default agent
memswap_limitfrom2g(no swap) to-1(unlimited swap), while keeping “no swap” when an explicit--memory-limitis provided. - Update CLI help text, JSDoc defaults, and unit test expectations.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/types.ts | Updates documented default for WrapperConfig.memoryLimit to 6g. |
| src/docker-manager.ts | Adjusts generated docker-compose resource limits (memory + swap behavior). |
| src/docker-manager.test.ts | Updates expected defaults for agent mem_limit/memswap_limit. |
| src/cli.ts | Updates --memory-limit help text and default value. |
Comments suppressed due to low confidence (1)
src/types.ts:322
- The
WrapperConfig.memoryLimitdocs now say the default is 6g, but the swap behavior changed as well (default swap enabled/unlimited vs swap disabled when the user explicitly sets--memory-limit). It would help to document this coupling here (or reference a separatememswapsetting) so API/SDK consumers understand why providingmemoryLimitalso changes swap behavior.
/**
* Memory limit for the agent execution container
*
* Accepts Docker memory format: a positive integer followed by a unit suffix
* (b, k, m, g). Controls the maximum amount of memory the container can use.
*
* @default '6g'
* @example '4g'
* @example '512m'
*/
memoryLimit?: string;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 'Memory limit for the agent container (e.g., 4g, 6g, 8g, 512m). Default: 6g', | ||
| '6g' |
| // with swap unlimited so the kernel can use swap as a pressure valve | ||
| // instead of immediately OOM-killing the agent process. | ||
| mem_limit: config.memoryLimit || '6g', | ||
| memswap_limit: config.memoryLimit ? config.memoryLimit : '-1', // Disable swap when user specifies limit |
| // Verify resource limits | ||
| expect(agent.mem_limit).toBe('2g'); | ||
| expect(agent.memswap_limit).toBe('2g'); | ||
| expect(agent.mem_limit).toBe('6g'); | ||
| expect(agent.memswap_limit).toBe('-1'); | ||
| expect(agent.pids_limit).toBe(1000); |
🏗️ Build Test Suite Results
Overall: 0/8 ecosystems passed — ❌ FAIL ❌ Error DetailsALL_CLONES_FAILED: All 8 repository clones failed because This affected every ecosystem:
Resolution: Add
|
This comment has been minimized.
This comment has been minimized.
Smoke Test (Oracle)🔮 The ancient spirits stir; the smoke-test agent was here. References: §23274556386
Warning
|
Agent container defaults to 2GB with no swap, causing OOM kills (exit 137) on GitHub Actions runners with 7GB RAM. Four repos consistently fail: prettier, k9s, stern, cowboy.
Changes
mem_limit:2g→6g(~85% of 7GB runner RAM)memswap_limit:2g→-1(unlimited swap as kernel pressure valve instead of immediate OOM kill)--memory-limitstill disables swap (memswap_limit=mem_limit), preserving existing behavior for explicit configs📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.