# Live repro on bb 16ceb3a54 (dev instance for this worktree; Linux x86_64, node v24.18.0, claude-code 2.1.234) $ curl -s -X POST $BB_SERVER_URL/api/v1/projects -H 'content-type: application/json' \ -d '{"name":"qa1660","source":{"type":"local_path","path":"/tmp/bb1660-repo","hostId":"host_e9dcahrvyx"}}' {"id":"proj_qqqpjz68py", ...} $ bb thread spawn --project proj_qqqpjz68py --new-environment worktree --provider claude-code \ --permission-mode full --title "orphan repro 1660" \ --prompt "Run exactly this shell command and nothing else: nohup sleep 100000 >/dev/null 2>&1 & disown ; then reply only with ok." --json { "id": "thr_dyb25avqn8", ..., "status": "starting" } # after the turn: environmentId env_tj4p2dg3ru, worktree at # ~/.bb-dev//worktrees/env_tj4p2dg3ru/bb1660-repo $ ./find-worktree-procs.sh ~/.bb-dev//worktrees/env_tj4p2dg3ru pid=1184169 ppid=1178110 cwd=.../worktrees/env_tj4p2dg3ru/bb1660-repo cmd=node ... (provider bridge, child of host daemon 1178110) pid=1184228 ppid=1184169 cwd=.../worktrees/env_tj4p2dg3ru/bb1660-repo cmd=/home/sawyer/.local/bin/claude --output-format stream-json ... pid=1185882 ppid=1 cwd=.../worktrees/env_tj4p2dg3ru/bb1660-repo cmd=sleep 100000 <-- agent-spawned background process, already reparented to init $ bb thread archive thr_dyb25avqn8 Thread thr_dyb25avqn8 archived $ sqlite3 /bb.db "select id,status,retire_requested_at from environments where id='env_tj4p2dg3ru';" env_tj4p2dg3ru|retiring|1787028007413 # ... 5-minute MANAGED_ENVIRONMENT_RETIRE_GRACE_MS elapses, server dispatches environment.destroy ... $ sqlite3 /bb.db "select id,status,path from environments where id='env_tj4p2dg3ru';" env_tj4p2dg3ru|destroyed| $ ls ~/.bb-dev//worktrees/env_tj4p2dg3ru ls: cannot access '...': No such file or directory $ ./find-worktree-procs.sh ~/.bb-dev//worktrees/env_tj4p2dg3ru pid=1185882 ppid=1 cwd=/home/sawyer/.bb-dev/projects-bb-.claude-worktrees-wf_debcf606-e4a-7-ffe168ad615c/worktrees/env_tj4p2dg3ru/bb1660-repo (deleted) cmd=sleep 100000 $ ps -o pid,ppid,stat,etime,cmd -p 1185882 PID PPID STAT ELAPSED CMD 1185882 1 S 06:10 sleep 100000 # The bridge (1184169) and claude (1184228) processes DID exit at destroy (runtime.shutdown() runs # before workspace.destroy()). The background process the agent started did not; nothing looks at it.