Skip to content

fix(sandbox): raise agentweaver-exec memory limit 2Gi→4Gi to prevent preview server OOM - #931

Merged
sabbour merged 5 commits into
devfrom
fix/930-sandbox-exec-oom-memory-limit
Aug 25, 2026
Merged

fix(sandbox): raise agentweaver-exec memory limit 2Gi→4Gi to prevent preview server OOM#931
sabbour merged 5 commits into
devfrom
fix/930-sandbox-exec-oom-memory-limit

Conversation

@sabbour

@sabbour sabbour commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Problem

When an agent runs start_preview, the Node.js/Vite preview server runs inside agentweaver-exec alongside the agent process. The combined memory footprint exceeds the 2Gi container limit and the kernel OOM-kills the preview server (exit 137).

Reproducer: orchestration 7a0bc933-6f7a-4aaa-b7a3-0a6c4b33d12c — agent Bryant tasked with building a Trailhead Travel Studio landing page; preview never registered; beat 2.5 (approval gate) never fired.

Fix

Raise agentweaver-exec container resources in k8s/base/sandbox-template-agenthost.yaml:

  • Memory request: 1Gi → 2Gi
  • Memory limit: 2Gi → 4Gi

The existing comment on the file already said 'Node/Next already needs the container's 4Gi memory budget' — the limit was simply never raised to match.

Trade-off

Pod-level scheduling density on katapool nodes drops from ~3 pods/node to ~2 pods/node (2×6Gi=12Gi ≤ 16Gi real). This is acceptable: a pool that fits 3 agents but OOM-kills their preview servers provides effectively less throughput than one that reliably runs 2.

Verification

  • kubectl apply with new manifest succeeds (dry-run)
  • agent-host pod shows updated memory limits: kubectl get pod -n agentweaver -l app=agentweaver-agent-host -o jsonpath='{.items[0].spec.containers[?(@.name=="agentweaver-exec")].resources}'
  • Preview server registration succeeds end-to-end on next demo run

Closes #930

Copilot AI added 4 commits August 25, 2026 06:55
Squad state externalized to %APPDATA%\squad\projects\agentweaver\.
.squad/config.json is now machine-local and should not be committed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 11857092-1327-41bd-8708-b2ca85e674dd
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 11857092-1327-41bd-8708-b2ca85e674dd
squad.agent.md upgraded to v0.12.0
Squad workflows upgraded (5 files)
Skills moved from .copilot/skills/ to .github/skills/
squad_state MCP server pinned to 0.12.0
Squad state externalized to %APPDATA%\squad\projects\agentweaver\
.squad/config.json gitignored (machine-local external state marker)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 11857092-1327-41bd-8708-b2ca85e674dd
@sabbour
sabbour force-pushed the fix/930-sandbox-exec-oom-memory-limit branch 2 times, most recently from 152f3d7 to da981a5 Compare August 25, 2026 21:48
…preview server OOM

When an agent runs start_preview, the Node.js/Vite preview server runs inside
agentweaver-exec alongside the agent process. The combined memory footprint
regularly exceeds the 2Gi container limit, OOM-killing the preview server
(exit 137) before the agent can register the preview URL.

The existing comment already noted that Node/Next needs a 4Gi budget; the
limit was simply never raised. Increasing to 4Gi matches the intent.

Pod-level scheduling density drops from ~3 pods/katapool node to ~2, but
the node's 16Gi real memory is still not exceeded (2x6Gi=12Gi).

Closes #930

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7762866f-fa88-4087-b5df-17f482d36ec0
@sabbour
sabbour enabled auto-merge (squash) August 25, 2026 21:49
@sabbour
sabbour merged commit 70b653f into dev Aug 25, 2026
12 of 13 checks passed
@sabbour
sabbour deleted the fix/930-sandbox-exec-oom-memory-limit branch August 25, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preview sandbox OOM killed (exit 137) when agent starts preview server — 2Gi limit too low

2 participants