Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/surreal_memory/storage/surrealdb/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,8 @@ async def delete_neuron(self, neuron_id: str) -> bool:
brain_id=brain_id,
nid=sid,
)
# Delete state
await self._query(f"DELETE neuron_state:{sid}")
# Delete state (record id is state_<sid>, matching the writer in add_neuron)
await self._query(f"DELETE neuron_state:state_{sid}")

try:
await conn.delete(f"neuron:{sid}")
Expand All @@ -616,7 +616,7 @@ async def get_neuron_state(self, neuron_id: str) -> NeuronState | None:
conn = self._ensure_conn()
sid = _to_surreal_id(neuron_id)
try:
result = await conn.select(f"neuron_state:{sid}")
result = await conn.select(f"neuron_state:state_{sid}")
if result:
return _row_to_neuron_state(result[0] if isinstance(result, list) else result)
except Exception:
Expand All @@ -640,7 +640,7 @@ async def update_neuron_state(self, state: NeuronState) -> None:
if state.refractory_until:
update_data["refractory_until"] = state.refractory_until

await conn.merge(f"neuron_state:{sid}", update_data)
await conn.merge(f"neuron_state:state_{sid}", update_data)

# ================================================================
# Synapse Operations
Expand Down
Loading