Files
PaperClipAI/server
c9c7fb3943 feat(runtime): clean up stale Paperclip runtime processes on startup
Detect and terminate orphaned Paperclip-owned Node-family runtime
processes that linger across worktree-local dev restarts and hold
embedded Postgres connections (the "too many clients" failure mode).

- local-service-supervisor: ps + /proc snapshot scanning, ownership
  evidence via allowlisted env markers or known Paperclip entrypoints,
  cwd/command-line containment under repo/worktree/instance roots,
  skipping the current process group and registered runtime services.
- index.ts: conservative pre-DB-startup cleanup hook (embedded PG only),
  gated by PAPERCLIP_STALE_RUNTIME_CLEANUP.
- workspace-runtime: cleanup during startup reconciliation + env markers
  on spawned runtime services.
- dev-runner: PAPERCLIP_MANAGED_RUNTIME / service-key env markers.
- doc/DEVELOPING.md: document the startup repair path.
- new server/src/__tests__/local-service-supervisor.test.ts (8 cases).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-06 20:05:19 +00:00
..
2026-03-12 13:09:22 -05:00