Skip to content

bug: Missing Error Handling in LocalFileMemoryProvider #903

@fazlerahmanejazi

Description

@fazlerahmanejazi

Problem

The LocalFileMemoryProvider.loadFacts() method throws an uncaught SerializationException that crashes the entire memory system when encountering corrupted JSON files.
Current code (line 154):

private suspend fun loadFacts(path: Path): Map<String, List<Fact>> = mutex.withLock {
    val content = storage.read(path) ?: return emptyMap()
    return json.decodeFromString(content)  // No error handling
}

Expected behavior:

Log the error and return empty map so the agent can continue running.

Impact:

  • Agent crashes instead of continuing with valid memory data
  • No logging to debug the issue
  • Memory system becomes unusable until corrupted files are manually removed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions