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:
commit
56b53bff6e
2 changed files with 35 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue