Skip to content

adk dev leaks its opencode serve child on exit/kill — orphans accumulate at ~230 MB RSS each #39

Description

@johnf

Environment: adk CLI 2.0.1 (linux-x64 release binary); Ubuntu (kernel 6.17).

Each adk dev boot spawns an opencode serve child. When the parent adk dev dies — killed, crashed, or exited — the child is not terminated: it reparents to init/systemd and keeps running. On a day of repeated dev-server restarts (working around eval-run fragility reported separately) we accumulated 13 orphaned opencode serve processes at roughly 230 MB RSS each (~3 GB total), one per restart.

Expected: the child dies with the parent (process group kill, prctl PDEATHSIG, or an exit handler), or at minimum adk dev reaps stale instances on its next boot.

Repro:

  1. adk dev (note the opencode serve child in pgrep -af 'opencode serve').
  2. Kill the parent (Ctrl-C or kill <pid>; also happens when it crashes).
  3. The opencode serve process is still running, now parented to init. Repeat to accumulate.

Workaround: pkill -f "opencode serve" after killing adk dev.

Metadata

Metadata

Assignees

No one assigned

    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