π OpenHands: AI-Driven Development
Move agenthub within openhands (#4130)
Engel Nyste6847e9e61bf
diff --git a/.github/workflows/ghcr-build.yml b/.github/workflows/ghcr-build.ymlindex 81060a7c1a..6b1f353ad1 100644--- a/.github/workflows/ghcr-build.yml+++ b/.github/workflows/ghcr-build.yml@@ -294,7 +294,7 @@ jobs:SANDBOX_RUNTIME_CONTAINER_IMAGE=$image_name \TEST_IN_CI=true \RUN_AS_OPENHANDS=false \- poetry run pytest -n 3 -raRs --reruns 2 --reruns-delay 5 --cov=agenthub --cov=openhands --cov-report=xml -s ./tests/runtime+ poetry run pytest -n 3 -raRs --reruns 2 --reruns-delay 5 --cov=openhands --cov-report=xml -s ./tests/runtime- name: Upload coverage to Codecovuses: codecov/codecov-action@v4env:@@ -372,7 +372,7 @@ jobs:SANDBOX_RUNTIME_CONTAINER_IMAGE=$image_name \TEST_IN_CI=true \RUN_AS_OPENHANDS=true \- poetry run pytest -n 3 -raRs --reruns 2 --reruns-delay 5 --cov=agenthub --cov=openhands --cov-report=xml -s ./tests/runtime+ poetry run pytest -n 3 -raRs --reruns 2 --reruns-delay 5 --cov=openhands --cov-report=xml -s ./tests/runtime- name: Upload coverage to Codecovuses: codecov/codecov-action@v4env:diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.ymlindex 13608c9120..1061a8fd95 100644--- a/.github/workflows/lint.yml+++ b/.github/workflows/lint.yml@@ -46,4 +46,4 @@ jobs:- name: Install pre-commitrun: pip install pre-commit==3.7.0- name: Run pre-commit hooks- run: pre-commit run --files openhands/**/* agenthub/**/* evaluation/**/* tests/**/* --show-diff-on-failure --config ./dev_config/python/.pre-commit-config.yaml+ run: pre-commit run --files openhands/**/* evaluation/**/* tests/**/* --show-diff-on-failure --config ./dev_config/python/.pre-commit-config.yamldiff --git a/.github/workflows/py-unit-tests.yml b/.github/workflows/py-unit-tests.ymlindex dee4a649e0..8acb5cee71 100644--- a/.github/workflows/py-unit-tests.yml+++ b/.github/workflows/py-unit-tests.yml@@ -93,7 +93,7 @@ jobs:id: buildxuses: docker/setup-buildx-action@v3- name: Run Tests- run: poetry run pytest --forked --cov=agenthub --cov=openhands --cov-report=xml ./tests/unit --ignore=tests/unit/test_memory.py+ run: poetry run pytest --forked --cov=openhands --cov-report=xml ./tests/unit --ignore=tests/unit/test_memory.py- name: Upload coverage to Codecovuses: codecov/codecov-action@v4env:@@ -125,7 +125,7 @@ jobs:- name: Build Environmentrun: make build- name: Run Tests- run: poetry run pytest --forked --cov=agenthub --cov=openhands --cov-report=xml -svv ./tests/unit --ignore=tests/unit/test_memory.py+ run: poetry run pytest --forked --cov=openhands --cov-report=xml -svv ./tests/unit --ignore=tests/unit/test_memory.py- name: Upload coverage to Codecovuses: codecov/codecov-action@v4env:diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 1424f4bba2..4549944e3f 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -14,11 +14,12 @@ There are many ways that you can contribute:To understand the codebase, please refer to the README in each module:- [frontend](./frontend/README.md)-- [agenthub](./agenthub/README.md)- [evaluation](./evaluation/README.md)- [openhands](./openhands/README.md)+ - [agenthub](./openhands/agenthub/README.md)- [server](./openhands/server/README.md)+When you write code, it is also good to write tests. Please navigate to the `tests` folder to see existing test suites.At the moment, we have two kinds of tests: `unit` and `integration`. Please refer to the README for each test suite. These tests also run on GitHub's continuous integration to ensure quality of the project.diff --git a/containers/app/Dockerfile b/containers/app/Dockerfileindex 8a983e5972..6df4fda5a3 100644--- a/containers/app/Dockerfile+++ b/containers/app/Dockerfile@@ -69,7 +69,7 @@ RUN playwright install --with-deps chromiumCOPY --chown=openhands:app --chmod=770 ./openhands ./openhandsCOPY --chown=openhands:app --chmod=777 ./openhands/runtime/plugins ./openhands/runtime/plugins-COPY --chown=openhands:app --chmod=770 ./agenthub ./agenthub+COPY --chown=openhands:app --chmod=770 ./openhands/agenthub ./openhands/agenthubCOPY --chown=openhands:app ./pyproject.toml ./pyproject.tomlCOPY --chown=openhands:app ./poetry.lock ./poetry.lockCOPY --chown=openhands:app ./README.md ./README.mddiff --git a/dev_config/python/.pre-commit-config.yaml b/dev_config/python/.pre-commit-config.yamlindex eca8706b51..0ae868fe70 100644--- a/dev_config/python/.pre-commit-config.yaml+++ b/dev_config/python/.pre-commit-config.yaml@@ -38,6 +38,6 @@ repos:- id: mypyadditional_dependencies:[types-requests, types-setuptools, types-pyyaml, types-toml]- entry: mypy --config-file dev_config/python/mypy.ini openhands/ agenthub/+ entry: mypy --config-file dev_config/python/mypy.ini openhands/always_run: truepass_filenames: falsediff --git a/docs/modules/usage/how-to/evaluation-harness.md b/docs/modules/usage/how-to/evaluation-harness.mdindex cb9b64754e..7209e9a567 100644--- a/docs/modules/usage/how-to/evaluation-harness.md+++ b/docs/modules/usage/how-to/evaluation-harness.md@@ -84,7 +84,7 @@ To create an evaluation workflow for your benchmark, follow these steps:1. Import relevant OpenHands utilities:```python- import agenthub+ import openhands.agenthubfrom evaluation.utils.shared import (EvalMetadata,EvalOutput,diff --git a/evaluation/EDA/scripts/run_infer.sh b/evaluation/EDA/scripts/run_infer.shindex bd52c613ff..1b72d48ebc 100755--- a/evaluation/EDA/scripts/run_infer.sh+++ b/evaluation/EDA/scripts/run_infer.sh@@ -36,7 +36,7 @@ fi# IMPORTANT: Because Agent's prompt changes fairly often in the rapidly evolving codebase of OpenHands# We need to track the version of Agent in the evaluation to make sure results are comparable-AGENT_VERSION=v$(poetry run python -c "import agenthub; from openhands.controller.agent import Agent; print(Agent.get_cls('$AGENT').VERSION)")+AGENT_VERSION=v$(poetry run python -c "import openhands.agenthub; from openhands.controller.agent import Agent; print(Agent.get_cls('$AGENT').VERSION)")echo "AGENT: $AGENT"echo "AGENT_VERSION: $AGENT_VERSION"diff --git a/evaluation/regression/conftest.py b/evaluation/regression/conftest.pyindex d514622d51..d9ec620d80 100644--- a/evaluation/regression/conftest.py+++ b/evaluation/regression/conftest.py@@ -8,7 +8,7 @@ import pytestSCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))CASES_DIR = os.path.join(SCRIPT_DIR, 'cases')-AGENTHUB_DIR = os.path.join(SCRIPT_DIR, '../../', 'agenthub')+AGENTHUB_DIR = os.path.join(SCRIPT_DIR, '../', 'agenthub')def agents():diff --git a/evaluation/swe_bench/run_infer.py b/evaluation/swe_bench/run_infer.pyindex b28fb33cf6..4d65500cb4 100644--- a/evaluation/swe_bench/run_infer.py+++ b/evaluation/swe_bench/run_infer.py@@ -8,7 +8,7 @@ import pandas as pdimport tomlfrom datasets import load_dataset-import agenthub+import openhands.agenthubfrom evaluation.swe_bench.prompt import CODEACT_SWE_PROMPTfrom evaluation.utils.shared import (EvalMetadata,@@ -470,7 +470,7 @@ if __name__ == '__main__':raise ValueError(f'Could not find LLM config: --llm_config {args.llm_config}')details = {}- _agent_cls = agenthub.Agent.get_cls(args.agent_cls)+ _agent_cls = openhands.agenthub.Agent.get_cls(args.agent_cls)if hasattr(_agent_cls, 'system_message'):details['system_message'] = _agent_cls.system_messageif hasattr(_agent_cls, 'in_context_example'):diff --git a/evaluation/utils/version_control.sh b/evaluation/utils/version_control.shindex 1fc59250cb..11b366d4b8 100644--- a/evaluation/utils/version_control.sh+++ b/evaluation/utils/version_control.sh@@ -42,5 +42,5 @@ checkout_original_branch() {get_agent_version() {# IMPORTANT: Because Agent's prompt changes fairly often in the rapidly evolving codebase of OpenHands# We need to track the version of Agent in the evaluation to make sure results are comparable- AGENT_VERSION=v$(poetry run python -c "import agenthub; from openhands.controller.agent import Agent; print(Agent.get_cls('$AGENT').VERSION)")+ AGENT_VERSION=v$(poetry run python -c "import openhands.agenthub; from openhands.controller.agent import Agent; print(Agent.get_cls('$AGENT').VERSION)")}diff --git a/agenthub/README.md b/openhands/agenthub/README.mdsimilarity index 99%rename from agenthub/README.mdrename to openhands/agenthub/README.mdindex 46e8fa9664..05de596f1f 100644--- a/agenthub/README.md+++ b/openhands/agenthub/README.md@@ -2,7 +2,7 @@In this folder, there may exist multiple implementations of `Agent` that will be used by the framework.-For example, `agenthub/codeact_agent`, etc.+For example, `openhands/agenthub/codeact_agent`, etc.Contributors from different backgrounds and interests can choose to contribute to any (or all!) of these directions.## Constructing an Agentdiff --git a/agenthub/__init__.py b/openhands/agenthub/__init__.pysimilarity index 79%rename from agenthub/__init__.pyrename to openhands/agenthub/__init__.pyindex d91f2d3ec2..0076976c27 100644--- a/agenthub/__init__.py+++ b/openhands/agenthub/__init__.py@@ -1,13 +1,13 @@from dotenv import load_dotenv-from agenthub.micro.agent import MicroAgent-from agenthub.micro.registry import all_microagents+from openhands.agenthub.micro.agent import MicroAgent+from openhands.agenthub.micro.registry import all_microagentsfrom openhands.controller.agent import Agentload_dotenv()-from agenthub import ( # noqa: E402+from openhands.agenthub import ( # noqa: E402browsing_agent,codeact_agent,codeact_swe_agent,diff --git a/agenthub/browsing_agent/README.md b/openhands/agenthub/browsing_agent/README.mdsimilarity index 100%rename from agenthub/browsing_agent/README.mdrename to openhands/agenthub/browsing_agent/README.mddiff --git a/agenthub/browsing_agent/__init__.py b/openhands/agenthub/browsing_agent/__init__.pysimilarity index 55%rename from agenthub/browsing_agent/__init__.pyrename to openhands/agenthub/browsing_agent/__init__.pyindex 5b32e8c826..436d69d135 100644--- a/agenthub/browsing_agent/__init__.py+++ b/openhands/agenthub/browsing_agent/__init__.py@@ -1,4 +1,4 @@-from agenthub.browsing_agent.browsing_agent import BrowsingAgent+from openhands.agenthub.browsing_agent.browsing_agent import BrowsingAgentfrom openhands.controller.agent import AgentAgent.register('BrowsingAgent', BrowsingAgent)diff --git a/agenthub/browsing_agent/browsing_agent.py b/openhands/agenthub/browsing_agent/browsing_agent.pysimilarity index 98%rename from agenthub/browsing_agent/browsing_agent.pyrename to openhands/agenthub/browsing_agent/browsing_agent.pyindex bf1e01336d..0460506d04 100644--- a/agenthub/browsing_agent/browsing_agent.py+++ b/openhands/agenthub/browsing_agent/browsing_agent.py@@ -3,7 +3,7 @@ import osfrom browsergym.core.action.highlevel import HighLevelActionSetfrom browsergym.utils.obs import flatten_axtree_to_str-from agenthub.browsing_agent.response_parser import BrowsingResponseParser+from openhands.agenthub.browsing_agent.response_parser import BrowsingResponseParserfrom openhands.controller.agent import Agentfrom openhands.controller.state.state import Statefrom openhands.core.config import AgentConfigdiff --git a/agenthub/browsing_agent/prompt.py b/openhands/agenthub/browsing_agent/prompt.pysimilarity index 99%rename from agenthub/browsing_agent/prompt.pyrename to openhands/agenthub/browsing_agent/prompt.pyindex ab7df24c5c..3541568419 100644--- a/agenthub/browsing_agent/prompt.py+++ b/openhands/agenthub/browsing_agent/prompt.py@@ -12,7 +12,7 @@ from browsergym.core.action.base import AbstractActionSetfrom browsergym.core.action.highlevel import HighLevelActionSetfrom browsergym.core.action.python import PythonActionSet-from agenthub.browsing_agent.utils import (+from openhands.agenthub.browsing_agent.utils import (ParseError,parse_html_tags_raise,)diff --git a/agenthub/browsing_agent/response_parser.py b/openhands/agenthub/browsing_agent/response_parser.pysimilarity index 100%rename from agenthub/browsing_agent/response_parser.pyrename to openhands/agenthub/browsing_agent/response_parser.pydiff --git a/agenthub/browsing_agent/utils.py b/openhands/agenthub/browsing_agent/utils.pysimilarity index 100%rename from agenthub/browsing_agent/utils.pyrename to openhands/agenthub/browsing_agent/utils.pydiff --git a/agenthub/codeact_agent/README.md b/openhands/agenthub/codeact_agent/README.mdsimilarity index 100%rename from agenthub/codeact_agent/README.mdrename to openhands/agenthub/codeact_agent/README.mddiff --git a/agenthub/codeact_agent/__init__.py b/openhands/agenthub/codeact_agent/__init__.pysimilarity index 55%rename from agenthub/codeact_agent/__init__.pyrename to openhands/agenthub/codeact_agent/__init__.pyindex db780e24d0..63f1fdb820 100644--- a/agenthub/codeact_agent/__init__.py+++ b/openhands/agenthub/codeact_agent/__init__.py@@ -1,4 +1,4 @@-from agenthub.codeact_agent.codeact_agent import CodeActAgent+from openhands.agenthub.codeact_agent.codeact_agent import CodeActAgentfrom openhands.controller.agent import AgentAgent.register('CodeActAgent', CodeActAgent)diff --git a/agenthub/codeact_agent/action_parser.py b/openhands/agenthub/codeact_agent/action_parser.pysimilarity index 100%rename from agenthub/codeact_agent/action_parser.pyrename to openhands/agenthub/codeact_agent/action_parser.pydiff --git a/agenthub/codeact_agent/codeact_agent.py b/openhands/agenthub/codeact_agent/codeact_agent.pysimilarity index 99%rename from agenthub/codeact_agent/codeact_agent.pyrename to openhands/agenthub/codeact_agent/codeact_agent.pyindex d384ae5682..4db072395a 100644--- a/agenthub/codeact_agent/codeact_agent.py+++ b/openhands/agenthub/codeact_agent/codeact_agent.py@@ -1,7 +1,7 @@import osfrom itertools import islice-from agenthub.codeact_agent.action_parser import CodeActResponseParser+from openhands.agenthub.codeact_agent.action_parser import CodeActResponseParserfrom openhands.controller.agent import Agentfrom openhands.controller.state.state import Statefrom openhands.core.config import AgentConfigdiff --git a/agenthub/codeact_agent/micro/github.md b/openhands/agenthub/codeact_agent/micro/github.mdsimilarity index 100%rename from agenthub/codeact_agent/micro/github.mdrename to openhands/agenthub/codeact_agent/micro/github.mddiff --git a/agenthub/codeact_agent/system_prompt.j2 b/openhands/agenthub/codeact_agent/system_prompt.j2similarity index 100%rename from agenthub/codeact_agent/system_prompt.j2rename to openhands/agenthub/codeact_agent/system_prompt.j2diff --git a/agenthub/codeact_agent/user_prompt.j2 b/openhands/agenthub/codeact_agent/user_prompt.j2similarity index 100%rename from agenthub/codeact_agent/user_prompt.j2rename to openhands/agenthub/codeact_agent/user_prompt.j2diff --git a/agenthub/codeact_swe_agent/README.md b/openhands/agenthub/codeact_swe_agent/README.mdsimilarity index 100%rename from agenthub/codeact_swe_agent/README.mdrename to openhands/agenthub/codeact_swe_agent/README.mddiff --git a/agenthub/codeact_swe_agent/__init__.py b/openhands/agenthub/codeact_swe_agent/__init__.pysimilarity index 53%rename from agenthub/codeact_swe_agent/__init__.pyrename to openhands/agenthub/codeact_swe_agent/__init__.pyindex b0b3d3aae9..ef52337861 100644--- a/agenthub/codeact_swe_agent/__init__.py+++ b/openhands/agenthub/codeact_swe_agent/__init__.py@@ -1,4 +1,4 @@-from agenthub.codeact_swe_agent.codeact_swe_agent import CodeActSWEAgent+from openhands.agenthub.codeact_swe_agent.codeact_swe_agent import CodeActSWEAgentfrom openhands.controller.agent import AgentAgent.register('CodeActSWEAgent', CodeActSWEAgent)diff --git a/agenthub/codeact_swe_agent/action_parser.py b/openhands/agenthub/codeact_swe_agent/action_parser.pysimilarity index 100%rename from agenthub/codeact_swe_agent/action_parser.pyrename to openhands/agenthub/codeact_swe_agent/action_parser.pydiff --git a/agenthub/codeact_swe_agent/codeact_swe_agent.py b/openhands/agenthub/codeact_swe_agent/codeact_swe_agent.pysimilarity index 98%rename from agenthub/codeact_swe_agent/codeact_swe_agent.pyrename to openhands/agenthub/codeact_swe_agent/codeact_swe_agent.pyindex ac3efbe535..d35acb63c8 100644--- a/agenthub/codeact_swe_agent/codeact_swe_agent.py+++ b/openhands/agenthub/codeact_swe_agent/codeact_swe_agent.py@@ -1,10 +1,12 @@-from agenthub.codeact_swe_agent.prompt import (+from openhands.agenthub.codeact_swe_agent.prompt import (COMMAND_DOCS,SWE_EXAMPLE,SYSTEM_PREFIX,SYSTEM_SUFFIX,)-from agenthub.codeact_swe_agent.response_parser import CodeActSWEResponseParser+from openhands.agenthub.codeact_swe_agent.response_parser import (+ CodeActSWEResponseParser,+)from openhands.controller.agent import Agentfrom openhands.controller.state.state import Statefrom openhands.core.config import AgentConfigdiff --git a/agenthub/codeact_swe_agent/prompt.py b/openhands/agenthub/codeact_swe_agent/prompt.pysimilarity index 100%rename from agenthub/codeact_swe_agent/prompt.pyrename to openhands/agenthub/codeact_swe_agent/prompt.pydiff --git a/agenthub/codeact_swe_agent/response_parser.py b/openhands/agenthub/codeact_swe_agent/response_parser.pysimilarity index 96%rename from agenthub/codeact_swe_agent/response_parser.pyrename to openhands/agenthub/codeact_swe_agent/response_parser.pyindex e96b4494a2..147b8655f8 100644--- a/agenthub/codeact_swe_agent/response_parser.py+++ b/openhands/agenthub/codeact_swe_agent/response_parser.py@@ -1,4 +1,4 @@-from agenthub.codeact_swe_agent.action_parser import (+from openhands.agenthub.codeact_swe_agent.action_parser import (CodeActSWEActionParserCmdRun,CodeActSWEActionParserFinish,CodeActSWEActionParserIPythonRunCell,diff --git a/agenthub/delegator_agent/__init__.py b/openhands/agenthub/delegator_agent/__init__.pysimilarity index 58%rename from agenthub/delegator_agent/__init__.pyrename to openhands/agenthub/delegator_agent/__init__.pyindex 4c420816fd..68e20efa30 100644--- a/agenthub/delegator_agent/__init__.py+++ b/openhands/agenthub/delegator_agent/__init__.py@@ -1,4 +1,4 @@-from agenthub.delegator_agent.agent import DelegatorAgent+from openhands.agenthub.delegator_agent.agent import DelegatorAgentfrom openhands.controller.agent import AgentAgent.register('DelegatorAgent', DelegatorAgent)diff --git a/agenthub/delegator_agent/agent.py b/openhands/agenthub/delegator_agent/agent.pysimilarity index 100%rename from agenthub/delegator_agent/agent.pyrename to openhands/agenthub/delegator_agent/agent.pydiff --git a/agenthub/dummy_agent/__init__.py b/openhands/agenthub/dummy_agent/__init__.pysimilarity index 59%rename from agenthub/dummy_agent/__init__.pyrename to openhands/agenthub/dummy_agent/__init__.pyindex 5e7c39b7f5..d0db8e26c9 100644--- a/agenthub/dummy_agent/__init__.py+++ b/openhands/agenthub/dummy_agent/__init__.py@@ -1,4 +1,4 @@-from agenthub.dummy_agent.agent import DummyAgent+from openhands.agenthub.dummy_agent.agent import DummyAgentfrom openhands.controller.agent import AgentAgent.register('DummyAgent', DummyAgent)diff --git a/agenthub/dummy_agent/agent.py b/openhands/agenthub/dummy_agent/agent.pysimilarity index 100%rename from agenthub/dummy_agent/agent.pyrename to openhands/agenthub/dummy_agent/agent.pydiff --git a/agenthub/micro/README.md b/openhands/agenthub/micro/README.mdsimilarity index 100%rename from agenthub/micro/README.mdrename to openhands/agenthub/micro/README.mddiff --git a/agenthub/micro/_instructions/actions/browse.md b/openhands/agenthub/micro/_instructions/actions/browse.mdsimilarity index 100%rename from agenthub/micro/_instructions/actions/browse.mdrename to openhands/agenthub/micro/_instructions/actions/browse.mddiff --git a/agenthub/micro/_instructions/actions/delegate.md b/openhands/agenthub/micro/_instructions/actions/delegate.mdsimilarity index 100%rename from agenthub/micro/_instructions/actions/delegate.mdrename to openhands/agenthub/micro/_instructions/actions/delegate.mddiff --git a/agenthub/micro/_instructions/actions/finish.md b/openhands/agenthub/micro/_instructions/actions/finish.mdsimilarity index 100%rename from agenthub/micro/_instructions/actions/finish.mdrename to openhands/agenthub/micro/_instructions/actions/finish.mddiff --git a/agenthub/micro/_instructions/actions/kill.md b/openhands/agenthub/micro/_instructions/actions/kill.mdsimilarity index 100%rename from agenthub/micro/_instructions/actions/kill.mdrename to openhands/agenthub/micro/_instructions/actions/kill.mddiff --git a/agenthub/micro/_instructions/actions/message.md b/openhands/agenthub/micro/_instructions/actions/message.mdsimilarity index 100%rename from agenthub/micro/_instructions/actions/message.mdrename to openhands/agenthub/micro/_instructions/actions/message.mddiff --git a/agenthub/micro/_instructions/actions/read.md b/openhands/agenthub/micro/_instructions/actions/read.mdsimilarity index 100%rename from agenthub/micro/_instructions/actions/read.mdrename to openhands/agenthub/micro/_instructions/actions/read.mddiff --git a/agenthub/micro/_instructions/actions/reject.md b/openhands/agenthub/micro/_instructions/actions/reject.mdsimilarity index 100%rename from agenthub/micro/_instructions/actions/reject.mdrename to openhands/agenthub/micro/_instructions/actions/reject.mddiff --git a/agenthub/micro/_instructions/actions/run.md b/openhands/agenthub/micro/_instructions/actions/run.mdsimilarity index 100%rename from agenthub/micro/_instructions/actions/run.mdrename to openhands/agenthub/micro/_instructions/actions/run.mddiff --git a/agenthub/micro/_instructions/actions/write.md b/openhands/agenthub/micro/_instructions/actions/write.mdsimilarity index 100%rename from agenthub/micro/_instructions/actions/write.mdrename to openhands/agenthub/micro/_instructions/actions/write.mddiff --git a/agenthub/micro/_instructions/format/action.md b/openhands/agenthub/micro/_instructions/format/action.mdsimilarity index 100%rename from agenthub/micro/_instructions/format/action.mdrename to openhands/agenthub/micro/_instructions/format/action.mddiff --git a/agenthub/micro/_instructions/history_truncated.md b/openhands/agenthub/micro/_instructions/history_truncated.mdsimilarity index 100%rename from agenthub/micro/_instructions/history_truncated.mdrename to openhands/agenthub/micro/_instructions/history_truncated.mddiff --git a/agenthub/micro/agent.py b/openhands/agenthub/micro/agent.pysimilarity index 95%rename from agenthub/micro/agent.pyrename to openhands/agenthub/micro/agent.pyindex cac4ed78da..83225a3245 100644--- a/agenthub/micro/agent.py+++ b/openhands/agenthub/micro/agent.py@@ -1,7 +1,7 @@from jinja2 import BaseLoader, Environment-from agenthub.micro.instructions import instructions-from agenthub.micro.registry import all_microagents+from openhands.agenthub.micro.instructions import instructions+from openhands.agenthub.micro.registry import all_microagentsfrom openhands.controller.agent import Agentfrom openhands.controller.state.state import Statefrom openhands.core.config import AgentConfigdiff --git a/agenthub/micro/coder/agent.yaml b/openhands/agenthub/micro/coder/agent.yamlsimilarity index 100%rename from agenthub/micro/coder/agent.yamlrename to openhands/agenthub/micro/coder/agent.yamldiff --git a/agenthub/micro/coder/prompt.md b/openhands/agenthub/micro/coder/prompt.mdsimilarity index 100%rename from agenthub/micro/coder/prompt.mdrename to openhands/agenthub/micro/coder/prompt.mddiff --git a/agenthub/micro/commit_writer/README.md b/openhands/agenthub/micro/commit_writer/README.mdsimilarity index 100%rename from agenthub/micro/commit_writer/README.mdrename to openhands/agenthub/micro/commit_writer/README.mddiff --git a/agenthub/micro/commit_writer/agent.yaml b/openhands/agenthub/micro/commit_writer/agent.yamlsimilarity index 100%rename from agenthub/micro/commit_writer/agent.yamlrename to openhands/agenthub/micro/commit_writer/agent.yamldiff --git a/agenthub/micro/commit_writer/prompt.md b/openhands/agenthub/micro/commit_writer/prompt.mdsimilarity index 100%rename from agenthub/micro/commit_writer/prompt.mdrename to openhands/agenthub/micro/commit_writer/prompt.mddiff --git a/agenthub/micro/instructions.py b/openhands/agenthub/micro/instructions.pysimilarity index 100%rename from agenthub/micro/instructions.pyrename to openhands/agenthub/micro/instructions.pydiff --git a/agenthub/micro/manager/agent.yaml b/openhands/agenthub/micro/manager/agent.yamlsimilarity index 100%rename from agenthub/micro/manager/agent.yamlrename to openhands/agenthub/micro/manager/agent.yamldiff --git a/agenthub/micro/manager/prompt.md b/openhands/agenthub/micro/manager/prompt.mdsimilarity index 100%rename from agenthub/micro/manager/prompt.mdrename to openhands/agenthub/micro/manager/prompt.mddiff --git a/agenthub/micro/math_agent/agent.yaml b/openhands/agenthub/micro/math_agent/agent.yamlsimilarity index 100%rename from agenthub/micro/math_agent/agent.yamlrename to openhands/agenthub/micro/math_agent/agent.yamldiff --git a/agenthub/micro/math_agent/prompt.md b/openhands/agenthub/micro/math_agent/prompt.mdsimilarity index 100%rename from agenthub/micro/math_agent/prompt.mdrename to openhands/agenthub/micro/math_agent/prompt.mddiff --git a/agenthub/micro/postgres_agent/agent.yaml b/openhands/agenthub/micro/postgres_agent/agent.yamlsimilarity index 100%rename from agenthub/micro/postgres_agent/agent.yamlrename to openhands/agenthub/micro/postgres_agent/agent.yamldiff --git a/agenthub/micro/postgres_agent/prompt.md b/openhands/agenthub/micro/postgres_agent/prompt.mdsimilarity index 100%rename from agenthub/micro/postgres_agent/prompt.mdrename to openhands/agenthub/micro/postgres_agent/prompt.mddiff --git a/agenthub/micro/registry.py b/openhands/agenthub/micro/registry.pysimilarity index 100%rename from agenthub/micro/registry.pyrename to openhands/agenthub/micro/registry.pydiff --git a/agenthub/micro/repo_explorer/agent.yaml b/openhands/agenthub/micro/repo_explorer/agent.yamlsimilarity index 100%rename from agenthub/micro/repo_explorer/agent.yamlrename to openhands/agenthub/micro/repo_explorer/agent.yamldiff --git a/agenthub/micro/repo_explorer/prompt.md b/openhands/agenthub/micro/repo_explorer/prompt.mdsimilarity index 100%rename from agenthub/micro/repo_explorer/prompt.mdrename to openhands/agenthub/micro/repo_explorer/prompt.mddiff --git a/agenthub/micro/study_repo_for_task/agent.yaml b/openhands/agenthub/micro/study_repo_for_task/agent.yamlsimilarity index 100%rename from agenthub/micro/study_repo_for_task/agent.yamlrename to openhands/agenthub/micro/study_repo_for_task/agent.yamldiff --git a/agenthub/micro/study_repo_for_task/prompt.md b/openhands/agenthub/micro/study_repo_for_task/prompt.mdsimilarity index 100%rename from agenthub/micro/study_repo_for_task/prompt.mdrename to openhands/agenthub/micro/study_repo_for_task/prompt.mddiff --git a/agenthub/micro/typo_fixer_agent/agent.yaml b/openhands/agenthub/micro/typo_fixer_agent/agent.yamlsimilarity index 100%rename from agenthub/micro/typo_fixer_agent/agent.yamlrename to openhands/agenthub/micro/typo_fixer_agent/agent.yamldiff --git a/agenthub/micro/typo_fixer_agent/prompt.md b/openhands/agenthub/micro/typo_fixer_agent/prompt.mdsimilarity index 100%rename from agenthub/micro/typo_fixer_agent/prompt.mdrename to openhands/agenthub/micro/typo_fixer_agent/prompt.mddiff --git a/agenthub/micro/verifier/agent.yaml b/openhands/agenthub/micro/verifier/agent.yamlsimilarity index 100%rename from agenthub/micro/verifier/agent.yamlrename to openhands/agenthub/micro/verifier/agent.yamldiff --git a/agenthub/micro/verifier/prompt.md b/openhands/agenthub/micro/verifier/prompt.mdsimilarity index 100%rename from agenthub/micro/verifier/prompt.mdrename to openhands/agenthub/micro/verifier/prompt.mddiff --git a/agenthub/planner_agent/__init__.py b/openhands/agenthub/planner_agent/__init__.pysimilarity index 58%rename from agenthub/planner_agent/__init__.pyrename to openhands/agenthub/planner_agent/__init__.pyindex 3b97ae3b3c..e8c030e84c 100644--- a/agenthub/planner_agent/__init__.py+++ b/openhands/agenthub/planner_agent/__init__.py@@ -1,4 +1,4 @@-from agenthub.planner_agent.agent import PlannerAgent+from openhands.agenthub.planner_agent.agent import PlannerAgentfrom openhands.controller.agent import AgentAgent.register('PlannerAgent', PlannerAgent)diff --git a/agenthub/planner_agent/agent.py b/openhands/agenthub/planner_agent/agent.pysimilarity index 92%rename from agenthub/planner_agent/agent.pyrename to openhands/agenthub/planner_agent/agent.pyindex a640ea354b..f5aef523d9 100644--- a/agenthub/planner_agent/agent.py+++ b/openhands/agenthub/planner_agent/agent.py@@ -1,5 +1,5 @@-from agenthub.planner_agent.prompt import get_prompt_and_images-from agenthub.planner_agent.response_parser import PlannerResponseParser+from openhands.agenthub.planner_agent.prompt import get_prompt_and_images+from openhands.agenthub.planner_agent.response_parser import PlannerResponseParserfrom openhands.controller.agent import Agentfrom openhands.controller.state.state import Statefrom openhands.core.config import AgentConfigdiff --git a/agenthub/planner_agent/prompt.py b/openhands/agenthub/planner_agent/prompt.pysimilarity index 100%rename from agenthub/planner_agent/prompt.pyrename to openhands/agenthub/planner_agent/prompt.pydiff --git a/agenthub/planner_agent/response_parser.py b/openhands/agenthub/planner_agent/response_parser.pysimilarity index 100%rename from agenthub/planner_agent/response_parser.pyrename to openhands/agenthub/planner_agent/response_parser.pydiff --git a/openhands/core/cli.py b/openhands/core/cli.pyindex 9f978c26c9..5bdd976858 100644--- a/openhands/core/cli.py+++ b/openhands/core/cli.py@@ -4,7 +4,7 @@ from typing import Typefrom termcolor import colored-import agenthub # noqa F401 (we import this to get the agents registered)+import openhands.agenthub # noqa F401 (we import this to get the agents registered)from openhands import __version__from openhands.controller import AgentControllerfrom openhands.controller.agent import Agentdiff --git a/openhands/core/download.py b/openhands/core/download.pyindex 32ed85e665..7d2392a63a 100644--- a/openhands/core/download.py+++ b/openhands/core/download.py@@ -1,2 +1,2 @@# Run this file to trigger a model download-import agenthub # noqa F401 (we import this to get the agents registered)+import openhands.agenthub # noqa F401 (we import this to get the agents registered)diff --git a/openhands/core/main.py b/openhands/core/main.pyindex b99dd0350a..adda15aeab 100644--- a/openhands/core/main.py+++ b/openhands/core/main.py@@ -4,7 +4,7 @@ import sysimport uuidfrom typing import Callable, Protocol, Type-import agenthub # noqa F401 (we import this to get the agents registered)+import openhands.agenthub # noqa F401 (we import this to get the agents registered)from openhands.controller import AgentControllerfrom openhands.controller.agent import Agentfrom openhands.controller.state.state import State@@ -66,7 +66,7 @@ def create_runtime(event_stream = EventStream(session_id, file_store)# agent class- agent_cls = agenthub.Agent.get_cls(config.default_agent)+ agent_cls = openhands.agenthub.Agent.get_cls(config.default_agent)# runtime and toolsruntime_cls = get_runtime_cls(config.runtime)diff --git a/openhands/server/listen.py b/openhands/server/listen.pyindex 8587722f93..2b1144128a 100644--- a/openhands/server/listen.py+++ b/openhands/server/listen.py@@ -34,7 +34,7 @@ from fastapi.security import HTTPBearerfrom fastapi.staticfiles import StaticFilesfrom pydantic import BaseModel-import agenthub # noqa F401 (we import this to get the agents registered)+import openhands.agenthub # noqa F401 (we import this to get the agents registered)from openhands.controller.agent import Agentfrom openhands.core.config import LLMConfig, load_app_configfrom openhands.core.logger import openhands_logger as loggerdiff --git a/pyproject.toml b/pyproject.tomlindex de9d09d0bc..a965a634d6 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -8,7 +8,6 @@ readme = "README.md"repository = "https://github.com/All-Hands-AI/OpenHands"include = ["poetry.lock"]packages = [- { include = "agenthub/**/*" },{ include = "openhands/**/*" }]@@ -86,6 +85,7 @@ reportlab = "*"[tool.coverage.run]concurrency = ["gevent"]+[tool.poetry.group.runtime.dependencies]jupyterlab = "*"notebook = "*"@@ -116,6 +116,7 @@ ignore = ["D1"][tool.ruff.lint.pydocstyle]convention = "google"+[tool.poetry.group.evaluation.dependencies]streamlit = "*"whatthepatch = "*"diff --git a/tests/integration/regenerate.sh b/tests/integration/regenerate.shindex 916038640b..5e5253de40 100755--- a/tests/integration/regenerate.sh+++ b/tests/integration/regenerate.sh@@ -119,7 +119,7 @@ run_test() {local pytest_cmd="poetry run pytest --cache-clear -vvsxx $SCRIPT_DIR/test_agent.py::$test_name"# Check if TEST_IN_CI is definedif [ -n "$TEST_IN_CI" ]; then- pytest_cmd+=" --cov=agenthub --cov=openhands --cov-report=xml --cov-append"+ pytest_cmd+=" --cov=openhands --cov-report=xml --cov-append"fienv SCRIPT_DIR="$SCRIPT_DIR" \diff --git a/tests/unit/test_browsing_agent_parser.py b/tests/unit/test_browsing_agent_parser.pyindex bc1372611c..011ebb6b32 100644--- a/tests/unit/test_browsing_agent_parser.py+++ b/tests/unit/test_browsing_agent_parser.py@@ -1,6 +1,6 @@import pytest-from agenthub.browsing_agent.response_parser import (+from openhands.agenthub.browsing_agent.response_parser import (BrowseInteractiveAction,BrowsingResponseParser,)diff --git a/tests/unit/test_codeact_agent.py b/tests/unit/test_codeact_agent.pyindex a5a6f9d022..55dfa3feb7 100644--- a/tests/unit/test_codeact_agent.py+++ b/tests/unit/test_codeact_agent.py@@ -2,7 +2,7 @@ from unittest.mock import Mockimport pytest-from agenthub.codeact_agent.codeact_agent import CodeActAgent+from openhands.agenthub.codeact_agent.codeact_agent import CodeActAgentfrom openhands.core.config import AgentConfig, LLMConfigfrom openhands.core.message import TextContentfrom openhands.events.observation.commands import (diff --git a/tests/unit/test_micro_agents.py b/tests/unit/test_micro_agents.pyindex 7eb87babd3..70553d8511 100644--- a/tests/unit/test_micro_agents.py+++ b/tests/unit/test_micro_agents.py@@ -6,7 +6,7 @@ import pytestimport yamlfrom pytest import TempPathFactory-from agenthub.micro.registry import all_microagents+from openhands.agenthub.micro.registry import all_microagentsfrom openhands.controller.agent import Agentfrom openhands.controller.state.state import Statefrom openhands.core.config import AgentConfig@@ -44,7 +44,7 @@ def test_all_agents_are_loaded():assert all_microagents is not Noneassert len(all_microagents) > 1- base = os.path.join('agenthub', 'micro')+ base = os.path.join('openhands', 'agenthub', 'micro')full_path = os.path.dirname(__file__) + '/../../' + baseagent_names = set()for root, _, files in os.walk(full_path):diff --git a/tests/unit/test_microagent_utils.py b/tests/unit/test_microagent_utils.pyindex 27319e9d9f..26f6523c0b 100644--- a/tests/unit/test_microagent_utils.py+++ b/tests/unit/test_microagent_utils.py@@ -3,7 +3,7 @@ import osimport pytestfrom pytest import MonkeyPatch-import agenthub # noqa: F401+import openhands.agenthub # noqa: F401from openhands.core.exceptions import (AgentNotRegisteredError,MicroAgentValidationError,diff --git a/tests/unit/test_prompt_caching.py b/tests/unit/test_prompt_caching.pyindex 7acf014130..41dc756187 100644--- a/tests/unit/test_prompt_caching.py+++ b/tests/unit/test_prompt_caching.py@@ -2,7 +2,7 @@ from unittest.mock import MagicMock, Mock, patchimport pytest-from agenthub.codeact_agent.codeact_agent import CodeActAgent+from openhands.agenthub.codeact_agent.codeact_agent import CodeActAgentfrom openhands.core.config import AgentConfig, LLMConfigfrom openhands.events import EventSource, EventStreamfrom openhands.events.action import CmdRunAction, MessageActiondiff --git a/tests/unit/test_prompt_manager.py b/tests/unit/test_prompt_manager.pyindex 8eda03b77c..2534f73d3a 100644--- a/tests/unit/test_prompt_manager.py+++ b/tests/unit/test_prompt_manager.py@@ -10,8 +10,8 @@ from openhands.utils.prompt import PromptManager@pytest.fixturedef prompt_dir(tmp_path):- # Copy contents from "agenthub/codeact_agent" to the temp directory- shutil.copytree('agenthub/codeact_agent', tmp_path, dirs_exist_ok=True)+ # Copy contents from "openhands/agenthub/codeact_agent" to the temp directory+ shutil.copytree('openhands/agenthub/codeact_agent', tmp_path, dirs_exist_ok=True)# Return the temporary directory pathreturn tmp_pathdiff --git a/tests/unit/test_response_parsing.py b/tests/unit/test_response_parsing.pyindex 673caab079..02710f4898 100644--- a/tests/unit/test_response_parsing.py+++ b/tests/unit/test_response_parsing.py@@ -1,7 +1,9 @@import pytest-from agenthub.micro.agent import parse_response as parse_response_micro-from agenthub.planner_agent.prompt import parse_response as parse_response_planner+from openhands.agenthub.micro.agent import parse_response as parse_response_micro+from openhands.agenthub.planner_agent.prompt import (+ parse_response as parse_response_planner,+)from openhands.core.exceptions import LLMResponseErrorfrom openhands.core.utils.json import loads as custom_loadsfrom openhands.events.action import (diff --git a/tests/unit/test_runtime_build.py b/tests/unit/test_runtime_build.pyindex 48619942d2..867305fd59 100644--- a/tests/unit/test_runtime_build.py+++ b/tests/unit/test_runtime_build.py@@ -56,7 +56,6 @@ def _check_source_code_in_dir(temp_dir):# The source code should only include the `openhands` folder, but not the other foldersassert set(os.listdir(code_dir)) == {- 'agenthub','openhands','pyproject.toml','poetry.lock',