fix call_subordinate config copy bug

frdel committed Aug 12, 2025 at 14:25 UTC fac49e854bfe5736e945f7be08f6dd36b6af94ea
1 file changed +2 -1
python/tools/call_subordinate.py
+2 -1
@@ -1,5 +1,6 @@
1 from agent import Agent, UserMessage
2 from python.helpers.tool import Tool, Response
3 +import copy
4
5
6 class Delegation(Tool):
@@ -11,7 +12,7 @@ class Delegation(Tool):
12 or str(reset).lower().strip() == "true"
13 ):
14 # crate agent
14 - sub = Agent(self.agent.number + 1, self.agent.config, self.agent.context)
15 + sub = Agent(self.agent.number + 1, copy.deepcopy(self.agent.config), self.agent.context)
16 # register superior/subordinate
17 sub.set_data(Agent.DATA_NAME_SUPERIOR, self.agent)
18 self.agent.set_data(Agent.DATA_NAME_SUBORDINATE, sub)