v1.2.1 — CLI/MCP table-name asymmetry fix
Fixed
CLI/MCP table-name asymmetry on collections_prefix values ending in _.
v1.2.0's src/bin/namespace-resolver.ts stripped a trailing underscore from collections_prefix before passing it to SqliteCortexStore, while src/mcp/server.ts had always passed the value verbatim. Both feed into the same ${this.ns}_${name} table-name builder at src/stores/sqlite.ts:301, so for any prefix ending in _ the two paths read and wrote different tables.
Concretely: a workspace with agent.yaml set to collections_prefix: anthems_ would see the MCP server write to anthems__memories while fozikio health --agent anthems queried the empty anthems_memories. The output was indistinguishable from the pre-v1.2.0 broken behaviour the resolver was introduced to fix.
The resolver now returns collections_prefix verbatim, matching the MCP server's de facto behaviour. MCP wrote first in real deployments, so its table layout is ground truth; aligning CLI to MCP preserves existing data with zero migration. The reverse fix (stripping in MCP too) would have orphaned every existing namespace's memories.
Test
namespace-resolver.test.ts renamed and inverted:
- was:
prefers collections_prefix (trailing underscore stripped) when set - now:
uses collections_prefix verbatim (no trailing-underscore strip)
110/110 tests still passing.
Upgrade
npm install @fozikio/cortex-engine@1.2.1No config changes required. If you're on v1.2.0 and your CLI commands have been reporting suspiciously empty stats while MCP queries work fine, this is your fix — upgrade and your data becomes visible to both paths simultaneously.
Full Changelog: v1.2.0...v1.2.1