Skip to content

[Windows App] Sandbox process outlives completed subagent and continues consuming memory #33894

Open

Description

@cuoicungtui

What version of the Codex App are you using?

26.707.12708.0

What platform is your computer?

Microsoft Windows 11 Home Single Language, version 10.0.26200, x64

What issue are you seeing?

A process started from a subagent's sandbox continued running after the Codex task and all subagents were shown as completed.

The important issue is not pytest itself. Pytest was only the workload that exposed the lifecycle problem. The sandbox/process tree did not appear to be cleaned up when the owning subagent finished.

Observed process:

python -m pytest -q tests/test_upload_file_matrix.py
child PID: 24140
parent PID: 17308
original launcher PID: 33532 (already exited when inspected)

The process continued for approximately 2 hours 24 minutes after the agent/subagents had completed. Its memory usage kept increasing rather than stopping at a fixed allocation:

  • Python process observed at approximately 12,191.7 MB
  • System memory reached 46.7 / 47.7 GB (98%)
  • Disk activity also became elevated

The Codex UI showed 2 subagents done, while the Python process created by the agent workflow was still alive.

Codex task ID:

019f6df8-938d-7590-8b83-83e650374f99

What steps can reproduce the bug?

I do not yet have a minimal deterministic reproduction, but the observed flow was:

  1. Run a Codex task that delegates work to subagents.
  2. A subagent starts a long-running child process inside its execution environment.
  3. Allow the subagent and parent task to complete; the UI reports the subagents as done.
  4. Inspect host processes after completion.
  5. Observe that the child process remains alive and continues consuming increasing memory.

What is the expected behavior?

When a subagent finishes, Codex should do one of the following:

  • terminate and reap every process owned by that subagent's sandbox/process group; or
  • explicitly transfer ownership of intentional background processes and show that they are still running.

A task/subagent should not be reported as fully complete while an unbounded process it created continues running invisibly.

Sandbox cleanup should include:

  • descendant process-tree termination
  • bounded graceful shutdown followed by forced termination
  • timeout and memory limits
  • visible reporting of any intentionally retained background process

Additional information

This appears related in theme to process lifecycle cleanup, but it is not the same reproduction as #18881, which concerns MCP child processes on Linux. This report concerns a general workload process surviving a completed subagent on the Windows Codex App.

Screenshots captured during the incident show:

  • Codex reporting two subagents as done while the Python process remained active
  • the Python process using about 12.2 GB RAM
  • total system memory at 98%

I can provide the original screenshots and further diagnostics if needed.

Activity

  1. added
    bug
    app
    windows-os
    sandbox
    subagent
    on Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugperformancesandboxsubagentwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions