Skip to content

External agent processes (Codex ACP / Claude ACP) are never terminated when threads close, leaking dozens of processes and GBs of RAM #61303

Description

@limaronaldo

Summary

Zed spawns external agent server processes (codex-acp, codex app-server, code-mode-host, claude-agent-acp) for Agent Panel threads, but never terminates them when a thread is closed or reset. Over a day of heavy agent usage, these accumulate as orphans.

Observed impact

After one day of use I found 55 live agent processes totaling 3.1 GB resident RSS (with virtual/compressed memory reported far higher by Activity Monitor). The oldest orphans were 2h+ old, belonging to threads long closed. Killing them manually (pkill -f codex-acp etc.) recovered ~2.6 GB immediately; Zed relaunches a clean process on the next thread with no ill effect.

Each codex app-server also loads the full skills/marketplace index into memory, so the per-process footprint multiplies quickly.

Steps to reproduce

  1. Open the Agent Panel with an external ACP agent (e.g. Codex).
  2. Start a thread, then close it (or start a new thread / reset).
  3. Repeat several times.
  4. ps aux | grep -E "codex-acp|codex app-server" — one process pair per thread remains, indefinitely.

Expected

Closing a thread (or at least quitting Zed) should terminate the associated agent server processes, or idle processes should be reaped after a timeout.

Environment

  • Zed 1.11.3 (stable)
  • macOS 26.5.2 (Darwin 25.5.0), Apple Silicon
  • Agents: Codex ACP (codex-acp / codex app-server), Claude Code ACP

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:needs triagetriage is not complete: no `area:*` label, or no `priority:*`/`frequency:*` for Bugs/Crashes

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions