XYZNOT

Papers · arXiv 2407.16741

OpenHands: An Open Platform for AI Software Developers as Generalist Agents

Published cs.SEcs.AIcs.CL arXivPDF

Read with translation and AI

Summary in three lines

  1. 🎯 Building, maintaining, and safely evaluating AI software agents across diverse code and web tasks requires standardized sandboxes, tools, and reproducible benchmarks.
  2. 🔧 OpenHands pairs an event stream architecture with Docker sandboxes, an extensible AgentSkills library, BrowserGym-based navigation, multi-agent delegation, and integration testing with mocked LLMs.
  3. 📈 Using Claude 3.5 Sonnet without benchmark-specific prompt tuning, CodeActAgent attains a 26.0% resolve rate on SWE-Bench Lite, 15.3% on WebArena, and 52.0% on GPQA Diamond.

Abstract

Software is one of the most powerful tools that we humans have at our disposal; it allows a skilled programmer to interact with the world in complex and profound ways. At the same time, thanks to improvements in large language models (LLMs), there has also been a rapid development in AI agents that interact with and affect change in their surrounding environments. In this paper, we introduce OpenHands (f.k.a. OpenDevin), a platform for the development of powerful and flexible AI agents that interact with the world in similar ways to those of a human developer: by writing code, interacting with a command line, and browsing the web. We describe how the platform allows for the implementation of new agents, safe interaction with sandboxed environments for code execution, coordination between multiple agents, and incorporation of evaluation benchmarks. Based on our currently incorporated benchmarks, we perform an evaluation of agents over 15 challenging tasks, including software engineering (e.g., SWE-BENCH) and web browsing (e.g., WEBARENA), among others. Released under the permissive MIT license, OpenHands is a community project spanning academia and industry with more than 2.1K contributions from over 188 contributors.

Reading guide

Problem and motivation

Software development is among the most expressive interfaces through which humans interact with the digital world. While large language models (LLMs) can generate isolated snippets, real-world software engineering demands long-horizon interaction: navigating repositories, modifying multi-file architectures, executing bash commands, reading documentation via web browsers, and self-debugging using execution feedback.

Prior agent frameworks often suffered from key architectural gaps: lack of isolated execution environments, stateless code runners, missing multi-modal web browsing capabilities, or absence of standardized evaluation tooling across heterogeneous domains. OpenHands (formerly OpenDevin) addresses this need with an open-source platform (MIT licensed) offering sandboxed runtime environments, extensible Agent-Computer Interfaces (ACI), multi-agent coordination, and standardized benchmarking.

Key ideas

  • Event Stream Architecture: User instructions, agent actions, and runtime observations are tracked chronologically in an event stream that unifies communication across frontends, agents, and sandboxed runtimes.
  • Programming Language (PL) Primitives: Instead of brittle custom APIs, agent interactions are grounded in general actions: IPythonRunCellAction, CmdRunAction, and BrowseInteractiveAction (via BrowserGym).
  • Extensible AgentSkills: A modular Python package preloaded into the IPython kernel provides high-level utilities (e.g., AST-grounded line editing edit_file, PDF parsing, multimodal image extraction) without reinventing existing packages.
  • Agent Delegation: Specialist agents handle domain-specific workflows (e.g., delegating web tasks via AgentDelegateAction to a dedicated BrowsingAgent).
  • Quality Control via Mocked Testing: Routine continuous integration tests prompt regressions, actions, and sandbox stability using deterministic prompt-response caching instead of expensive real-time API calls.

Method (with the key equations)

The OpenHands execution cycle operates on a discrete step function where the agent maps an environment state to an action : Here, the state encapsulates the chronological history of prior actions and observations: where tracks auxiliary state metadata (cumulative LLM cost, active multi-agent delegation stack, configuration parameters).

The action space includes:

  • CmdRunAction(command): Runs arbitrary bash commands in the target Linux shell.
  • IPythonRunCellAction(code): Executes stateful Python code in a persistent Jupyter kernel, exposing AgentSkills.
  • BrowseInteractiveAction(code): Executes Playwright-driven BrowserGym primitives (click(bid), fill(bid, val), goto(url), etc.).
  • AgentDelegateAction(subtask, agent_name): Pushes a sub-goal onto the agent stack to summon a specialist.
  • AgentFinishAction(): Concludes execution.

