Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.
docs(node-services): centralize shared HTTP shutdown rules
Tsan102496b67d926336
diff --git a/apps/node-services/AGENTS.md b/apps/node-services/AGENTS.mdindex ccccaef9..a979fbb1 100644--- a/apps/node-services/AGENTS.md+++ b/apps/node-services/AGENTS.md@@ -14,8 +14,9 @@not collide. The host alone answers `/healthz` (process alive), `/startupz`(every selected role started), and `/readyz` (started and every mountedrole's readiness ok); roles must not register their own probes.- Stopping Memory unmounts only its own routes. A shared listener and other- roles remain available, and a replacement Memory server can mount again.+ When a role closes, it calls the unmount function returned by `mount()`;+ it never closes a shared listener. Only the host owns that listener's+ lifecycle, so other roles remain available and replacements can mount.- The `document` role keeps its own port (4321 by default) on its own workerthread (`src/document/main.ts`) because it installs jsdom globals andreplaces the global `Request`/`Response`. The `voice` role supervises separate ASR, recorder and Live child processes (ports 4324–4326); it does not run audio jobs on the main thread. Voice workers follow TeamHub's effective provider keys (`GET /internal/v1/voice/provider-keys` with the `voice-runtime` credential): a Soniox key runs ASR and recorder, an xAI key runs Live. The role reconciles at startup, on TeamHub's `POST /v1/voice/workers:reconcile` (`node-services-internal` bearer), and every 60 seconds, so workers start, drain, or restart with a new key without restarting node-services. The reconcile route answers `{ready}` only after every wanted worker's health port reports it registered with LiveKit, or after 20 seconds, so TeamHub answers a key save once a voice session can be dispatched. Keys reach a worker only through its environment; a failed key fetch leaves the running workers unchanged. Other roles run on the main threaddiff --git a/apps/node-services/README.md b/apps/node-services/README.mdindex 7d2edd30..09ea3e48 100644--- a/apps/node-services/README.md+++ b/apps/node-services/README.md@@ -2,15 +2,6 @@Node Services is one Node process started by role. It hosts the Agent Service (Agent lifecycle, Runtime execution and TeamHub callbacks), Memory, LLM Wiki and the Document Runtime. The Agent Service, Memory and LLM Wiki share one HTTP port (4319 by default) and route by path; the Document Runtime listens on 4321 in its own worker thread. All roles ship in one deployment image.-## Shared HTTP lifecycle--When the Memory server closes, it unregisters its own routes from the shared-HTTP host. Requests to those routes then return 404; other roles and the-listener remain available. A replacement Memory server can register the same-routes. Closing an old instance again does not unregister its replacement.-When Memory creates a private listener instead, closing Memory also closes-that listener.-The Agent Service owns no persisted collaboration state such as Accounts, Rooms or Work Items; TeamHub owns it.Commands, conventions and boundaries are in [AGENTS.md](./AGENTS.md).