Skip to content

hsetex called with string instead of HashDataPersistOptions enum in long_term_memory.py #263

@bsbodden

Description

@bsbodden

Bug

In agent_memory_server/long_term_memory.py (line 539, introduced in commit 64cf2b2 / PR #184), hsetex is called with data_persist_option="FXX" (a string literal):

result = await redis.hsetex(
    key,
    mapping={
        "topics": encode_tag_values(merged_topics),
        "entities": encode_tag_values(merged_entities),
    },
    data_persist_option="FXX",
    keepttl=True,
)

redis-py's hsetex expects Optional[HashDataPersistOptions] (an enum). Internally it calls data_persist_option.value, which fails on a plain string:

AttributeError: 'str' object has no attribute 'value'

This prevents the worker from completing memory extraction (topics/entities are never persisted).

Fix

from redis.commands.core import HashDataPersistOptions

# ...
data_persist_option=HashDataPersistOptions.FXX,

Metadata

Metadata

Assignees

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