Skip to content

Commit

Permalink
fix: patch bad runtime error related to memory access (SandboxReturn.…
Browse files Browse the repository at this point in the history
…agent_stateis Optional, so not guaranteed to exist)
  • Loading branch information
cpacker committed Dec 23, 2024
1 parent 2623144 commit 5ecb913
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions letta/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ def execute_tool_and_persist_state(self, function_name: str, function_args: dict
)
function_response, updated_agent_state = sandbox_run_result.func_return, sandbox_run_result.agent_state
assert orig_memory_str == self.agent_state.memory.compile(), "Memory should not be modified in a sandbox tool"

self.update_memory_if_change(updated_agent_state.memory)
if updated_agent_state is not None:
self.update_memory_if_change(updated_agent_state.memory)
except Exception as e:
# Need to catch error here, or else trunction wont happen
# TODO: modify to function execution error
Expand Down

0 comments on commit 5ecb913

Please sign in to comment.