mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-09 14:57:59 -05:00
[Refactor, Fix]: Agent controller state/metrics management (#9012)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -232,8 +232,7 @@ class AgentSession:
|
||||
if self.event_stream is not None:
|
||||
self.event_stream.close()
|
||||
if self.controller is not None:
|
||||
end_state = self.controller.get_state()
|
||||
end_state.save_to_session(self.sid, self.file_store, self.user_id)
|
||||
self.controller.save_state()
|
||||
await self.controller.close()
|
||||
if self.runtime is not None:
|
||||
EXECUTOR.submit(self.runtime.close)
|
||||
@@ -439,10 +438,12 @@ class AgentSession:
|
||||
initial_state = self._maybe_restore_state()
|
||||
controller = AgentController(
|
||||
sid=self.sid,
|
||||
user_id=self.user_id,
|
||||
file_store=self.file_store,
|
||||
event_stream=self.event_stream,
|
||||
agent=agent,
|
||||
max_iterations=int(max_iterations),
|
||||
max_budget_per_task=max_budget_per_task,
|
||||
iteration_delta=int(max_iterations),
|
||||
budget_per_task_delta=max_budget_per_task,
|
||||
agent_to_llm_config=agent_to_llm_config,
|
||||
agent_configs=agent_configs,
|
||||
confirmation_mode=confirmation_mode,
|
||||
|
||||
Reference in New Issue
Block a user