Execution occurs within a secure client-server Docker sandbox. Base Docker containers are extended with an OpenHands REST API server (runtime.py), tagged using a dual-tagging mechanism: a content MD5 hash (target_image_repo:target_image_hash_tag) for strict reproducibility, and a semantic generic tag (runtime:oh_v{VERSION}_{BASE_IMAGE}_tag_{IMAGE_TAG}) for cached base-layer builds.

Results (with the most important numbers)

OpenHands evaluates generalist agents across 15 benchmarks spanning software engineering, web browsing, and general assistance without per-benchmark prompt tailoring:

  • SWE-Bench Lite (300 instances, w/o hints): CodeActAgent v1.8 with claude-3-5-sonnet@20240620 achieves a resolve rate (average cost $1.10 per instance), outperforming SWE-Agent () and AutoCodeRover (), and approaching Aider ().
  • HumanEvalFix (164 instances): CodeActAgent v1.5 with gpt-4o-2024-05-13 solves in a 0-shot self-debugging setup (compared to StarCoder2-15B's ).
  • WebArena (812 instances): BrowsingAgent v1.0 achieves using claude-3-5-sonnet and using gpt-4o, while CodeActAgent v1.8 via delegation reaches .
  • MiniWoB++ (125 environments): Zero-shot BrowsingAgent v1.0 with gpt-4o achieves .
  • General Assistance & Reasoning:
    • GPQA Diamond: CodeActAgent v1.8 + claude-3-5-sonnet scores (surpassing expert human baseline at , but outperforming few-shot CoT GPT-4 at ).
    • GAIA (L1 Validation): GPTSwarm v1.0 with gpt-4o reaches ( for AutoGPT).
    • AgentBench (OS subset): CodeActAgent v1.5 achieves .
    • MINT (Math / Code): CodeActAgent v1.5 hits on math and on code.

Limitations and open questions

  • Long File Edits: The current editing primitives struggle when handling large codebases or long source files where line-number shifts introduce edit conflicts.
  • Multimodal Integration: Although helper skills (parse_image, parse_pdf) extract text or image summaries via external vision models, native browser and terminal multimodal reasoning is not yet fully unified.
  • Workflow Automation: Workflows still rely heavily on hand-crafted system prompts and agent orchestration loops rather than automatically optimized graph architectures (e.g., GPTSwarm).

Key terms

OpenHands
An open-source, community-driven platform for building, deploying, and evaluating AI software developer agents in sandboxed environments.
CodeAct
An agent architecture where the action space is unified around executing arbitrary programming language code (Python, bash, browser actions) rather than rigid JSON schemas.
Event Stream
A chronological, append-only log tracking agent actions, user interventions, and environment observations across the OpenHands runtime.
AgentSkills
A modular Python utility package injected into the sandboxed IPython kernel that provides agents with file-editing, navigation, and document-parsing helpers.
BrowserGym
A browser automation environment and domain-specific action language based on Playwright used by OpenHands for web-navigation tasks.
Agent Runtime
The isolated client-server execution environment running inside a Docker container that handles bash commands, IPython code cells, and browser sessions.
AgentDelegateAction
A specialized action type enabling a primary generalist agent to delegate specific subtasks to a domain specialist agent.
SWE-Bench
A benchmark assessing an agent's capability to resolve real-world GitHub issues and pass unit test suites without human guidance.

Questions

What is the difference between OpenHands and OpenDevin?

OpenHands is the official continuation and rename of OpenDevin, evolving from an open recreation of Cognition's Devin into a general platform for both software development and generalist digital agents.

How does OpenHands maintain safety when executing arbitrary code?

All agent actions (shell commands, Python snippets, and browser actions) execute within an isolated Docker sandbox container that communicates with the backend via a REST API client, isolating the host system.

How does OpenHands prevent costly LLM calls during automated testing?

The framework features an end-to-end integration testing suite that intercepts LLM requests and returns cached, deterministic prompt-response pairs, re-calling live models only when breaking prompt changes occur.

Can OpenHands run with arbitrary user Docker images?

Yes. OpenHands provides a build workflow that installs its action execution API server on top of any user-provided base Docker image, tracking builds via MD5 source hashes and generic tags.

The overview on this page was written by AI from the paper and may contain mistakes. Read the paper for the details.

Read with translation and AI