Repository navigation
Description
Description
OpenCode Desktop 1.18.3 allowed an agent-launched Node test process to drive a 64 GB Windows host from roughly 20% to 81% physical-memory use. Stopping the assistant stream terminated the child and memory returned to normal. The pattern recurred in two long-running sessions.
Chronology and scope
- The original host-memory incident was discovered in Codex Desktop and is tracked at [**SEVERE ISSUE**][Windows App 26.707.12708.0] single Node MCP child reaches 112 GB and exhausts system commit openai/codex#33724.
- Because Codex was unstable, the active workflow was recovered in OpenCode as a fallback.
- OpenCode then reproduced a related host-risk pattern, but with better attribution: the captured allocator was a shell-launched Node test runner.
- This report covers the OpenCode side only. It does not claim the Codex child and OpenCode child were the same package or root cause.
The captured local command family was:
pnpm exec tsx --test example.test.tsx
One affected session repeatedly launched the same full-file and focused test commands. The specific test was waiting for an impossible UI state, and a failed DOM-element assertion could allocate heavily while formatting the failure. Fixing that test made it complete normally, but OpenCode had no resource boundary preventing the bad child from destabilizing the host.
The affected OpenCode sessions used openai/gpt-5.6-sol and moved between xhigh, high, and medium. That is correlation, not proof that the model owns the allocation: the process consuming memory was the local shell-launched Node test runner.
Expected behavior:
- Agent shell subprocess trees should have configurable resource limits.
- Cancelling a stream should terminate the complete command tree.
- On Windows, command trees should use an OS process-tree boundary so a single child cannot exhaust host commit or survive its owner.
- The failing tool call should stop without taking down the desktop or host.
Local containment that worked:
- A plugin recognizes Node test commands only.
- Those commands run inside a Windows Job Object capped at 1.5 GB per process and 3 GB for the tree.
- Normal commands and the OpenCode desktop are not capped.
- A synthetic external-buffer allocation hit the boundary in under one second and left no child process behind.
Related issue distinctions
- [Bug]: Agent shell commands (parallel/heavy) crash the Opencode backend server on Windows #21550 is the closest prior Windows shell-resource report. It was automatically closed after 60 days of inactivity, and its closing comment explicitly says to open a new issue if the problem remains relevant.
- Memory Megathread #20695 requests heap snapshots for memory growth inside OpenCode. In this reproduction, the allocator was the spawned Node child, so an OpenCode-process heap snapshot would not capture the responsible child heap.
- bash tool hangs when command spawns background child processes #20902 concerns a shell waiting on inherited stdio from a background process. Here the foreground test process remained active and rapidly consumed host memory.
Plugins
At first reproduction: opencode-goal-plugin and a local checkpoint-continuity plugin. The Node memory-guard plugin was added afterward as mitigation.
OpenCode version
Desktop 1.18.3
Steps to reproduce
- Open a long-running OpenCode Desktop session on Windows.
- Have the agent repeatedly run a focused
tsx --testcomponent test whose failure path allocates heavily or does not converge. - Observe the Node child and host memory.
- Host memory can climb rapidly until the stream is cancelled.
- Cancel the stream; the child exits and memory returns to normal.
Screenshot and/or share link
Sanitized cross-harness evidence: openai/codex#33724. Private task names, repository paths, and session IDs are intentionally omitted.
Operating System
Windows 11 Pro x64, 64 GB RAM
Terminal
Windows PowerShell 5.1 through OpenCode Desktop
Activity
github-actions commentedon Jul 18, 2026
This issue might be a duplicate of or related to existing issues. Please check:
NedMalki-Chief commentedon Jul 18, 2026
Checked the three references and updated the report with the exact chronology and scope.
#21550is the closest prior case, but it was auto-closed for inactivity and its closing comment says to open a new issue if still relevant.#20695is focused on heap growth inside OpenCode; the allocator captured here was the spawned Node test child, so an OpenCode heap snapshot would not capture that child heap.#20902is an inherited-stdio/background-process hang, while this was an active foreground test process consuming host memory.The report is therefore intended as the current Windows 1.18.3 follow-up to
#21550, with the separate Codex-origin incident linked only for chronology.github-actions commentedon Sep 18, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.