Separate agent controller and server via EventStream (#1538)

* move towards event stream

* refactor agent state changes

* move agent state logic

* fix callbacks

* break on finish

* closer to working

* change frontend to accomodate new flow

* handle start action

* fix locked stream

* revert message

* logspam

* no async on close

* get rid of agent_task

* fix up closing

* better asyncio handling

* sleep to give back control

* fix key

* logspam

* update frontend agent state actions

* fix pause and cancel

* delint

* fix map

* delint

* wait for agent to finish

* fix unit test

* event stream enums

* fix merge issues

* fix lint

* fix test

* fix test

* add user message action

* add user message action

* fix up user messages

* fix main.py flow

* refactor message waiting

* lint

* fix test

* fix test
This commit is contained in:
Robert Brennan
2024-05-05 15:20:01 -04:00
committed by GitHub
parent 4e84aac577
commit f7e0c6cd06
36 changed files with 433 additions and 494 deletions

View File

@@ -10,6 +10,7 @@ from opendevin.events.action.github import GitHubPushAction, GitHubSendPRAction
from opendevin.events.observation.commands import CmdOutputObservation
from opendevin.events.observation.error import AgentErrorObservation
from opendevin.events.observation.message import AgentMessageObservation
from opendevin.events.stream import EventStream
from opendevin.llm.llm import LLM
@@ -19,7 +20,8 @@ def agent_controller():
config.config[ConfigType.SANDBOX_TYPE] = 'local'
llm = LLM()
agent = DummyAgent(llm=llm)
controller = AgentController(agent)
event_stream = EventStream()
controller = AgentController(agent, event_stream)
yield controller