Bug
When AgentDB init fails (import error, missing file, SQLite corruption), AgentDBService silently falls back to InMemoryStore — an in-process Map<>. Writes succeed, the caller gets success: true, and all data vanishes on process restart.
The fallback pattern in every write method:
```typescript
if (this.reflexionMemory) {
try { /* real DB */ }
catch { this.reflexionMemory = null; } // PERMANENT null
}
return String(this.episodeStore.add(...)); // SILENT in-memory fallback
```
Impact
Users think data was persisted. It was not. No error, no warning. The backendName field is set to 'in-memory' but no MCP tool surfaces this to the user.
Proposed Fix
Add initError field. When init failed and a write is attempted against InMemoryStore, throw instead of silently accepting:
```
if (this.initError) throw new Error('AgentDBService in-memory fallback active — data will not persist');
```
Also add getFallbackStatus() public method for health check MCP tools.
Related: ADR-0076 controller-bridge analysis
ADR Reference
ADR-0075 Problem 5 (dead code in critical paths), ADR-0076 Track B
Bug
When AgentDB init fails (import error, missing file, SQLite corruption),
AgentDBServicesilently falls back toInMemoryStore— an in-processMap<>. Writes succeed, the caller getssuccess: true, and all data vanishes on process restart.The fallback pattern in every write method:
```typescript
if (this.reflexionMemory) {
try { /* real DB */ }
catch { this.reflexionMemory = null; } // PERMANENT null
}
return String(this.episodeStore.add(...)); // SILENT in-memory fallback
```
Impact
Users think data was persisted. It was not. No error, no warning. The
backendNamefield is set to'in-memory'but no MCP tool surfaces this to the user.Proposed Fix
Add
initErrorfield. When init failed and a write is attempted against InMemoryStore, throw instead of silently accepting:```
if (this.initError) throw new Error('AgentDBService in-memory fallback active — data will not persist');
```
Also add
getFallbackStatus()public method for health check MCP tools.Related: ADR-0076 controller-bridge analysis
ADR Reference
ADR-0075 Problem 5 (dead code in critical paths), ADR-0076 Track B