Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
docs(mcp-host): state which writes persist queue close drains
Alfredo Lopez70a5fe60c00d
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.jsonindex b1d8cbf2d..6206db95d 100644--- a/mcp-host/package-lock.json+++ b/mcp-host/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-mcp-host",- "version": "0.1.570",+ "version": "0.1.571","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-mcp-host",- "version": "0.1.570",+ "version": "0.1.571","license": "SEE LICENSE IN LICENSE","dependencies": {"@anthropic-ai/sdk": "^0.32.0",diff --git a/mcp-host/package.json b/mcp-host/package.jsonindex f31a53e19..5a3eab112 100644--- a/mcp-host/package.json+++ b/mcp-host/package.json@@ -1,6 +1,6 @@{"name": "clerum-mcp-host",- "version": "0.1.570",+ "version": "0.1.571","description": "MCP Host - reads Host CRD and provides LLM access via OpenAI/Claude","main": "dist/main.js","engines": {diff --git a/mcp-host/src/core/conversation/persistence/persistQueue.ts b/mcp-host/src/core/conversation/persistence/persistQueue.tsindex fd8e4d88e..b089fc968 100644--- a/mcp-host/src/core/conversation/persistence/persistQueue.ts+++ b/mcp-host/src/core/conversation/persistence/persistQueue.ts@@ -234,10 +234,14 @@ export class PersistQueue {}/**- * Graceful shutdown: close admission, drain every queued write, wait for the- * worker to ACK `shutdown` (it closes the database before replying), then- * terminate it. Rejects with the first write failure, or with the shutdown- * failure, so the caller sees that the durable trail is incomplete.+ * Graceful shutdown: close admission, drain the keyed writes in+ * `writeChain` (async writes and sync writes with a `sessionKey`), wait for+ * the worker to ACK `shutdown` (it closes the database before replying),+ * then terminate it. A sync write without a `sessionKey` is not in+ * `writeChain`; if the worker is still retrying it on a busy database,+ * `shutdown` can close the database first and the write is rejected.+ * Rejects with the first write failure, or with the shutdown failure, so+ * the caller sees that the durable trail is incomplete.*/close(): Promise<void> {// A second caller waits for the same shutdown instead of returning early.