Skip to content

[CRITICAL] Data Persistence Failure & Faulty Error Handling: mempalace_add_drawer reports success despite result: null in logs #813

@oioix

Description

@oioix

Title: [CRITICAL] Data Persistence Failure & Faulty Error Handling: mempalace_add_drawer reports success despite result: null in logs*

Description

A critical bug has been identified in the MemPalace architecture involving two interconnected issues:

  1. Data Persistence Failure: The tool mempalace_add_drawer fails to physically write data to the persistent storage, even though the command is logged.
  2. Faulty Error Handling Logic (Agent-side): The Agent interprets a null result in the execution logs as a successful operation because no explicit error message is returned, leading to a false sense of data integrity.

Steps to Reproduce

  1. Initialize a session and attempt to create a new wing/drawer using mempalace_add_drawer (e.g., creating testwing2 with content: "Ich habe in meinem Leben schon diese Obstsorten gegessen").
  2. Observe the Agent's response: The tool execution log or the agent's interpretation indicates a successful operation (the agent receives a response from the tool).
  3. Verify via inspection: Run mempalace_list_wings or mempalace_list_drawers in a new session/chat.
  4. Result: The newly created wing/drawer is missing from the list.

Expected Behavior

  • Persistence: The tool mempalance_add_drawer must ensure that once an operation is initiated, the data is physically written to the persistent storage and is retrievable in subsequent sessions.
  • Error Handling: The system should not return null for a failed write operation. Furthermore, the Agent's logic must be updated to treat a result: null in the execution log as a failure/error rather than a success.

Actual Behavior

The system suffers from a "Silent Write Failure".

  • Investigation of wal/write_log.jsonl reveals that while the command is logged, the result field for the operation often returns null.
  • Agent-side Error: The Agent interprets the lack of an explicit error string as a success, masking the fact that the underlying database transaction failed.
  • Data disappears immediately after the session ends or even before the next command in the same session can verify it.

Evidence (Logs)

Tool Output observed during execution (Agent's view):

{
  "status": "success",
  "drawer_id": "drawer_test_wing_experiment_kirschen_7a2b8c9d1e3f4g5h6i7j",
  "wing": "test_wing",
  "room": "experiment",
  "content_preview": "Ich habe in meinem Leben schon diese Obstsorten gegessen",
  "timestamp": "2026-04-13T18:05:12Z"
}

Discrepancy in wal/write_log.jsonl (System Truth):
The log entry for the same operation shows:
"result": null

Environment/Context

  • OS: Mac OS 26.3.1 (a)
  • HArdware: MacBook M4 Pro 48GB RAM
  • MODEL: Gemma 4 27b
  • Component: MemPalace Toolset / Backend Persistence Layer / Agent Error-Handling Logic
  • Severity: Critical (Data Loss & False Positive Reporting)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions