Skip to content

Commit

Permalink
Fix init order in the agent controller (#4796)
Browse files Browse the repository at this point in the history
Co-authored-by: tofarr <[email protected]>
  • Loading branch information
enyst and tofarr authored Nov 6, 2024
1 parent 1bd46f3 commit 2b3fd94
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions openhands/controller/agent_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,19 @@ def __init__(
self.agent = agent
self.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 state
self.set_initial_state(
state=initial_state,
max_iterations=max_iterations,
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_task
self.agent_to_llm_config = agent_to_llm_config if agent_to_llm_config else {}
self.agent_configs = agent_configs if agent_configs else {}
Expand Down

0 comments on commit 2b3fd94

Please sign in to comment.