Skip to content

Commit ed259c5

Browse files
committed
fix agent state
1 parent bbe8dcd commit ed259c5

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

opendevin/controller/agent_controller.py

-7
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,6 @@ async def set_agent_state_to(self, new_state: AgentState):
221221

222222
def get_agent_state(self):
223223
"""Returns the current state of the agent task."""
224-
if self.delegate is not None:
225-
agent_state = self.delegate.get_agent_state()
226-
if agent_state not in (AgentState.FINISHED, AgentState.STOPPED):
227-
return agent_state
228-
else:
229-
# then we return parent state
230-
return self.state.agent_state
231224
return self.state.agent_state
232225

233226
async def start_delegate(self, action: AgentDelegateAction):

opendevin/core/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ async def on_event(event: Event):
123123
event_stream.add_event(action, EventSource.USER)
124124

125125
event_stream.subscribe(EventStreamSubscriber.MAIN, on_event)
126-
while controller.get_agent_state() not in [
126+
while controller.state.agent_state not in [
127127
AgentState.FINISHED,
128128
AgentState.REJECTED,
129129
AgentState.ERROR,

0 commit comments

Comments
 (0)