All-Hands-AI / OpenHands

🙌 OpenHands: Code Less, Make More
https://all-hands.dev
MIT License
34.22k stars 3.89k forks source link

Arch: make agent and runtime pluggable #3753

Open yufansong opened 2 months ago

yufansong commented 2 months ago

Summary

We put too much thing in EventStream , so it looks mess now. In order to make OH pluggable, Not only EventStream, but also need to simplify the controller logic.

Motivation Make the module pluggable. If someone want to try his agent, just replace the agent module. If someone want to interact with robot rather than docker, change the runtime module.

For example:

  1. Agent (Event+Action+ step logic)
  2. Runtime (How to interact with robot)

When we change the above logic, we can change openHands from a code generation platform into robot controll platform.

Technical Design

Our current logic:

  1. controller will call agent via function call.
  2. controller will communicate async with runtime via EventStream
  3. runtime will interact with docker via REST API. We implement a docker client inside the docker.

To achieve pluggable, we should optimize the interaction logic between controller with agent and controller with runtime. If we can decouple their logic, we can make agent/runtime as hot plug.

Alternatives to Consider

Additional context

imeDevelopers commented 2 months ago

@yufansong You've my support! Same ideas here: #3758

github-actions[bot] commented 3 days ago

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.