@@ -234,19 +234,20 @@ def get_agent_config(self):
234234 self .add_agent (self .AGENT_NAME , {})
235235 return agent_config
236236
237- def update_agent_config (self , new_config ):
237+ def update_agent_config (self , new_config , config_key ):
238238 agent_name = self .AGENT_NAME
239239 agent_config_file = os .path .join ("agents" , agent_name , "config.json" )
240240 if os .path .exists (agent_config_file ):
241241 with open (agent_config_file , "r" ) as f :
242242 current_config = json .load (f )
243243
244- # Ensure the "settings" key is present in the current configuration
245- if "settings" not in current_config :
246- current_config ["settings" ] = {}
244+ # Ensure the config_key is present in the current configuration
245+ if config_key not in current_config :
246+ current_config [config_key ] = {}
247247
248- # Update the "settings" key with new_config
249- current_config ["settings" ].update (new_config )
248+ # Update the specified key with new_config while preserving other keys and values
249+ for key , value in new_config .items ():
250+ current_config [config_key ][key ] = value
250251
251252 # Save the updated configuration back to the file
252253 with open (agent_config_file , "w" ) as f :
0 commit comments