Skip to content

[SEVERE][Windows/Desktop 1.18.3] Node test subprocess can exhaust host memory #37597

Closed as not planned

Description

@NedMalki-Chief

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

  1. 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.
  2. Because Codex was unstable, the active workflow was recovered in OpenCode as a fallback.
  3. OpenCode then reproduced a related host-risk pattern, but with better attribution: the captured allocator was a shell-launched Node test runner.
  4. 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

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

  1. Open a long-running OpenCode Desktop session on Windows.
  2. Have the agent repeatedly run a focused tsx --test component test whose failure path allocates heavily or does not converge.
  3. Observe the Node child and host memory.
  4. Host memory can climb rapidly until the stream is cancelled.
  5. 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

  1. github-actions commented on Jul 18, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of or related to existing issues. Please check:

  2. NedMalki-Chief commented on Jul 18, 2026

    @NedMalki-Chief
    Author

    Checked the three references and updated the report with the exact chronology and scope.

    #21550 is the closest prior case, but it was auto-closed for inactivity and its closing comment says to open a new issue if still relevant. #20695 is 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. #20902 is 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.

  3. github-actions commented on Sep 18, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions