Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

feat(mcp-host): log the conversation store path at open

Alfredo Lopeze56a639c376a
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.json
index d980fbf9b..b456fa4d5 100644
--- a/mcp-host/package-lock.json
+++ b/mcp-host/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.565",
+ "version": "0.1.566",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-mcp-host",
- "version": "0.1.565",
+ "version": "0.1.566",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@anthropic-ai/sdk": "^0.32.0",
diff --git a/mcp-host/package.json b/mcp-host/package.json
index 6cfa8b269..7b55eb592 100644
--- a/mcp-host/package.json
+++ b/mcp-host/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.565",
+ "version": "0.1.566",
"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/__tests__/conversationStoreFactory.test.ts b/mcp-host/src/core/conversation/persistence/__tests__/conversationStoreFactory.test.ts
index c09573472..f35b45dca 100644
--- a/mcp-host/src/core/conversation/persistence/__tests__/conversationStoreFactory.test.ts
+++ b/mcp-host/src/core/conversation/persistence/__tests__/conversationStoreFactory.test.ts
@@ -106,3 +106,57 @@ describe('createConversationStore persist failure', () => {
}
})
})
+
+describe('createConversationStore store identity', () => {
+ it('logs the resolved database path once for a sqlite store', async () => {
+ const script = workerScript(`
+ const { parentPort } = require('node:worker_threads')
+ parentPort.on('message', msg => {
+ if (msg.op.kind === 'ping') parentPort.postMessage({ id: msg.id, ok: true, result: 'pong' })
+ if (msg.op.kind === 'shutdown') {
+ parentPort.postMessage({ id: msg.id, ok: true, result: { ok: true } })
+ process.exit(0)
+ }
+ })
+ `)
+ const dbPath = path.join(path.dirname(script), 'state.db')
+ const info = vi.spyOn(logger, 'info')
+ try {
+ const handle = createConversationStore({
+ mode: 'sqlite',
+ dbPath,
+ cacheSize: 10,
+ syncTimeoutMs: 2000,
+ asyncTimeoutMs: 2000,
+ checkpointEveryWrites: 100,
+ heartbeatMs: 60_000,
+ workerScriptPath: script,
+ })
+ await expect(handle.persistQueue?.enqueueSync({ kind: 'ping' })).resolves.toBe('pong')
+ const opened = info.mock.calls.filter(([, msg]) => msg === '[ConversationStore] opened')
+ expect(opened).toEqual([[{ dbPath, mode: 'sqlite' }, '[ConversationStore] opened']])
+ await handle.shutdown()
+ } finally {
+ info.mockRestore()
+ }
+ })
+
+ it('logs no database path for a memory store', () => {
+ const info = vi.spyOn(logger, 'info')
+ try {
+ const handle = createConversationStore({
+ mode: 'memory',
+ cacheSize: 10,
+ syncTimeoutMs: 2000,
+ asyncTimeoutMs: 2000,
+ checkpointEveryWrites: 100,
+ heartbeatMs: 60_000,
+ })
+ // Liveness witness: the factory built the memory store.
+ expect(handle.mode).toBe('memory')
+ expect(info.mock.calls.filter(([, msg]) => msg === '[ConversationStore] opened')).toEqual([])
+ } finally {
+ info.mockRestore()
+ }
+ })
+})
diff --git a/mcp-host/src/core/conversation/persistence/conversationStoreFactory.ts b/mcp-host/src/core/conversation/persistence/conversationStoreFactory.ts
index dbe4dcbad..f686a8026 100644
--- a/mcp-host/src/core/conversation/persistence/conversationStoreFactory.ts
+++ b/mcp-host/src/core/conversation/persistence/conversationStoreFactory.ts
@@ -92,6 +92,9 @@ export function createConversationStore(
}
const worker = spawnWorker(opts) as unknown as WorkerLike & Worker
+ // One line per process names the database this Host reads and writes, so a
+ // Pod replacement that changes the store is visible in the Pod logs.
+ logger.info({ dbPath: opts.dbPath, mode: opts.mode }, '[ConversationStore] opened')
const persistQueue = new PersistQueue(worker, {
syncTimeoutMs: opts.syncTimeoutMs,
asyncTimeoutMs: opts.asyncTimeoutMs,