Commit ec52231
committed
fix: resolve backend variable shadowing in Agent initialization
The issue was caused by a local variable 'backend' in the memory configuration
processing that was shadowing the 'backend' parameter from the Agent constructor.
When memory=True was passed to the Agent, the memory backend string (e.g., 'file')
was incorrectly assigned to self.backend instead of the external managed backend.
This caused a RuntimeError: Backend str does not support execute() method when
the Agent tried to delegate to what it thought was a managed backend but was
actually a string.
Changes:
- Rename local variable from 'backend' to 'memory_backend' to avoid shadowing
- Preserves the original backend parameter functionality
- Fixes the issue where memory=True would break external backend delegation
Fixes #1371
Co-authored-by: praisonai-triage-agent[bot] <praisonai-triage-agent[bot]@users.noreply.github.com>1 parent 81dfb6a commit ec52231
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1042 | 1042 | | |
1043 | 1043 | | |
1044 | 1044 | | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
1048 | 1048 | | |
1049 | 1049 | | |
1050 | 1050 | | |
1051 | | - | |
| 1051 | + | |
1052 | 1052 | | |
1053 | 1053 | | |
1054 | 1054 | | |
1055 | 1055 | | |
1056 | | - | |
| 1056 | + | |
1057 | 1057 | | |
1058 | 1058 | | |
1059 | 1059 | | |
| |||
0 commit comments