GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — opencode-pty daemon never reaps exited children (zombies accumulate) · Issue #64829 · anomalyco/opencode

opencode-pty daemon never reaps exited children (zombies accumulate) #64829

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
opencode-pty daemon never reaps exited children (zombies accumulate)#64829
Copy link
Labels
area/serviceBackground service and serverplatform/macosmacOStype/bugSomething is brokenversion/v2OpenCode 2.x

Description

@oppianmatt
oppianmatt
opened on Nov 19, 2026
Issue body actions

On macOS (Darwin 25.5.0), with opencode v2.3.0, the opencode-pty daemon 0.5.2 (~/.cache/opencode/bin/opencode-pty/0.5.2-ed3adb8c7531fef5) never reaps the shell processes it starts once they exit.

After two days of uptime, the daemon had 353 zombie children: ps -Ao stat,ppid | awk '$1 ~ /Z/ && $2==<daemon pid>' | wc -l. The count grows with every finished background shell job and only drops when the daemon exits.

Zombies use no CPU, but each holds a process-table slot, so a long-running server will eventually reach the per-user process limit.

Expected: the daemon calls waitpid (or handles SIGCHLD) for each child it spawns, as soon as that child exits.

Steps: run opencode serve, start and finish a few hundred background shell jobs through the pty tool, then count Z processes whose parent is the daemon.

Activity

  1. opencodejr commented on Nov 19, 2026

    @opencodejr
    opencodejrBot
    on Nov 19, 2026
    Contributor
    More actions

    Thanks for the clear report and the zombie count. I think this is a duplicate of #63817: on 2.3.0, the opencode-pty daemon 0.5.2 leaves finished shell commands as zombie children.

    These issues report the same problem or a related one, ordered from most to least likely:

    • pty: shell commands leave zombies under opencode-pty daemon on Linux (2.3.0) #63817: the same zombies under opencode-pty daemon on 2.3.0. It was reproduced and has since been closed as fixed.
    • opencode-pty daemon leaks zombie child processes (unbounded growth under single daemon PID) #63976: the same unbounded growth under a single daemon PID. It was also closed as fixed.
    • shell: every tool call stalls ~5s while the PTY daemon fails to reconnect (ECONNREFUSED /tmp/opencode-pty-<uid>/*.sock) #64080: a different opencode-pty daemon problem on macOS (each shell call stalls for about 5 seconds when the daemon fails to reconnect). It's listed only in case you see that too.

    The fix is in #64266, which makes the daemon reap each shell command when it exits and released @opencode/pty 0.6.0. #64251 then made OpenCode use 0.6.0, and the current code pins @opencode/pty 0.6.0. Please update OpenCode and restart the server, so that a new daemon starts. Then check that the daemon's path under ~/.cache/opencode/bin/opencode-pty/ shows 0.6.0, not 0.5.2.

    I'm closing this issue now as a duplicate of #63817. If zombies still build up with the 0.6.0 daemon, please add your details to #63817, including the OpenCode version, the daemon version and the zombie count. Replying here will also reopen this issue.

  2. opencodejr
    closed this as a duplicateof pty: shell commands leave zombies under opencode-pty daemon on Linux (2.3.0) #63817 on Nov 19, 2026
  3. opencodejr
    added
    area/serviceBackground service and server
    platform/macosmacOS
    type/bugSomething is broken
    version/v2OpenCode 2.x
    on Nov 19, 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

    area/serviceBackground service and serverplatform/macosmacOStype/bugSomething is brokenversion/v2OpenCode 2.x

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.