π OpenHands: AI-Driven Development
Fix init order in the agent controller (#4796)
Engel Nyst2b3fd9454034
diff --git a/openhands/controller/agent_controller.py b/openhands/controller/agent_controller.pyindex bb3e4ae56c..c5a73aeb62 100644--- a/openhands/controller/agent_controller.py+++ b/openhands/controller/agent_controller.py@@ -105,6 +105,12 @@ class AgentController:self.agent = agentself.headless_mode = headless_mode+ # subscribe to the event stream+ self.event_stream = event_stream+ self.event_stream.subscribe(+ EventStreamSubscriber.AGENT_CONTROLLER, self.on_event, self.id+ )+# state from the previous session, state from a parent agent, or a fresh stateself.set_initial_state(state=initial_state,@@ -112,12 +118,6 @@ class AgentController:confirmation_mode=confirmation_mode,)- # subscribe to the event stream- self.event_stream = event_stream- self.event_stream.subscribe(- EventStreamSubscriber.AGENT_CONTROLLER, self.on_event, self.id- )-self.max_budget_per_task = max_budget_per_taskself.agent_to_llm_config = agent_to_llm_config if agent_to_llm_config else {}self.agent_configs = agent_configs if agent_configs else {}