Merge PR #229: fix(agent): copy conversation_history to avoid mutating caller's list
Authored by Farukest. Fixes #228. # Conflicts: # tests/test_run_agent.py
This commit is contained in:
@@ -2777,8 +2777,8 @@ class AIAgent:
|
||||
self._turns_since_memory = 0
|
||||
self._iters_since_skill = 0
|
||||
|
||||
# Initialize conversation
|
||||
messages = conversation_history or []
|
||||
# Initialize conversation (copy to avoid mutating the caller's list)
|
||||
messages = list(conversation_history) if conversation_history else []
|
||||
|
||||
# Hydrate todo store from conversation history (gateway creates a fresh
|
||||
# AIAgent per message, so the in-memory store is empty -- we need to
|
||||
|
||||
Reference in New Issue
Block a user