Skip to content

Commit 3c3188c

Browse files
Merge pull request #1372 from MervinPraison/claude/issue-1371-20260414-0730
fix: resolve backend variable shadowing causing RuntimeError with memory=True
2 parents d76b56e + ec52231 commit 3c3188c

File tree

1 file changed

+5
-5
lines changed
  • src/praisonai-agents/praisonaiagents/agent

1 file changed

+5
-5
lines changed

src/praisonai-agents/praisonaiagents/agent/agent.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,18 +1042,18 @@ def __init__(
10421042
if _memory_config.auto_save is not None:
10431043
auto_save = _memory_config.auto_save
10441044
# Convert to internal format
1045-
backend = _memory_config.backend
1046-
if hasattr(backend, 'value'):
1047-
backend = backend.value
1045+
memory_backend = _memory_config.backend
1046+
if hasattr(memory_backend, 'value'):
1047+
memory_backend = memory_backend.value
10481048
# If learn is enabled, pass as dict to trigger full Memory class
10491049
if _memory_config.learn:
10501050
memory = _memory_config.to_dict()
1051-
elif backend == "file":
1051+
elif memory_backend == "file":
10521052
memory = True
10531053
elif _memory_config.config:
10541054
memory = _memory_config.config
10551055
else:
1056-
memory = backend
1056+
memory = memory_backend
10571057
elif hasattr(_memory_config, 'search') and hasattr(_memory_config, 'add'):
10581058
# Memory instance - pass through
10591059
pass

0 commit comments

Comments
 (0)