A MeMesh router has no idle or orphan exit: it stops only on SIGINT/SIGTERM (src/host-runtime/router.ts). Hosts start one detached when none is running for a data directory, and it reparents to PID 1. When a data directory is deleted or no longer used (a custom MEMESH_DIR that changed, a temporary directory, a test run), its router keeps running forever and serves nothing.
Seen while testing the Codex plugin against throwaway MEMESH_DIRs: six detached routers accumulated, one per directory, including directories that had already been deleted.
Scope: the default single data directory is unaffected (one long-lived router is intended).
Proposed fix: the router checks periodically that its data directory (or its socket path) still exists and exits when it does not. This is safe because hosts already start a replacement when no router answers. An additional idle exit (no registered sessions or pending deliveries for N minutes) is a product decision.
A MeMesh router has no idle or orphan exit: it stops only on SIGINT/SIGTERM (src/host-runtime/router.ts). Hosts start one detached when none is running for a data directory, and it reparents to PID 1. When a data directory is deleted or no longer used (a custom MEMESH_DIR that changed, a temporary directory, a test run), its router keeps running forever and serves nothing.
Seen while testing the Codex plugin against throwaway MEMESH_DIRs: six detached routers accumulated, one per directory, including directories that had already been deleted.
Scope: the default single data directory is unaffected (one long-lived router is intended).
Proposed fix: the router checks periodically that its data directory (or its socket path) still exists and exits when it does not. This is safe because hosts already start a replacement when no router answers. An additional idle exit (no registered sessions or pending deliveries for N minutes) is a product decision.