diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8e0a3108c1..6c97e3bf55 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "OpenDevin Codespaces", + "name": "OpenHands Codespaces", "image": "mcr.microsoft.com/devcontainers/universal", "customizations":{ "vscode":{ diff --git a/.github/ISSUE_TEMPLATE/bug_template.yml b/.github/ISSUE_TEMPLATE/bug_template.yml index e7a3b4f579..650eb53e53 100644 --- a/.github/ISSUE_TEMPLATE/bug_template.yml +++ b/.github/ISSUE_TEMPLATE/bug_template.yml @@ -1,5 +1,5 @@ name: Bug -description: Report a problem with OpenDevin +description: Report a problem with OpenHands title: '[Bug]: ' labels: ['bug'] body: @@ -28,8 +28,8 @@ body: - type: textarea id: current-version attributes: - label: Current OpenDevin version - description: What version of OpenDevin are you using? If you're running in docker, tell us the tag you're using (e.g. ghcr.io/opendevin/opendevin:0.3.1). + label: Current OpenHands version + description: What version of OpenHands are you using? If you're running in docker, tell us the tag you're using (e.g. ghcr.io/all-hands-ai/openhands:0.3.1). render: bash validations: required: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 663b4a6324..17671970a4 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,6 +1,6 @@ --- name: Feature Request -about: Suggest an idea for OpenDevin features +about: Suggest an idea for OpenHands features title: '' labels: 'enhancement' assignees: '' diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index bb85b52235..551b5438a5 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -17,7 +17,7 @@ on: jobs: # Build the documentation website build: - if: github.repository == 'OpenDevin/OpenDevin' + if: github.repository == 'All-Hands-AI/OpenHands' name: Build Docusaurus runs-on: ubuntu-latest steps: @@ -47,7 +47,7 @@ jobs: # Deploy the documentation website deploy: - if: github.ref == 'refs/heads/main' && github.repository == 'OpenDevin/OpenDevin' + if: github.ref == 'refs/heads/main' && github.repository == 'All-Hands-AI/OpenHands' name: Deploy to GitHub Pages runs-on: ubuntu-latest # This job only runs on "main" so only run one of these jobs at a time diff --git a/.github/workflows/dummy-agent-test.yml b/.github/workflows/dummy-agent-test.yml index d9da088213..b2828d63b7 100644 --- a/.github/workflows/dummy-agent-test.yml +++ b/.github/workflows/dummy-agent-test.yml @@ -27,7 +27,7 @@ jobs: - name: Run tests run: | set -e - poetry run python opendevin/core/main.py -t "do a flip" -d ./workspace/ -c DummyAgent + poetry run python openhands/core/main.py -t "do a flip" -d ./workspace/ -c DummyAgent - name: Check exit code run: | if [ $? -ne 0 ]; then diff --git a/.github/workflows/gchr_app.yml b/.github/workflows/gchr_app.yml index 8f13aafc2a..ebbdb9f9c1 100644 --- a/.github/workflows/gchr_app.yml +++ b/.github/workflows/gchr_app.yml @@ -21,7 +21,7 @@ on: default: '' jobs: - # Builds the OpenDevin Docker images + # Builds the OpenHands Docker images ghcr_build: name: Build App Image runs-on: ubuntu-latest @@ -32,7 +32,7 @@ jobs: packages: write strategy: matrix: - image: ['opendevin'] + image: ['openhands'] platform: ['amd64', 'arm64'] steps: - name: Checkout @@ -72,7 +72,7 @@ jobs: path: /tmp/${{ matrix.image }}_image_${{ matrix.platform }}.tar retention-days: 14 - # Push the OpenDevin and sandbox Docker images to the ghcr.io repository + # Push the OpenHands and sandbox Docker images to the ghcr.io repository ghcr_push: runs-on: ubuntu-latest needs: [ghcr_build] @@ -84,7 +84,7 @@ jobs: packages: write strategy: matrix: - image: ['opendevin'] + image: ['openhands'] platform: ['amd64', 'arm64'] steps: - name: Checkout code @@ -113,7 +113,7 @@ jobs: docker tag $loaded_image $image_name:${tag}_${{ matrix.platform }} docker push $image_name:${tag}_${{ matrix.platform }} done - # Creates and pushes the OpenDevin and sandbox Docker image manifests + # Creates and pushes the OpenHands and sandbox Docker image manifests create_manifest: runs-on: ubuntu-latest needs: [ghcr_build, ghcr_push] @@ -122,7 +122,7 @@ jobs: tags: ${{ needs.ghcr_build.outputs.tags }} strategy: matrix: - image: ['opendevin'] + image: ['openhands'] permissions: contents: read packages: write diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml index b62ed288c5..613ff4dfad 100644 --- a/.github/workflows/ghcr.yml +++ b/.github/workflows/ghcr.yml @@ -68,7 +68,7 @@ jobs: - name: Install Python dependencies using Poetry run: make install-python-dependencies - name: Create source distribution and Dockerfile - run: poetry run python3 opendevin/runtime/utils/runtime_build.py --base_image ${{ matrix.base_image }} --build_folder containers/runtime --force_rebuild + run: poetry run python3 openhands/runtime/utils/runtime_build.py --base_image ${{ matrix.base_image }} --build_folder containers/runtime --force_rebuild - name: Build and export image id: build run: | @@ -191,7 +191,7 @@ jobs: # Print the full name of the image echo "Loaded Docker image: $image_name" - TEST_RUNTIME=${{ matrix.runtime_type }} SANDBOX_USER_ID=$(id -u) SANDBOX_CONTAINER_IMAGE=$image_name TEST_IN_CI=true poetry run pytest --cov=agenthub --cov=opendevin --cov-report=xml -s ./tests/unit/test_runtime.py + TEST_RUNTIME=${{ matrix.runtime_type }} SANDBOX_USER_ID=$(id -u) SANDBOX_CONTAINER_IMAGE=$image_name TEST_IN_CI=true poetry run pytest --cov=agenthub --cov=openhands --cov-report=xml -s ./tests/unit/test_runtime.py - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 env: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9aa4426e87..1d4b67608e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -46,4 +46,4 @@ jobs: - name: Install pre-commit run: pip install pre-commit==3.7.0 - name: Run pre-commit hooks - run: pre-commit run --files opendevin/**/* agenthub/**/* evaluation/**/* tests/**/* --show-diff-on-failure --config ./dev_config/python/.pre-commit-config.yaml + run: pre-commit run --files openhands/**/* agenthub/**/* evaluation/**/* tests/**/* --show-diff-on-failure --config ./dev_config/python/.pre-commit-config.yaml diff --git a/.github/workflows/py-unit-tests.yml b/.github/workflows/py-unit-tests.yml index acb005a057..b6ed4c9bbd 100644 --- a/.github/workflows/py-unit-tests.yml +++ b/.github/workflows/py-unit-tests.yml @@ -82,7 +82,7 @@ jobs: - name: Build Environment run: make build - name: Run Tests - run: poetry run pytest --forked --cov=agenthub --cov=opendevin --cov-report=xml ./tests/unit -k "not test_runtime.py" + run: poetry run pytest --forked --cov=agenthub --cov=openhands --cov-report=xml ./tests/unit -k "not test_runtime.py" - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 env: @@ -111,7 +111,7 @@ jobs: - name: Build Environment run: make build - name: Run Tests - run: poetry run pytest --forked --cov=agenthub --cov=opendevin --cov-report=xml ./tests/unit -k "not test_runtime.py" + run: poetry run pytest --forked --cov=agenthub --cov=openhands --cov-report=xml ./tests/unit -k "not test_runtime.py" - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 env: diff --git a/.github/workflows/review-pr.yml b/.github/workflows/review-pr.yml index 6d7771e570..863a97936a 100644 --- a/.github/workflows/review-pr.yml +++ b/.github/workflows/review-pr.yml @@ -1,5 +1,5 @@ -# Workflow that uses OpenDevin to review a pull request. PR must be labeled 'review-this' -name: Use OpenDevin to Review Pull Request +# Workflow that uses OpenHands to review a pull request. PR must be labeled 'review-this' +name: Use OpenHands to Review Pull Request on: pull_request: @@ -49,7 +49,7 @@ jobs: export PATH="/github/home/.local/bin:$PATH" poetry install --without evaluation,llama-index poetry run playwright install --with-deps chromium - - name: Run OpenDevin + - name: Run OpenHands env: LLM_API_KEY: ${{ secrets.LLM_API_KEY }} LLM_MODEL: ${{ vars.LLM_MODEL }} @@ -60,7 +60,7 @@ jobs: export PYTHONPATH=$(pwd):$PYTHONPATH export WORKSPACE_MOUNT_PATH=$GITHUB_WORKSPACE export WORKSPACE_BASE=$GITHUB_WORKSPACE - echo -e "/exit\n" | poetry run python opendevin/core/main.py -i 50 -f task.txt + echo -e "/exit\n" | poetry run python openhands/core/main.py -i 50 -f task.txt rm task.txt - name: Check if review file is non-empty id: check_file diff --git a/.github/workflows/solve-issue.yml b/.github/workflows/solve-issue.yml index 8e075761ab..f977fa510e 100644 --- a/.github/workflows/solve-issue.yml +++ b/.github/workflows/solve-issue.yml @@ -1,5 +1,5 @@ -# Workflow that uses OpenDevin to resolve a GitHub issue. Issue must be labeled 'solve-this' -name: Use OpenDevin to Resolve GitHub Issue +# Workflow that uses OpenHands to resolve a GitHub issue. Issue must be labeled 'solve-this' +name: Use OpenHands to Resolve GitHub Issue on: issues: @@ -15,7 +15,7 @@ jobs: if: github.event.label.name == 'solve-this' runs-on: ubuntu-latest container: - image: ghcr.io/opendevin/opendevin + image: ghcr.io/all-hands-ai/openhands volumes: - /var/run/docker.sock:/var/run/docker.sock steps: @@ -39,7 +39,7 @@ jobs: export PATH="/github/home/.local/bin:$PATH" poetry install --without evaluation,llama-index poetry run playwright install --with-deps chromium - - name: Run OpenDevin + - name: Run OpenHands env: ISSUE_TITLE: ${{ github.event.issue.title }} ISSUE_BODY: ${{ github.event.issue.body }} @@ -50,14 +50,14 @@ jobs: export PATH="/github/home/.local/bin:$PATH" # Append path to correctly import package, note: must set pwd at first export PYTHONPATH=$(pwd):$PYTHONPATH - WORKSPACE_MOUNT_PATH=$GITHUB_WORKSPACE poetry run python ./opendevin/core/main.py -i 50 -f task.txt -d $GITHUB_WORKSPACE + WORKSPACE_MOUNT_PATH=$GITHUB_WORKSPACE poetry run python ./openhands/core/main.py -i 50 -f task.txt -d $GITHUB_WORKSPACE rm task.txt - name: Setup Git, Create Branch, and Commit Changes run: | # Setup Git configuration git config --global --add safe.directory $PWD - git config --global user.name 'OpenDevin' - git config --global user.email 'OpenDevin@users.noreply.github.com' + git config --global user.name 'OpenHands' + git config --global user.email 'OpenHands@users.noreply.github.com' # Create a unique branch name with a timestamp BRANCH_NAME="fix/${{ github.event.issue.number }}-$(date +%Y%m%d%H%M%S)" @@ -69,7 +69,7 @@ jobs: git add --all -- ':!task.txt' # Commit the changes, if any - git commit -m "OpenDevin: Resolve Issue #${{ github.event.issue.number }}" + git commit -m "OpenHands: Resolve Issue #${{ github.event.issue.number }}" if [ $? -ne 0 ]; then echo "No changes to commit." exit 0 @@ -91,9 +91,9 @@ jobs: run: | # Create PR and capture URL PR_URL=$(gh pr create \ - --title "OpenDevin: Resolve Issue #2" \ - --body "This PR was generated by OpenDevin to resolve issue #2" \ - --repo "foragerr/OpenDevin" \ + --title "OpenHands: Resolve Issue #2" \ + --body "This PR was generated by OpenHands to resolve issue #2" \ + --repo "foragerr/OpenHands" \ --head "${{ github.head_ref }}" \ --base "${{ env.DEFAULT_BRANCH }}" \ | grep -o 'https://github.com/[^ ]*') @@ -110,4 +110,4 @@ jobs: GH_TOKEN: ${{ github.token }} run: | gh issue comment ${{ github.event.issue.number }} \ - -b "OpenDevin raised [PR #${{ env.PR_NUMBER }}](${{ env.PR_URL }}) to resolve this issue." + -b "OpenHands raised [PR #${{ env.PR_NUMBER }}](${{ env.PR_URL }}) to resolve this issue." diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 212e8ff3a9..1424f4bba2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,35 +1,35 @@ # Contributing -Thanks for your interest in contributing to OpenDevin! We welcome and appreciate contributions. +Thanks for your interest in contributing to OpenHands! We welcome and appreciate contributions. ## How Can I Contribute? There are many ways that you can contribute: -1. **Download and use** OpenDevin, and send [issues](https://github.com/OpenDevin/OpenDevin/issues) when you encounter something that isn't working or a feature that you'd like to see. +1. **Download and use** OpenHands, and send [issues](https://github.com/All-Hands-AI/OpenHands/issues) when you encounter something that isn't working or a feature that you'd like to see. 2. **Send feedback** after each session by [clicking the thumbs-up thumbs-down buttons](https://docs.all-hands.dev/modules/usage/feedback), so we can see where things are working and failing, and also build an open dataset for training code agents. -3. **Improve the Codebase** by sending PRs (see details below). In particular, we have some [good first issue](https://github.com/OpenDevin/OpenDevin/labels/good%20first%20issue) issues that may be ones to start on. +3. **Improve the Codebase** by sending PRs (see details below). In particular, we have some [good first issue](https://github.com/All-Hands-AI/OpenHands/labels/good%20first%20issue) issues that may be ones to start on. -## Understanding OpenDevin's CodeBase +## Understanding OpenHands's CodeBase To understand the codebase, please refer to the README in each module: - [frontend](./frontend/README.md) - [agenthub](./agenthub/README.md) - [evaluation](./evaluation/README.md) -- [opendevin](./opendevin/README.md) - - [server](./opendevin/server/README.md) +- [openhands](./openhands/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. -## Sending Pull Requests to OpenDevin +## Sending Pull Requests to OpenHands ### 1. Fork the Official Repository -Fork the [OpenDevin repository](https://github.com/OpenDevin/OpenDevin) into your own account. +Fork the [OpenHands repository](https://github.com/All-Hands-AI/OpenHands) into your own account. Clone your own forked repository into your local environment: ```shell -git clone git@github.com:/OpenDevin.git +git clone git@github.com:/OpenHands.git ``` ### 2. Configure Git @@ -38,8 +38,8 @@ Set the official repository as your [upstream](https://www.atlassian.com/git/tut Add the original repository as upstream: ```shell -cd OpenDevin -git remote add upstream git@github.com:OpenDevin/OpenDevin.git +cd OpenHands +git remote add upstream git@github.com:All-Hands-AI/OpenHands.git ``` Verify that the remote is set: @@ -62,7 +62,7 @@ git push origin main ### 4. Set up the Development Environment -We have a separate doc [Development.md](https://github.com/OpenDevin/OpenDevin/blob/main/Development.md) that tells you how to set up a development workflow. +We have a separate doc [Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md) that tells you how to set up a development workflow. ### 5. Write Code and Commit It @@ -80,13 +80,13 @@ git push origin my_branch * On GitHub, go to the page of your forked repository, and create a Pull Request: - Click on `Branches` - Click on the `...` beside your branch and click on `New pull request` - - Set `base repository` to `OpenDevin/OpenDevin` + - Set `base repository` to `All-Hands-AI/OpenHands` - Set `base` to `main` - Click `Create pull request` -The PR should appear in [OpenDevin PRs](https://github.com/OpenDevin/OpenDevin/pulls). +The PR should appear in [OpenHands PRs](https://github.com/All-Hands-AI/OpenHands/pulls). -Then the OpenDevin team will review your code. +Then the OpenHands team will review your code. ## PR Rules @@ -109,7 +109,7 @@ For example, a PR title could be: - `refactor: modify package path` - `feat(frontend): xxxx`, where `(frontend)` means that this PR mainly focuses on the frontend component. -You may also check out previous PRs in the [PR list](https://github.com/OpenDevin/OpenDevin/pulls). +You may also check out previous PRs in the [PR list](https://github.com/All-Hands-AI/OpenHands/pulls). ### 2. Pull Request description - If your PR is small (such as a typo fix), you can go brief. diff --git a/CREDITS.md b/CREDITS.md index ac87309f2f..2bc97704a7 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -2,19 +2,19 @@ ## Contributors -We would like to thank all the [contributors](https://github.com/opendevin/opendevin/graphs/contributors) who have helped make OpenDevin possible. Your dedication and hard work are greatly appreciated. +We would like to thank all the [contributors](https://github.com/All-Hands-AI/OpenHands/graphs/contributors) who have helped make OpenHands possible. Your dedication and hard work are greatly appreciated. ## Open Source Projects -OpenDevin includes and adapts the following open source projects. We are grateful for their contributions to the open source community: +OpenHands includes and adapts the following open source projects. We are grateful for their contributions to the open source community: #### [SWE Agent](https://github.com/princeton-nlp/swe-agent) - License: MIT License - - Description: Adapted for use in OpenDevin's agenthub + - Description: Adapted for use in OpenHands's agenthub #### [Aider](https://github.com/paul-gauthier/aider) - License: Apache License 2.0 - - Description: AI pair programming tool. OpenDevin has adapted and integrated its linter module for code-related tasks in [`agentskills utilities`](https://github.com/OpenDevin/OpenDevin/tree/main/opendevin/runtime/plugins/agent_skills/utils/aider) + - Description: AI pair programming tool. OpenHands has adapted and integrated its linter module for code-related tasks in [`agentskills utilities`](https://github.com/All-Hands-AI/OpenHands/tree/main/openhands/runtime/plugins/agent_skills/utils/aider) #### [BrowserGym](https://github.com/ServiceNow/BrowserGym) - License: Apache License 2.0 @@ -22,7 +22,7 @@ OpenDevin includes and adapts the following open source projects. We are gratefu ### Reference Implementations for Evaluation Benchmarks -OpenDevin integrates code of the reference implementations for the following agent evaluation benchmarks: +OpenHands integrates code of the reference implementations for the following agent evaluation benchmarks: #### [HumanEval](https://github.com/openai/human-eval) - License: MIT License diff --git a/Development.md b/Development.md index 8a72c8af1e..2b79f29570 100644 --- a/Development.md +++ b/Development.md @@ -1,7 +1,7 @@ # Development Guide -This guide is for people working on OpenDevin and editing the source code. -If you wish to contribute your changes, check out the [CONTRIBUTING.md](https://github.com/OpenDevin/OpenDevin/blob/main/CONTRIBUTING.md) on how to clone and setup the project initially before moving on. -Otherwise, you can clone the OpenDevin project directly. +This guide is for people working on OpenHands and editing the source code. +If you wish to contribute your changes, check out the [CONTRIBUTING.md](https://github.com/All-Hands-AI/OpenHands/blob/main/CONTRIBUTING.md) on how to clone and setup the project initially before moving on. +Otherwise, you can clone the OpenHands project directly. ## Start the server for development ### 1. Requirements @@ -29,14 +29,14 @@ mamba install conda-forge::poetry ``` ### 2. Build and Setup The Environment -Begin by building the project which includes setting up the environment and installing dependencies. This step ensures that OpenDevin is ready to run on your system: +Begin by building the project which includes setting up the environment and installing dependencies. This step ensures that OpenHands is ready to run on your system: ```bash make build ``` ### 3. Configuring the Language Model -OpenDevin supports a diverse array of Language Models (LMs) through the powerful [litellm](https://docs.litellm.ai) library. By default, we've chosen the mighty GPT-4 from OpenAI as our go-to model, but the world is your oyster! You can unleash the potential of Anthropic's suave Claude, the enigmatic Llama, or any other LM that piques your interest. +OpenHands supports a diverse array of Language Models (LMs) through the powerful [litellm](https://docs.litellm.ai) library. By default, we've chosen the mighty GPT-4 from OpenAI as our go-to model, but the world is your oyster! You can unleash the potential of Anthropic's suave Claude, the enigmatic Llama, or any other LM that piques your interest. To configure the LM of your choice, run: @@ -44,20 +44,20 @@ To configure the LM of your choice, run: make setup-config ``` - This command will prompt you to enter the LLM API key, model name, and other variables ensuring that OpenDevin is tailored to your specific needs. Note that the model name will apply only when you run headless. If you use the UI, please set the model in the UI. + This command will prompt you to enter the LLM API key, model name, and other variables ensuring that OpenHands is tailored to your specific needs. Note that the model name will apply only when you run headless. If you use the UI, please set the model in the UI. - Note: If you have previously run OpenDevin using the docker command, you may have already set some environmental variables in your terminal. The final configurations are set from highest to lowest priority: + Note: If you have previously run OpenHands using the docker command, you may have already set some environmental variables in your terminal. The final configurations are set from highest to lowest priority: Environment variables > config.toml variables > default variables **Note on Alternative Models:** Some alternative models may prove more challenging to tame than others. Fear not, brave adventurer! We shall soon unveil LLM-specific documentation to guide you on your quest. -And if you've already mastered the art of wielding a model other than OpenAI's GPT, we encourage you to share your setup instructions with us by creating instructions and adding it [to our documentation](https://github.com/OpenDevin/OpenDevin/tree/main/docs/modules/usage/llms). +And if you've already mastered the art of wielding a model other than OpenAI's GPT, we encourage you to share your setup instructions with us by creating instructions and adding it [to our documentation](https://github.com/All-Hands-AI/OpenHands/tree/main/docs/modules/usage/llms). For a full list of the LM providers and models available, please consult the [litellm documentation](https://docs.litellm.ai/docs/providers). ### 4. Running the application #### Option A: Run the Full Application -Once the setup is complete, launching OpenDevin is as simple as running a single command. This command starts both the backend and frontend servers seamlessly, allowing you to interact with OpenDevin: +Once the setup is complete, launching OpenHands is as simple as running a single command. This command starts both the backend and frontend servers seamlessly, allowing you to interact with OpenHands: ```bash make run ``` @@ -75,10 +75,10 @@ make run ### 6. LLM Debugging If you encounter any issues with the Language Model (LM) or you're simply curious, you can inspect the actual LLM prompts and responses. To do so, export DEBUG=1 in the environment and restart the backend. -OpenDevin will then log the prompts and responses in the logs/llm/CURRENT_DATE directory, allowing you to identify the causes. +OpenHands will then log the prompts and responses in the logs/llm/CURRENT_DATE directory, allowing you to identify the causes. ### 7. Help -Need assistance or information on available targets and commands? The help command provides all the necessary guidance to ensure a smooth experience with OpenDevin. +Need assistance or information on available targets and commands? The help command provides all the necessary guidance to ensure a smooth experience with OpenHands. ```bash make help ``` diff --git a/Makefile b/Makefile index c4f145c15d..4641b66587 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ SHELL=/bin/bash -# Makefile for OpenDevin project +# Makefile for OpenHands project # Variables -DOCKER_IMAGE = ghcr.io/opendevin/sandbox:main +DOCKER_IMAGE = ghcr.io/openhands/sandbox:main BACKEND_PORT = 3000 BACKEND_HOST = "127.0.0.1:$(BACKEND_PORT)" FRONTEND_PORT = 3001 @@ -166,7 +166,7 @@ install-pre-commit-hooks: lint-backend: @echo "$(YELLOW)Running linters...$(RESET)" - @poetry run pre-commit run --files opendevin/**/* agenthub/**/* evaluation/**/* --show-diff-on-failure --config $(PRE_COMMIT_CONFIG_PATH) + @poetry run pre-commit run --files openhands/**/* agenthub/**/* evaluation/**/* --show-diff-on-failure --config $(PRE_COMMIT_CONFIG_PATH) lint-frontend: @echo "$(YELLOW)Running linters for frontend...$(RESET)" @@ -190,7 +190,7 @@ build-frontend: # Start backend start-backend: @echo "$(YELLOW)Starting backend...$(RESET)" - @poetry run uvicorn opendevin.server.listen:app --port $(BACKEND_PORT) --reload --reload-exclude "workspace/*" + @poetry run uvicorn openhands.server.listen:app --port $(BACKEND_PORT) --reload --reload-exclude "workspace/*" # Start frontend start-frontend: @@ -205,7 +205,7 @@ _run_setup: fi @mkdir -p logs @echo "$(YELLOW)Starting backend server...$(RESET)" - @poetry run uvicorn opendevin.server.listen:app --port $(BACKEND_PORT) & + @poetry run uvicorn openhands.server.listen:app --port $(BACKEND_PORT) & @echo "$(YELLOW)Waiting for the backend to start...$(RESET)" @until nc -z localhost $(BACKEND_PORT); do sleep 0.1; done @echo "$(GREEN)Backend started successfully.$(RESET)" @@ -280,7 +280,7 @@ setup-config-prompts: # Clean up all caches clean: @echo "$(YELLOW)Cleaning up caches...$(RESET)" - @rm -rf opendevin/.cache + @rm -rf openhands/.cache @echo "$(GREEN)Caches cleaned up successfully.$(RESET)" # Help @@ -289,11 +289,11 @@ help: @echo "Targets:" @echo " $(GREEN)build$(RESET) - Build project, including environment setup and dependencies." @echo " $(GREEN)lint$(RESET) - Run linters on the project." - @echo " $(GREEN)setup-config$(RESET) - Setup the configuration for OpenDevin by providing LLM API key," + @echo " $(GREEN)setup-config$(RESET) - Setup the configuration for OpenHands by providing LLM API key," @echo " LLM Model name, and workspace directory." - @echo " $(GREEN)start-backend$(RESET) - Start the backend server for the OpenDevin project." - @echo " $(GREEN)start-frontend$(RESET) - Start the frontend server for the OpenDevin project." - @echo " $(GREEN)run$(RESET) - Run the OpenDevin application, starting both backend and frontend servers." + @echo " $(GREEN)start-backend$(RESET) - Start the backend server for the OpenHands project." + @echo " $(GREEN)start-frontend$(RESET) - Start the frontend server for the OpenHands project." + @echo " $(GREEN)run$(RESET) - Run the OpenHands application, starting both backend and frontend servers." @echo " Backend Log file will be stored in the 'logs' directory." @echo " $(GREEN)help$(RESET) - Display this help message, providing information on available targets." diff --git a/README.md b/README.md index 949e1c22dd..2d2f2c2502 100644 --- a/README.md +++ b/README.md @@ -18,40 +18,40 @@ -->
- Contributors - Forks - Stargazers - Issues - MIT License - Credits + Contributors + Forks + Stargazers + Issues + MIT License + Credits
- Join our Slack community + Join our Slack community Join our Discord community - CodeCov + CodeCov
Logo -

OpenDevin: Code Less, Make More

- Check out the documentation +

OpenHands: Code Less, Make More

+ Check out the documentation Paper on Arxiv
- Evaluation Benchmark + Evaluation Benchmark

-Welcome to OpenDevin, a platform for autonomous software engineers, powered by AI and LLMs. +Welcome to OpenHands, a platform for autonomous software engineers, powered by AI and LLMs. -OpenDevin agents collaborate with human developers to write code, fix bugs, and ship features. +OpenHands agents collaborate with human developers to write code, fix bugs, and ship features. ![App screenshot](./docs/static/img/screenshot.png) ## ⚡ Getting Started -OpenDevin works best with Docker version 26.0.0+ (Docker Desktop 4.31.0+). +OpenHands works best with Docker version 26.0.0+ (Docker Desktop 4.31.0+). You must be using Linux, Mac OS, or WSL on Windows. -To start OpenDevin in a docker container, run the following commands in your terminal: +To start OpenHands in a docker container, run the following commands in your terminal: > [!WARNING] > When you run the following command, files in `./workspace` may be modified or deleted. @@ -66,30 +66,30 @@ docker run -it \ -v /var/run/docker.sock:/var/run/docker.sock \ -p 3000:3000 \ --add-host host.docker.internal:host-gateway \ - --name opendevin-app-$(date +%Y%m%d%H%M%S) \ + --name openhands-app-$(date +%Y%m%d%H%M%S) \ ghcr.io/opendevin/opendevin:0.8 ``` > [!NOTE] -> By default, this command pulls the `latest` tag, which represents the most recent release of OpenDevin. You have other options as well: -> - For a specific release version, use `ghcr.io/opendevin/opendevin:` (replace with the desired version number). +> By default, this command pulls the `latest` tag, which represents the most recent release of OpenHands. You have other options as well: +> - For a specific release version, use `ghcr.io/opendevin/opendevin:` (replace with the desired version number). > - For the most up-to-date development version, use `ghcr.io/opendevin/opendevin:main`. This version may be **(unstable!)** and is recommended for testing or development purposes only. > > Choose the tag that best suits your needs based on stability requirements and desired features. -You'll find OpenDevin running at [http://localhost:3000](http://localhost:3000) with access to `./workspace`. To have OpenDevin operate on your code, place it in `./workspace`. -OpenDevin will only have access to this workspace folder. The rest of your system will not be affected as it runs in a secured docker sandbox. +You'll find OpenHands running at [http://localhost:3000](http://localhost:3000) with access to `./workspace`. To have OpenHands operate on your code, place it in `./workspace`. +OpenHands will only have access to this workspace folder. The rest of your system will not be affected as it runs in a secured docker sandbox. -Upon opening OpenDevin, you must select the appropriate `Model` and enter the `API Key` within the settings that should pop up automatically. These can be set at any time by selecting +Upon opening OpenHands, you must select the appropriate `Model` and enter the `API Key` within the settings that should pop up automatically. These can be set at any time by selecting the `Settings` button (gear icon) in the UI. If the required `Model` does not exist in the list, you can manually enter it in the text box. -For the development workflow, see [Development.md](https://github.com/OpenDevin/OpenDevin/blob/main/Development.md). +For the development workflow, see [Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md). Are you having trouble? Check out our [Troubleshooting Guide](https://docs.all-hands.dev/modules/usage/troubleshooting). ## 🚀 Documentation -To learn more about the project, and for tips on using OpenDevin, +To learn more about the project, and for tips on using OpenHands, **check out our [documentation](https://docs.all-hands.dev/modules/usage/intro)**. There you'll find resources on how to use different LLM providers (like ollama and Anthropic's Claude), @@ -97,29 +97,29 @@ troubleshooting resources, and advanced configuration options. ## 🤝 How to Contribute -OpenDevin is a community-driven project, and we welcome contributions from everyone. +OpenHands is a community-driven project, and we welcome contributions from everyone. Whether you're a developer, a researcher, or simply enthusiastic about advancing the field of software engineering with AI, there are many ways to get involved: - **Code Contributions:** Help us develop new agents, core functionality, the frontend and other interfaces, or sandboxing solutions. - **Research and Evaluation:** Contribute to our understanding of LLMs in software engineering, participate in evaluating the models, or suggest improvements. -- **Feedback and Testing:** Use the OpenDevin toolset, report bugs, suggest features, or provide feedback on usability. +- **Feedback and Testing:** Use the OpenHands toolset, report bugs, suggest features, or provide feedback on usability. For details, please check [CONTRIBUTING.md](./CONTRIBUTING.md). ## 🤖 Join Our Community -Whether you're a developer, a researcher, or simply enthusiastic about OpenDevin, we'd love to have you in our community. +Whether you're a developer, a researcher, or simply enthusiastic about OpenHands, we'd love to have you in our community. Let's make software engineering better together! -- [Slack workspace](https://join.slack.com/t/opendevin/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw) - Here we talk about research, architecture, and future development. +- [Slack workspace](https://join.slack.com/t/openhands/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw) - Here we talk about research, architecture, and future development. - [Discord server](https://discord.gg/ESHStjSjD4) - This is a community-run server for general discussion, questions, and feedback. ## 📈 Progress

- - Star History Chart + + Star History Chart

@@ -127,22 +127,22 @@ Let's make software engineering better together! Distributed under the MIT License. See [`LICENSE`](./LICENSE) for more information. -[contributors-shield]: https://img.shields.io/github/contributors/opendevin/opendevin?style=for-the-badge -[contributors-url]: https://github.com/OpenDevin/OpenDevin/graphs/contributors -[forks-shield]: https://img.shields.io/github/forks/opendevin/opendevin?style=for-the-badge -[forks-url]: https://github.com/OpenDevin/OpenDevin/network/members -[stars-shield]: https://img.shields.io/github/stars/opendevin/opendevin?style=for-the-badge -[stars-url]: https://github.com/OpenDevin/OpenDevin/stargazers -[issues-shield]: https://img.shields.io/github/issues/opendevin/opendevin?style=for-the-badge -[issues-url]: https://github.com/OpenDevin/OpenDevin/issues -[license-shield]: https://img.shields.io/github/license/opendevin/opendevin?style=for-the-badge -[license-url]: https://github.com/OpenDevin/OpenDevin/blob/main/LICENSE +[contributors-shield]: https://img.shields.io/github/contributors/All-Hands-AI/OpenHands?style=for-the-badge +[contributors-url]: https://github.com/All-Hands-AI/OpenHands/graphs/contributors +[forks-shield]: https://img.shields.io/github/forks/All-Hands-AI/OpenHands?style=for-the-badge +[forks-url]: https://github.com/All-Hands-AI/OpenHands/network/members +[stars-shield]: https://img.shields.io/github/stars/All-Hands-AI/OpenHands?style=for-the-badge +[stars-url]: https://github.com/All-Hands-AI/OpenHands/stargazers +[issues-shield]: https://img.shields.io/github/issues/All-Hands-AI/OpenHands?style=for-the-badge +[issues-url]: https://github.com/All-Hands-AI/OpenHands/issues +[license-shield]: https://img.shields.io/github/license/All-Hands-AI/OpenHands?style=for-the-badge +[license-url]: https://github.com/All-Hands-AI/OpenHands/blob/main/LICENSE ## 🙏 Acknowledgements -OpenDevin is built by a large number of contributors, and every contribution is greatly appreciated! We also build upon other open source projects, and we are deeply thankful for their work. +OpenHands is built by a large number of contributors, and every contribution is greatly appreciated! We also build upon other open source projects, and we are deeply thankful for their work. -For a list of open source projects and licenses used in OpenDevin, please see our [CREDITS.md](./CREDITS.md) file. +For a list of open source projects and licenses used in OpenHands, please see our [CREDITS.md](./CREDITS.md) file. ## 📚 Cite diff --git a/agenthub/README.md b/agenthub/README.md index 76d738e005..46e8fa9664 100644 --- a/agenthub/README.md +++ b/agenthub/README.md @@ -7,17 +7,17 @@ Contributors from different backgrounds and interests can choose to contribute t ## Constructing an Agent -The abstraction for an agent can be found [here](../opendevin/controller/agent.py). +The abstraction for an agent can be found [here](../openhands/controller/agent.py). Agents are run inside of a loop. At each iteration, `agent.step()` is called with a -[State](../opendevin/controller/state/state.py) input, and the agent must output an [Action](../opendevin/events/action). +[State](../openhands/controller/state/state.py) input, and the agent must output an [Action](../openhands/events/action). Every agent also has a `self.llm` which it can use to interact with the LLM configured by the user. See the [LiteLLM docs for `self.llm.completion`](https://docs.litellm.ai/docs/completion). ## State -The `state` represents the running state of an agent in the OpenDevin system. The class handles saving and restoring the agent session. It is serialized in a pickle. +The `state` represents the running state of an agent in the OpenHands system. The class handles saving and restoring the agent session. It is serialized in a pickle. The State object stores information about: @@ -46,17 +46,17 @@ The agent can add and modify subtasks through the `AddTaskAction` and `ModifyTas Here is a list of available Actions, which can be returned by `agent.step()`: -- [`CmdRunAction`](../opendevin/events/action/commands.py) - Runs a command inside a sandboxed terminal -- [`IPythonRunCellAction`](../opendevin/events/action/commands.py) - Execute a block of Python code interactively (in Jupyter notebook) and receives `CmdOutputObservation`. Requires setting up `jupyter` [plugin](../opendevin/runtime/plugins) as a requirement. -- [`FileReadAction`](../opendevin/events/action/files.py) - Reads the content of a file -- [`FileWriteAction`](../opendevin/events/action/files.py) - Writes new content to a file -- [`BrowseURLAction`](../opendevin/events/action/browse.py) - Gets the content of a URL -- [`AddTaskAction`](../opendevin/events/action/tasks.py) - Adds a subtask to the plan -- [`ModifyTaskAction`](../opendevin/events/action/tasks.py) - Changes the state of a subtask. -- [`AgentFinishAction`](../opendevin/events/action/agent.py) - Stops the control loop, allowing the user/delegator agent to enter a new task -- [`AgentRejectAction`](../opendevin/events/action/agent.py) - Stops the control loop, allowing the user/delegator agent to enter a new task -- [`AgentFinishAction`](../opendevin/events/action/agent.py) - Stops the control loop, allowing the user to enter a new task -- [`MessageAction`](../opendevin/events/action/message.py) - Represents a message from an agent or the user +- [`CmdRunAction`](../openhands/events/action/commands.py) - Runs a command inside a sandboxed terminal +- [`IPythonRunCellAction`](../openhands/events/action/commands.py) - Execute a block of Python code interactively (in Jupyter notebook) and receives `CmdOutputObservation`. Requires setting up `jupyter` [plugin](../openhands/runtime/plugins) as a requirement. +- [`FileReadAction`](../openhands/events/action/files.py) - Reads the content of a file +- [`FileWriteAction`](../openhands/events/action/files.py) - Writes new content to a file +- [`BrowseURLAction`](../openhands/events/action/browse.py) - Gets the content of a URL +- [`AddTaskAction`](../openhands/events/action/tasks.py) - Adds a subtask to the plan +- [`ModifyTaskAction`](../openhands/events/action/tasks.py) - Changes the state of a subtask. +- [`AgentFinishAction`](../openhands/events/action/agent.py) - Stops the control loop, allowing the user/delegator agent to enter a new task +- [`AgentRejectAction`](../openhands/events/action/agent.py) - Stops the control loop, allowing the user/delegator agent to enter a new task +- [`AgentFinishAction`](../openhands/events/action/agent.py) - Stops the control loop, allowing the user to enter a new task +- [`MessageAction`](../openhands/events/action/message.py) - Represents a message from an agent or the user To serialize and deserialize an action, you can use: - `action.to_dict()` to serialize the action to a dictionary to be sent to the UI, including a user-friendly string representation of the message @@ -70,12 +70,12 @@ But they may also appear as a result of asynchronous events (e.g. a message from Here is a list of available Observations: -- [`CmdOutputObservation`](../opendevin/events/observation/commands.py) -- [`BrowserOutputObservation`](../opendevin/events/observation/browse.py) -- [`FileReadObservation`](../opendevin/events/observation/files.py) -- [`FileWriteObservation`](../opendevin/events/observation/files.py) -- [`ErrorObservation`](../opendevin/events/observation/error.py) -- [`SuccessObservation`](../opendevin/events/observation/success.py) +- [`CmdOutputObservation`](../openhands/events/observation/commands.py) +- [`BrowserOutputObservation`](../openhands/events/observation/browse.py) +- [`FileReadObservation`](../openhands/events/observation/files.py) +- [`FileWriteObservation`](../openhands/events/observation/files.py) +- [`ErrorObservation`](../openhands/events/observation/error.py) +- [`SuccessObservation`](../openhands/events/observation/success.py) You can use `observation.to_dict()` and `observation_from_dict` to serialize and deserialize observations. @@ -94,7 +94,7 @@ sending a prompt to the LLM, then parsing the response into an `Action`. ## Agent Delegation -OpenDevin is a multi-agentic system. Agents can delegate tasks to other agents, whether +OpenHands is a multi-agentic system. Agents can delegate tasks to other agents, whether prompted by the user, or when the agent decides to ask another agent for help. For example, the `CodeActAgent` might delegate to the `BrowsingAgent` to answer questions that involve browsing the web. The Delegator Agent forwards tasks to micro-agents, such as 'RepoStudyAgent' to study a repo, @@ -102,7 +102,7 @@ or 'VerifierAgent' to verify a task completion. ### Understanding the terminology -A `task` is an end-to-end conversation between OpenDevin (the whole system) and the user, +A `task` is an end-to-end conversation between OpenHands (the whole system) and the user, which might involve one or more inputs from the user. It starts with an initial input (typically a task statement) from the user, and ends with either an `AgentFinishAction` initiated by the agent, a stop initiated by the user, or an error. @@ -113,7 +113,7 @@ itself. Otherwise, a `task` consists of multiple `subtasks`, each executed by one agent. For example, considering a task from the user: `tell me how many GitHub stars -OpenDevin repo has`. Let's assume the default agent is CodeActAgent. +OpenHands repo has`. Let's assume the default agent is CodeActAgent. ``` -- TASK STARTS (SUBTASK 0 STARTS) -- diff --git a/agenthub/__init__.py b/agenthub/__init__.py index 7c445d7881..4c476b43be 100644 --- a/agenthub/__init__.py +++ b/agenthub/__init__.py @@ -1,6 +1,6 @@ from dotenv import load_dotenv -from opendevin.controller.agent import Agent +from openhands.controller.agent import Agent from .micro.agent import MicroAgent from .micro.registry import all_microagents diff --git a/agenthub/browsing_agent/README.md b/agenthub/browsing_agent/README.md index 4b7c05b68a..9f8ca36277 100644 --- a/agenthub/browsing_agent/README.md +++ b/agenthub/browsing_agent/README.md @@ -8,7 +8,7 @@ This folder implements the basic BrowserGym [demo agent](https://github.com/Serv Note that for browsing tasks, GPT-4 is usually a requirement to get reasonable results, due to the complexity of the web page structures. ``` -poetry run python ./opendevin/core/main.py \ +poetry run python ./openhands/core/main.py \ -i 10 \ -t "tell me the usa's president using google search" \ -c BrowsingAgent \ diff --git a/agenthub/browsing_agent/__init__.py b/agenthub/browsing_agent/__init__.py index ea504ea91b..6f25e3da81 100644 --- a/agenthub/browsing_agent/__init__.py +++ b/agenthub/browsing_agent/__init__.py @@ -1,4 +1,4 @@ -from opendevin.controller.agent import Agent +from openhands.controller.agent import Agent from .browsing_agent import BrowsingAgent diff --git a/agenthub/browsing_agent/browsing_agent.py b/agenthub/browsing_agent/browsing_agent.py index 83566d8b3d..b86576c6ed 100644 --- a/agenthub/browsing_agent/browsing_agent.py +++ b/agenthub/browsing_agent/browsing_agent.py @@ -4,22 +4,22 @@ from browsergym.core.action.highlevel import HighLevelActionSet from browsergym.utils.obs import flatten_axtree_to_str from agenthub.browsing_agent.response_parser import BrowsingResponseParser -from opendevin.controller.agent import Agent -from opendevin.controller.state.state import State -from opendevin.core.config import AgentConfig -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.message import Message, TextContent -from opendevin.events.action import ( +from openhands.controller.agent import Agent +from openhands.controller.state.state import State +from openhands.core.config import AgentConfig +from openhands.core.logger import openhands_logger as logger +from openhands.core.message import Message, TextContent +from openhands.events.action import ( Action, AgentFinishAction, BrowseInteractiveAction, MessageAction, ) -from opendevin.events.event import EventSource -from opendevin.events.observation import BrowserOutputObservation -from opendevin.events.observation.observation import Observation -from opendevin.llm.llm import LLM -from opendevin.runtime.plugins import ( +from openhands.events.event import EventSource +from openhands.events.observation import BrowserOutputObservation +from openhands.events.observation.observation import Observation +from openhands.llm.llm import LLM +from openhands.runtime.plugins import ( PluginRequirement, ) @@ -165,7 +165,7 @@ class BrowsingAgent(Agent): prev_action_str = '\n'.join(prev_actions) # if the final BrowserInteractiveAction exec BrowserGym's send_msg_to_user, - # we should also send a message back to the user in OpenDevin and call it a day + # we should also send a message back to the user in OpenHands and call it a day if ( isinstance(last_action, BrowseInteractiveAction) and last_action.browsergym_send_msg_to_user diff --git a/agenthub/browsing_agent/prompt.py b/agenthub/browsing_agent/prompt.py index 3dfd7f5022..aa0e6b929f 100644 --- a/agenthub/browsing_agent/prompt.py +++ b/agenthub/browsing_agent/prompt.py @@ -12,7 +12,7 @@ from browsergym.core.action.base import AbstractActionSet from browsergym.core.action.highlevel import HighLevelActionSet from browsergym.core.action.python import PythonActionSet -from opendevin.runtime.browser.browser_env import BrowserEnv +from openhands.runtime.browser.browser_env import BrowserEnv from .utils import ( ParseError, diff --git a/agenthub/browsing_agent/response_parser.py b/agenthub/browsing_agent/response_parser.py index 9b64748880..8c9e838ad7 100644 --- a/agenthub/browsing_agent/response_parser.py +++ b/agenthub/browsing_agent/response_parser.py @@ -1,8 +1,8 @@ import ast -from opendevin.controller.action_parser import ActionParser, ResponseParser -from opendevin.core.logger import opendevin_logger as logger -from opendevin.events.action import ( +from openhands.controller.action_parser import ActionParser, ResponseParser +from openhands.core.logger import openhands_logger as logger +from openhands.events.action import ( Action, BrowseInteractiveAction, ) diff --git a/agenthub/codeact_agent/README.md b/agenthub/codeact_agent/README.md index e828b0be30..25d2b8c9a4 100644 --- a/agenthub/codeact_agent/README.md +++ b/agenthub/codeact_agent/README.md @@ -9,17 +9,17 @@ The conceptual idea is illustrated below. At each turn, the agent can: - Execute any valid Linux `bash` command - Execute any valid `Python` code with [an interactive Python interpreter](https://ipython.org/). This is simulated through `bash` command, see plugin system below for more details. -![image](https://github.com/OpenDevin/OpenDevin/assets/38853559/92b622e3-72ad-4a61-8f41-8c040b6d5fb3) +![image](https://github.com/All-Hands-AI/OpenHands/assets/38853559/92b622e3-72ad-4a61-8f41-8c040b6d5fb3) ## Plugin System -To make the CodeAct agent more powerful with only access to `bash` action space, CodeAct agent leverages OpenDevin's plugin system: -- [Jupyter plugin](https://github.com/OpenDevin/OpenDevin/tree/main/opendevin/runtime/plugins/jupyter): for IPython execution via bash command -- [SWE-agent tool plugin](https://github.com/OpenDevin/OpenDevin/tree/main/opendevin/runtime/plugins/swe_agent_commands): Powerful bash command line tools for software development tasks introduced by [swe-agent](https://github.com/princeton-nlp/swe-agent). +To make the CodeAct agent more powerful with only access to `bash` action space, CodeAct agent leverages OpenHands's plugin system: +- [Jupyter plugin](https://github.com/All-Hands-AI/OpenHands/tree/main/openhands/runtime/plugins/jupyter): for IPython execution via bash command +- [SWE-agent tool plugin](https://github.com/All-Hands-AI/OpenHands/tree/main/openhands/runtime/plugins/swe_agent_commands): Powerful bash command line tools for software development tasks introduced by [swe-agent](https://github.com/princeton-nlp/swe-agent). ## Demo -https://github.com/OpenDevin/OpenDevin/assets/38853559/f592a192-e86c-4f48-ad31-d69282d5f6ac +https://github.com/All-Hands-AI/OpenHands/assets/38853559/f592a192-e86c-4f48-ad31-d69282d5f6ac *Example of CodeActAgent with `gpt-4-turbo-2024-04-09` performing a data science task (linear regression)* diff --git a/agenthub/codeact_agent/__init__.py b/agenthub/codeact_agent/__init__.py index 9f877f5475..c8a924dc4b 100644 --- a/agenthub/codeact_agent/__init__.py +++ b/agenthub/codeact_agent/__init__.py @@ -1,4 +1,4 @@ -from opendevin.controller.agent import Agent +from openhands.controller.agent import Agent from .codeact_agent import CodeActAgent diff --git a/agenthub/codeact_agent/action_parser.py b/agenthub/codeact_agent/action_parser.py index 2491efcb37..96d9245afb 100644 --- a/agenthub/codeact_agent/action_parser.py +++ b/agenthub/codeact_agent/action_parser.py @@ -1,7 +1,7 @@ import re -from opendevin.controller.action_parser import ActionParser, ResponseParser -from opendevin.events.action import ( +from openhands.controller.action_parser import ActionParser, ResponseParser +from openhands.events.action import ( Action, AgentDelegateAction, AgentFinishAction, diff --git a/agenthub/codeact_agent/codeact_agent.py b/agenthub/codeact_agent/codeact_agent.py index 19ac15fdb6..fe3e25a23d 100644 --- a/agenthub/codeact_agent/codeact_agent.py +++ b/agenthub/codeact_agent/codeact_agent.py @@ -1,11 +1,11 @@ import os from agenthub.codeact_agent.action_parser import CodeActResponseParser -from opendevin.controller.agent import Agent -from opendevin.controller.state.state import State -from opendevin.core.config import AgentConfig -from opendevin.core.message import ImageContent, Message, TextContent -from opendevin.events.action import ( +from openhands.controller.agent import Agent +from openhands.controller.state.state import State +from openhands.core.config import AgentConfig +from openhands.core.message import ImageContent, Message, TextContent +from openhands.events.action import ( Action, AgentDelegateAction, AgentFinishAction, @@ -13,21 +13,21 @@ from opendevin.events.action import ( IPythonRunCellAction, MessageAction, ) -from opendevin.events.observation import ( +from openhands.events.observation import ( AgentDelegateObservation, CmdOutputObservation, IPythonRunCellObservation, ) -from opendevin.events.observation.error import ErrorObservation -from opendevin.events.observation.observation import Observation -from opendevin.events.serialization.event import truncate_content -from opendevin.llm.llm import LLM -from opendevin.runtime.plugins import ( +from openhands.events.observation.error import ErrorObservation +from openhands.events.observation.observation import Observation +from openhands.events.serialization.event import truncate_content +from openhands.llm.llm import LLM +from openhands.runtime.plugins import ( AgentSkillsRequirement, JupyterRequirement, PluginRequirement, ) -from opendevin.utils.prompt import PromptManager +from openhands.utils.prompt import PromptManager class CodeActAgent(Agent): @@ -47,7 +47,7 @@ class CodeActAgent(Agent): - Execute any valid Linux `bash` command - Execute any valid `Python` code with [an interactive Python interpreter](https://ipython.org/). This is simulated through `bash` command, see plugin system below for more details. - ![image](https://github.com/OpenDevin/OpenDevin/assets/38853559/92b622e3-72ad-4a61-8f41-8c040b6d5fb3) + ![image](https://github.com/All-Hands-AI/OpenHands/assets/38853559/92b622e3-72ad-4a61-8f41-8c040b6d5fb3) """ diff --git a/agenthub/codeact_agent/user_prompt.j2 b/agenthub/codeact_agent/user_prompt.j2 index 60a7fd5c91..bae6bfc18c 100644 --- a/agenthub/codeact_agent/user_prompt.j2 +++ b/agenthub/codeact_agent/user_prompt.j2 @@ -95,8 +95,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/agenthub/codeact_swe_agent/README.md b/agenthub/codeact_swe_agent/README.md index b52031a037..ec88537aaa 100644 --- a/agenthub/codeact_swe_agent/README.md +++ b/agenthub/codeact_swe_agent/README.md @@ -1,6 +1,6 @@ # CodeAct (SWE Edit Specialized) -This agent is an adaptation of the original [SWE Agent](https://swe-agent.com/) based on CodeAct using the `agentskills` library of OpenDevin. +This agent is an adaptation of the original [SWE Agent](https://swe-agent.com/) based on CodeAct using the `agentskills` library of OpenHands. Its intended use is **solving GitHub issues**. diff --git a/agenthub/codeact_swe_agent/__init__.py b/agenthub/codeact_swe_agent/__init__.py index 22c6d623f7..b634777fbe 100644 --- a/agenthub/codeact_swe_agent/__init__.py +++ b/agenthub/codeact_swe_agent/__init__.py @@ -1,4 +1,4 @@ -from opendevin.controller.agent import Agent +from openhands.controller.agent import Agent from .codeact_swe_agent import CodeActSWEAgent diff --git a/agenthub/codeact_swe_agent/action_parser.py b/agenthub/codeact_swe_agent/action_parser.py index d51a6c6ec1..c77c1404a6 100644 --- a/agenthub/codeact_swe_agent/action_parser.py +++ b/agenthub/codeact_swe_agent/action_parser.py @@ -1,7 +1,7 @@ import re -from opendevin.controller.action_parser import ActionParser -from opendevin.events.action import ( +from openhands.controller.action_parser import ActionParser +from openhands.events.action import ( Action, AgentFinishAction, CmdRunAction, diff --git a/agenthub/codeact_swe_agent/codeact_swe_agent.py b/agenthub/codeact_swe_agent/codeact_swe_agent.py index d8d20de9fe..dd18d94a84 100644 --- a/agenthub/codeact_swe_agent/codeact_swe_agent.py +++ b/agenthub/codeact_swe_agent/codeact_swe_agent.py @@ -5,26 +5,26 @@ from agenthub.codeact_swe_agent.prompt import ( SYSTEM_SUFFIX, ) from agenthub.codeact_swe_agent.response_parser import CodeActSWEResponseParser -from opendevin.controller.agent import Agent -from opendevin.controller.state.state import State -from opendevin.core.config import AgentConfig -from opendevin.core.message import ImageContent, Message, TextContent -from opendevin.events.action import ( +from openhands.controller.agent import Agent +from openhands.controller.state.state import State +from openhands.core.config import AgentConfig +from openhands.core.message import ImageContent, Message, TextContent +from openhands.events.action import ( Action, AgentFinishAction, CmdRunAction, IPythonRunCellAction, MessageAction, ) -from opendevin.events.observation import ( +from openhands.events.observation import ( CmdOutputObservation, IPythonRunCellObservation, ) -from opendevin.events.observation.error import ErrorObservation -from opendevin.events.observation.observation import Observation -from opendevin.events.serialization.event import truncate_content -from opendevin.llm.llm import LLM -from opendevin.runtime.plugins import ( +from openhands.events.observation.error import ErrorObservation +from openhands.events.observation.observation import Observation +from openhands.events.serialization.event import truncate_content +from openhands.llm.llm import LLM +from openhands.runtime.plugins import ( AgentSkillsRequirement, JupyterRequirement, PluginRequirement, @@ -42,7 +42,7 @@ def get_in_context_example() -> str: class CodeActSWEAgent(Agent): VERSION = '1.6' """ - This agent is an adaptation of the original [SWE Agent](https://swe-agent.com/) based on CodeAct 1.5 using the `agentskills` library of OpenDevin. + This agent is an adaptation of the original [SWE Agent](https://swe-agent.com/) based on CodeAct 1.5 using the `agentskills` library of OpenHands. It is intended use is **solving Github issues**. diff --git a/agenthub/codeact_swe_agent/prompt.py b/agenthub/codeact_swe_agent/prompt.py index b83c489001..1a2ffabad9 100644 --- a/agenthub/codeact_swe_agent/prompt.py +++ b/agenthub/codeact_swe_agent/prompt.py @@ -1,4 +1,4 @@ -from opendevin.runtime.plugins import AgentSkillsRequirement +from openhands.runtime.plugins import AgentSkillsRequirement _AGENT_SKILLS_DOCS = AgentSkillsRequirement.documentation diff --git a/agenthub/codeact_swe_agent/response_parser.py b/agenthub/codeact_swe_agent/response_parser.py index e8e8d34e9e..e96b4494a2 100644 --- a/agenthub/codeact_swe_agent/response_parser.py +++ b/agenthub/codeact_swe_agent/response_parser.py @@ -4,8 +4,8 @@ from agenthub.codeact_swe_agent.action_parser import ( CodeActSWEActionParserIPythonRunCell, CodeActSWEActionParserMessage, ) -from opendevin.controller.action_parser import ResponseParser -from opendevin.events.action import Action +from openhands.controller.action_parser import ResponseParser +from openhands.events.action import Action class CodeActSWEResponseParser(ResponseParser): diff --git a/agenthub/delegator_agent/__init__.py b/agenthub/delegator_agent/__init__.py index dbae30af72..16b6705763 100644 --- a/agenthub/delegator_agent/__init__.py +++ b/agenthub/delegator_agent/__init__.py @@ -1,4 +1,4 @@ -from opendevin.controller.agent import Agent +from openhands.controller.agent import Agent from .agent import DelegatorAgent diff --git a/agenthub/delegator_agent/agent.py b/agenthub/delegator_agent/agent.py index 0938006440..29e0030423 100644 --- a/agenthub/delegator_agent/agent.py +++ b/agenthub/delegator_agent/agent.py @@ -1,9 +1,9 @@ -from opendevin.controller.agent import Agent -from opendevin.controller.state.state import State -from opendevin.core.config import AgentConfig -from opendevin.events.action import Action, AgentDelegateAction, AgentFinishAction -from opendevin.events.observation import AgentDelegateObservation -from opendevin.llm.llm import LLM +from openhands.controller.agent import Agent +from openhands.controller.state.state import State +from openhands.core.config import AgentConfig +from openhands.events.action import Action, AgentDelegateAction, AgentFinishAction +from openhands.events.observation import AgentDelegateObservation +from openhands.llm.llm import LLM class DelegatorAgent(Agent): diff --git a/agenthub/dummy_agent/__init__.py b/agenthub/dummy_agent/__init__.py index 831f488224..0a63c69129 100644 --- a/agenthub/dummy_agent/__init__.py +++ b/agenthub/dummy_agent/__init__.py @@ -1,4 +1,4 @@ -from opendevin.controller.agent import Agent +from openhands.controller.agent import Agent from .agent import DummyAgent diff --git a/agenthub/dummy_agent/agent.py b/agenthub/dummy_agent/agent.py index d2f9810a18..dbe4c60cfa 100644 --- a/agenthub/dummy_agent/agent.py +++ b/agenthub/dummy_agent/agent.py @@ -1,10 +1,10 @@ from typing import TypedDict, Union -from opendevin.controller.agent import Agent -from opendevin.controller.state.state import State -from opendevin.core.config import AgentConfig -from opendevin.core.schema import AgentState -from opendevin.events.action import ( +from openhands.controller.agent import Agent +from openhands.controller.state.state import State +from openhands.core.config import AgentConfig +from openhands.core.schema import AgentState +from openhands.events.action import ( Action, AddTaskAction, AgentFinishAction, @@ -17,7 +17,7 @@ from opendevin.events.action import ( MessageAction, ModifyTaskAction, ) -from opendevin.events.observation import ( +from openhands.events.observation import ( AgentStateChangedObservation, CmdOutputObservation, FileReadObservation, @@ -25,8 +25,8 @@ from opendevin.events.observation import ( NullObservation, Observation, ) -from opendevin.events.serialization.event import event_to_dict -from opendevin.llm.llm import LLM +from openhands.events.serialization.event import event_to_dict +from openhands.llm.llm import LLM """ FIXME: There are a few problems this surfaced diff --git a/agenthub/micro/agent.py b/agenthub/micro/agent.py index 57a002130b..d444e121bc 100644 --- a/agenthub/micro/agent.py +++ b/agenthub/micro/agent.py @@ -1,15 +1,15 @@ from jinja2 import BaseLoader, Environment -from opendevin.controller.agent import Agent -from opendevin.controller.state.state import State -from opendevin.core.config import AgentConfig -from opendevin.core.message import ImageContent, Message, TextContent -from opendevin.core.utils import json -from opendevin.events.action import Action -from opendevin.events.serialization.action import action_from_dict -from opendevin.events.serialization.event import event_to_memory -from opendevin.llm.llm import LLM -from opendevin.memory.history import ShortTermHistory +from openhands.controller.agent import Agent +from openhands.controller.state.state import State +from openhands.core.config import AgentConfig +from openhands.core.message import ImageContent, Message, TextContent +from openhands.core.utils import json +from openhands.events.action import Action +from openhands.events.serialization.action import action_from_dict +from openhands.events.serialization.event import event_to_memory +from openhands.llm.llm import LLM +from openhands.memory.history import ShortTermHistory from .instructions import instructions from .registry import all_microagents diff --git a/agenthub/micro/commit_writer/README.md b/agenthub/micro/commit_writer/README.md index f82484b91d..df9cd8c505 100644 --- a/agenthub/micro/commit_writer/README.md +++ b/agenthub/micro/commit_writer/README.md @@ -4,7 +4,7 @@ CommitWriterAgent can help write git commit message. Example: ```bash WORKSPACE_MOUNT_PATH="`PWD`" \ - poetry run python opendevin/core/main.py -t "dummy task" -c CommitWriterAgent -d ./ + poetry run python openhands/core/main.py -t "dummy task" -c CommitWriterAgent -d ./ ``` This agent is special in the sense that it doesn't need a task. Once called, diff --git a/agenthub/planner_agent/__init__.py b/agenthub/planner_agent/__init__.py index e447765391..385df5c001 100644 --- a/agenthub/planner_agent/__init__.py +++ b/agenthub/planner_agent/__init__.py @@ -1,4 +1,4 @@ -from opendevin.controller.agent import Agent +from openhands.controller.agent import Agent from .agent import PlannerAgent diff --git a/agenthub/planner_agent/agent.py b/agenthub/planner_agent/agent.py index 7a67e71667..7f23b34cc5 100644 --- a/agenthub/planner_agent/agent.py +++ b/agenthub/planner_agent/agent.py @@ -1,10 +1,10 @@ from agenthub.planner_agent.response_parser import PlannerResponseParser -from opendevin.controller.agent import Agent -from opendevin.controller.state.state import State -from opendevin.core.config import AgentConfig -from opendevin.core.message import ImageContent, Message, TextContent -from opendevin.events.action import Action, AgentFinishAction -from opendevin.llm.llm import LLM +from openhands.controller.agent import Agent +from openhands.controller.state.state import State +from openhands.core.config import AgentConfig +from openhands.core.message import ImageContent, Message, TextContent +from openhands.events.action import Action, AgentFinishAction +from openhands.llm.llm import LLM from .prompt import get_prompt_and_images diff --git a/agenthub/planner_agent/prompt.py b/agenthub/planner_agent/prompt.py index ad26b20cac..495cae80b4 100644 --- a/agenthub/planner_agent/prompt.py +++ b/agenthub/planner_agent/prompt.py @@ -1,13 +1,13 @@ -from opendevin.controller.state.state import State -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.schema import ActionType -from opendevin.core.utils import json -from opendevin.events.action import ( +from openhands.controller.state.state import State +from openhands.core.logger import openhands_logger as logger +from openhands.core.schema import ActionType +from openhands.core.utils import json +from openhands.events.action import ( Action, NullAction, ) -from opendevin.events.serialization.action import action_from_dict -from opendevin.events.serialization.event import event_to_memory +from openhands.events.serialization.action import action_from_dict +from openhands.events.serialization.event import event_to_memory HISTORY_SIZE = 20 diff --git a/agenthub/planner_agent/response_parser.py b/agenthub/planner_agent/response_parser.py index 5cc3613fec..12068cd5b7 100644 --- a/agenthub/planner_agent/response_parser.py +++ b/agenthub/planner_agent/response_parser.py @@ -1,9 +1,9 @@ -from opendevin.controller.action_parser import ResponseParser -from opendevin.core.utils import json -from opendevin.events.action import ( +from openhands.controller.action_parser import ResponseParser +from openhands.core.utils import json +from openhands.events.action import ( Action, ) -from opendevin.events.serialization.action import action_from_dict +from openhands.events.serialization.action import action_from_dict class PlannerResponseParser(ResponseParser): diff --git a/config.template.toml b/config.template.toml index 0c5de48c8d..ca9f66c522 100644 --- a/config.template.toml +++ b/config.template.toml @@ -1,4 +1,4 @@ -###################### OpenDevin Configuration Example ###################### +###################### OpenHands Configuration Example ###################### # # All settings have default values, so you only need to uncomment and # modify what you want to change @@ -55,8 +55,8 @@ workspace_base = "./workspace" # Path to rewrite the workspace mount path to #workspace_mount_rewrite = "" -# Run as devin -#run_as_devin = true +# Run as openhands +#run_as_openhands = true # Runtime environment #runtime = "eventstream" diff --git a/containers/README.md b/containers/README.md index 526bfee938..03a420f2ed 100644 --- a/containers/README.md +++ b/containers/README.md @@ -7,6 +7,6 @@ by the `ghcr.yml` workflow. ## Building Manually ```bash -docker build -f containers/app/Dockerfile -t opendevin . +docker build -f containers/app/Dockerfile -t openhands . docker build -f containers/sandbox/Dockerfile -t sandbox . ``` diff --git a/containers/app/Dockerfile b/containers/app/Dockerfile index 767cc6eab1..2ff2acd9c2 100644 --- a/containers/app/Dockerfile +++ b/containers/app/Dockerfile @@ -1,4 +1,4 @@ -ARG OPEN_DEVIN_BUILD_VERSION=dev +ARG OPENHANDS_BUILD_VERSION=dev FROM node:21.7.2-bookworm-slim AS frontend-builder WORKDIR /app @@ -32,15 +32,15 @@ FROM python:3.12.3-slim AS runtime WORKDIR /app -ARG OPEN_DEVIN_BUILD_VERSION #re-declare for this section +ARG OPENHANDS_BUILD_VERSION #re-declare for this section -ENV RUN_AS_DEVIN=true +ENV RUN_AS_OPENHANDS=true # A random number--we need this to be different from the user's UID on the host machine -ENV OPENDEVIN_USER_ID=42420 +ENV OPENHANDS_USER_ID=42420 ENV SANDBOX_API_HOSTNAME=host.docker.internal ENV USE_HOST_NETWORK=false ENV WORKSPACE_BASE=/opt/workspace_base -ENV OPEN_DEVIN_BUILD_VERSION=$OPEN_DEVIN_BUILD_VERSION +ENV OPENHANDS_BUILD_VERSION=$OPENHANDS_BUILD_VERSION RUN mkdir -p $WORKSPACE_BASE RUN apt-get update -y \ @@ -52,41 +52,41 @@ RUN sed -i 's/^UID_MIN.*/UID_MIN 499/' /etc/login.defs RUN sed -i 's/^UID_MAX.*/UID_MAX 1000000/' /etc/login.defs RUN groupadd app -RUN useradd -l -m -u $OPENDEVIN_USER_ID -s /bin/bash opendevin && \ - usermod -aG app opendevin && \ - usermod -aG sudo opendevin && \ +RUN useradd -l -m -u $OPENHANDS_USER_ID -s /bin/bash openhands && \ + usermod -aG app openhands && \ + usermod -aG sudo openhands && \ echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers -RUN chown -R opendevin:app /app && chmod -R 770 /app -RUN sudo chown -R opendevin:app $WORKSPACE_BASE && sudo chmod -R 770 $WORKSPACE_BASE -USER opendevin +RUN chown -R openhands:app /app && chmod -R 770 /app +RUN sudo chown -R openhands:app $WORKSPACE_BASE && sudo chmod -R 770 $WORKSPACE_BASE +USER openhands ENV VIRTUAL_ENV=/app/.venv \ PATH="/app/.venv/bin:$PATH" \ PYTHONPATH='/app' -COPY --chown=opendevin:app --chmod=770 --from=backend-builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} +COPY --chown=openhands:app --chmod=770 --from=backend-builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} RUN playwright install --with-deps chromium -COPY --chown=opendevin:app --chmod=770 ./opendevin ./opendevin -COPY --chown=opendevin:app --chmod=777 ./opendevin/runtime/plugins ./opendevin/runtime/plugins -COPY --chown=opendevin:app --chmod=770 ./agenthub ./agenthub -COPY --chown=opendevin:app --chmod=770 ./pyproject.toml ./pyproject.toml -COPY --chown=opendevin:app --chmod=770 ./poetry.lock ./poetry.lock -COPY --chown=opendevin:app --chmod=770 ./README.md ./README.md -COPY --chown=opendevin:app --chmod=770 ./MANIFEST.in ./MANIFEST.in +COPY --chown=openhands:app --chmod=770 ./openhands ./openhands +COPY --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 ./pyproject.toml ./pyproject.toml +COPY --chown=openhands:app --chmod=770 ./poetry.lock ./poetry.lock +COPY --chown=openhands:app --chmod=770 ./README.md ./README.md +COPY --chown=openhands:app --chmod=770 ./MANIFEST.in ./MANIFEST.in -# This is run as "opendevin" user, and will create __pycache__ with opendevin:opendevin ownership -RUN python opendevin/core/download.py # No-op to download assets +# This is run as "openhands" user, and will create __pycache__ with openhands:openhands ownership +RUN python openhands/core/download.py # No-op to download assets # Add this line to set group ownership of all files/directories not already in "app" group -# opendevin:opendevin -> opendevin:app +# openhands:openhands -> openhands:app RUN find /app \! -group app -exec chgrp app {} + -COPY --chown=opendevin:app --chmod=770 --from=frontend-builder /app/dist ./frontend/dist -COPY --chown=opendevin:app --chmod=770 ./containers/app/entrypoint.sh /app/entrypoint.sh +COPY --chown=openhands:app --chmod=770 --from=frontend-builder /app/dist ./frontend/dist +COPY --chown=openhands:app --chmod=770 ./containers/app/entrypoint.sh /app/entrypoint.sh USER root WORKDIR /app ENTRYPOINT ["/app/entrypoint.sh"] -CMD ["uvicorn", "opendevin.server.listen:app", "--host", "0.0.0.0", "--port", "3000"] +CMD ["uvicorn", "openhands.server.listen:app", "--host", "0.0.0.0", "--port", "3000"] diff --git a/containers/app/config.sh b/containers/app/config.sh index 187c90b209..6ed9ac329e 100644 --- a/containers/app/config.sh +++ b/containers/app/config.sh @@ -1,4 +1,4 @@ DOCKER_REGISTRY=ghcr.io -DOCKER_ORG=opendevin -DOCKER_IMAGE=opendevin +DOCKER_ORG=all-hands-ai +DOCKER_IMAGE=openhands DOCKER_BASE_DIR="." diff --git a/containers/app/entrypoint.sh b/containers/app/entrypoint.sh index 26db649f5b..bda45a5978 100644 --- a/containers/app/entrypoint.sh +++ b/containers/app/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/bash set -eo pipefail -echo "Starting OpenDevin..." +echo "Starting OpenHands..." if [[ $NO_SETUP == "true" ]]; then echo "Skipping setup, running as $(whoami)" "$@" @@ -9,7 +9,7 @@ if [[ $NO_SETUP == "true" ]]; then fi if [ "$(id -u)" -ne 0 ]; then - echo "The OpenDevin entrypoint.sh must run as root" + echo "The OpenHands entrypoint.sh must run as root" exit 1 fi @@ -19,11 +19,11 @@ if [ -z "$SANDBOX_USER_ID" ]; then fi if [[ "$SANDBOX_USER_ID" -eq 0 ]]; then - echo "Running OpenDevin as root" - export RUN_AS_DEVIN=false + echo "Running OpenHands as root" + export RUN_AS_OPENHANDS=false mkdir -p /root/.cache/ms-playwright/ - if [ -d "/home/opendevin/.cache/ms-playwright/" ]; then - mv /home/opendevin/.cache/ms-playwright/ /root/.cache/ + if [ -d "/home/openhands/.cache/ms-playwright/" ]; then + mv /home/openhands/.cache/ms-playwright/ /root/.cache/ fi "$@" else @@ -32,9 +32,9 @@ else echo "User enduser already exists. Skipping creation." else if ! useradd -l -m -u $SANDBOX_USER_ID -s /bin/bash enduser; then - echo "Failed to create user enduser with id $SANDBOX_USER_ID. Moving opendevin user." + echo "Failed to create user enduser with id $SANDBOX_USER_ID. Moving openhands user." incremented_id=$(($SANDBOX_USER_ID + 1)) - usermod -u $incremented_id opendevin + usermod -u $incremented_id openhands if ! useradd -l -m -u $SANDBOX_USER_ID -s /bin/bash enduser; then echo "Failed to create user enduser with id $SANDBOX_USER_ID for a second time. Exiting." exit 1 @@ -42,7 +42,7 @@ else fi fi usermod -aG app enduser - # get the user group of /var/run/docker.sock and set opendevin to that group + # get the user group of /var/run/docker.sock and set openhands to that group DOCKER_SOCKET_GID=$(stat -c '%g' /var/run/docker.sock) echo "Docker socket group id: $DOCKER_SOCKET_GID" if getent group $DOCKER_SOCKET_GID; then @@ -54,8 +54,8 @@ else mkdir -p /home/enduser/.cache/huggingface/hub/ mkdir -p /home/enduser/.cache/ms-playwright/ - if [ -d "/home/opendevin/.cache/ms-playwright/" ]; then - mv /home/opendevin/.cache/ms-playwright/ /home/enduser/.cache/ + if [ -d "/home/openhands/.cache/ms-playwright/" ]; then + mv /home/openhands/.cache/ms-playwright/ /home/enduser/.cache/ fi usermod -aG $DOCKER_SOCKET_GID enduser diff --git a/containers/build.sh b/containers/build.sh index 2d874d80f1..bc2fc76925 100755 --- a/containers/build.sh +++ b/containers/build.sh @@ -8,7 +8,7 @@ platform=$3 echo "Building: $image_name for platform: $platform" tags=() -OPEN_DEVIN_BUILD_VERSION="dev" +OPENHANDS_BUILD_VERSION="dev" if [[ -n $GITHUB_REF_NAME ]]; then # check if ref name is a version number @@ -19,13 +19,13 @@ if [[ -n $GITHUB_REF_NAME ]]; then tags+=("latest") fi sanitized=$(echo "$GITHUB_REF_NAME" | sed 's/[^a-zA-Z0-9.-]\+/-/g') - OPEN_DEVIN_BUILD_VERSION=$sanitized + OPENHANDS_BUILD_VERSION=$sanitized tag=$(echo "$sanitized" | tr '[:upper:]' '[:lower:]') # lower case is required in tagging tags+=("$tag") fi echo "Tags: ${tags[@]}" -if [[ "$image_name" == "opendevin" ]]; then +if [[ "$image_name" == "openhands" ]]; then dir="./containers/app" elif [[ "$image_name" == "od_runtime" ]]; then dir="./containers/runtime" @@ -73,7 +73,7 @@ echo "Output image will be saved to: $output_image" docker buildx build \ $args \ - --build-arg OPEN_DEVIN_BUILD_VERSION="$OPEN_DEVIN_BUILD_VERSION" \ + --build-arg OPENHANDS_BUILD_VERSION="$OPENHANDS_BUILD_VERSION" \ --platform linux/$platform \ --provenance=false \ -f "$dir/Dockerfile" \ diff --git a/containers/e2b-sandbox/README.md b/containers/e2b-sandbox/README.md index 4ebb7094ee..9f9ff72888 100644 --- a/containers/e2b-sandbox/README.md +++ b/containers/e2b-sandbox/README.md @@ -1,4 +1,4 @@ -# How to build custom E2B sandbox for OpenDevin +# How to build custom E2B sandbox for OpenHands [E2B](https://e2b.dev) is an [open-source](https://github.com/e2b-dev/e2b) secure cloud environment (sandbox) made for running AI-generated code and agents. E2B offers [Python](https://pypi.org/project/e2b/) and [JS/TS](https://www.npmjs.com/package/e2b) SDK to spawn and control these sandboxes. @@ -11,5 +11,5 @@ 1. Build the sandbox ```sh - e2b template build --dockerfile ./Dockerfile --name "open-devin" + e2b template build --dockerfile ./Dockerfile --name "openhands" ``` diff --git a/containers/e2b-sandbox/e2b.toml b/containers/e2b-sandbox/e2b.toml index 72bddf0c19..f19eb933a0 100644 --- a/containers/e2b-sandbox/e2b.toml +++ b/containers/e2b-sandbox/e2b.toml @@ -1,14 +1,14 @@ # This is a config for E2B sandbox template. -# You can use 'template_id' (785n69crgahmz0lkdw9h) or 'template_name (open-devin) from this config to spawn a sandbox: +# You can use 'template_id' (785n69crgahmz0lkdw9h) or 'template_name (openhands) from this config to spawn a sandbox: # Python SDK # from e2b import Sandbox -# sandbox = Sandbox(template='open-devin') +# sandbox = Sandbox(template='openhands') # JS SDK # import { Sandbox } from 'e2b' -# const sandbox = await Sandbox.create({ template: 'open-devin' }) +# const sandbox = await Sandbox.create({ template: 'openhands' }) dockerfile = "Dockerfile" -template_name = "open-devin" +template_name = "openhands" template_id = "785n69crgahmz0lkdw9h" diff --git a/containers/runtime/README.md b/containers/runtime/README.md index 043ea06fea..5ebf5546e8 100644 --- a/containers/runtime/README.md +++ b/containers/runtime/README.md @@ -1,11 +1,11 @@ # Dynamic constructed Dockerfile -This folder builds runtime image (sandbox), which will use a `Dockerfile` that is dynamically generated depends on the `base_image` AND a [Python source distribution](https://docs.python.org/3.10/distutils/sourcedist.html) that's based on the current commit of `opendevin`. +This folder builds runtime image (sandbox), which will use a `Dockerfile` that is dynamically generated depends on the `base_image` AND a [Python source distribution](https://docs.python.org/3.10/distutils/sourcedist.html) that's based on the current commit of `openhands`. The following command will generate Dockerfile for `ubuntu:22.04` and the source distribution `.tar` into `containers/runtime`. ```bash -poetry run python3 opendevin/runtime/utils/runtime_build.py \ +poetry run python3 openhands/runtime/utils/runtime_build.py \ --base_image ubuntu:22.04 \ --build_folder containers/runtime ``` diff --git a/containers/runtime/config.sh b/containers/runtime/config.sh index 1b55efe7b2..7f8b232c19 100644 --- a/containers/runtime/config.sh +++ b/containers/runtime/config.sh @@ -1,5 +1,5 @@ DOCKER_REGISTRY=ghcr.io -DOCKER_ORG=opendevin +DOCKER_ORG=all-hands-ai DOCKER_BASE_DIR="./containers/runtime" DOCKER_IMAGE=od_runtime # These variables will be appended by the runtime_build.py script diff --git a/containers/sandbox/Dockerfile b/containers/sandbox/Dockerfile index 9a2c8ce6a1..c13f90d6d1 100644 --- a/containers/sandbox/Dockerfile +++ b/containers/sandbox/Dockerfile @@ -28,17 +28,17 @@ RUN mkdir -p -m0755 /var/run/sshd # symlink python3 to python RUN ln -s /usr/bin/python3 /usr/bin/python -# ==== OpenDevin Runtime Client ==== -RUN mkdir -p /opendevin && mkdir -p /opendevin/logs && chmod 777 /opendevin/logs +# ==== OpenHands Runtime Client ==== +RUN mkdir -p /openhands && mkdir -p /openhands/logs && chmod 777 /openhands/logs RUN wget --progress=bar:force -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" -RUN bash Miniforge3.sh -b -p /opendevin/miniforge3 -RUN chmod -R g+w /opendevin/miniforge3 -RUN bash -c ". /opendevin/miniforge3/etc/profile.d/conda.sh && conda config --set changeps1 False && conda config --append channels conda-forge" -RUN echo "" > /opendevin/bash.bashrc +RUN bash Miniforge3.sh -b -p /openhands/miniforge3 +RUN chmod -R g+w /openhands/miniforge3 +RUN bash -c ". /openhands/miniforge3/etc/profile.d/conda.sh && conda config --set changeps1 False && conda config --append channels conda-forge" +RUN echo "" > /openhands/bash.bashrc RUN rm -f Miniforge3.sh # - agentskills dependencies -RUN /opendevin/miniforge3/bin/pip install --upgrade pip -RUN /opendevin/miniforge3/bin/pip install jupyterlab notebook jupyter_kernel_gateway flake8 -RUN /opendevin/miniforge3/bin/pip install python-docx PyPDF2 python-pptx pylatexenc openai -RUN /opendevin/miniforge3/bin/pip install python-dotenv toml termcolor pydantic python-docx pyyaml docker pexpect tenacity e2b browsergym minio +RUN /openhands/miniforge3/bin/pip install --upgrade pip +RUN /openhands/miniforge3/bin/pip install jupyterlab notebook jupyter_kernel_gateway flake8 +RUN /openhands/miniforge3/bin/pip install python-docx PyPDF2 python-pptx pylatexenc openai +RUN /openhands/miniforge3/bin/pip install python-dotenv toml termcolor pydantic python-docx pyyaml docker pexpect tenacity e2b browsergym minio diff --git a/containers/sandbox/config.sh b/containers/sandbox/config.sh index 3b96dac3b3..706a45d45f 100644 --- a/containers/sandbox/config.sh +++ b/containers/sandbox/config.sh @@ -1,4 +1,4 @@ DOCKER_REGISTRY=ghcr.io -DOCKER_ORG=opendevin +DOCKER_ORG=all-hands-ai DOCKER_IMAGE=sandbox DOCKER_BASE_DIR="." diff --git a/dev_config/python/.pre-commit-config.yaml b/dev_config/python/.pre-commit-config.yaml index ea31bbe6c4..eca8706b51 100644 --- a/dev_config/python/.pre-commit-config.yaml +++ b/dev_config/python/.pre-commit-config.yaml @@ -38,6 +38,6 @@ repos: - id: mypy additional_dependencies: [types-requests, types-setuptools, types-pyyaml, types-toml] - entry: mypy --config-file dev_config/python/mypy.ini opendevin/ agenthub/ + entry: mypy --config-file dev_config/python/mypy.ini openhands/ agenthub/ always_run: true pass_filenames: false diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index 1cd0a0d440..2f81477729 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -3,7 +3,7 @@ import type { Config } from "@docusaurus/types"; import { themes as prismThemes } from "prism-react-renderer"; const config: Config = { - title: "OpenDevin", + title: "OpenHands", tagline: "An Open Platform for AI Software Developers as Generalist Agents", favicon: "img/logo.png", @@ -12,8 +12,8 @@ const config: Config = { baseUrl: "/", // GitHub pages deployment config. - organizationName: "OpenDevin", - projectName: "OpenDevin", + organizationName: "All-Hands-AI", + projectName: "OpenHands", trailingSlash: false, onBrokenLinks: "throw", @@ -63,9 +63,9 @@ const config: Config = { themeConfig: { image: "img/docusaurus.png", navbar: { - title: "OpenDevin", + title: "OpenHands", logo: { - alt: "OpenDevin", + alt: "OpenHands", src: "img/logo.png", }, items: [ @@ -82,7 +82,7 @@ const config: Config = { label: "Codebase", }, { - href: "https://github.com/OpenDevin/OpenDevin", + href: "https://github.com/All-Hands-AI/OpenHands", label: "GitHub", position: "right", }, diff --git a/docs/i18n/fr/code.json b/docs/i18n/fr/code.json index b43792f7f8..685d93b09b 100644 --- a/docs/i18n/fr/code.json +++ b/docs/i18n/fr/code.json @@ -1,6 +1,6 @@ { "footer.title": { - "message": "OpenDevin" + "message": "OpenHands" }, "footer.docs": { "message": "Documents" @@ -9,7 +9,7 @@ "message": "Communauté" }, "footer.copyright": { - "message": "© {year} OpenDevin" + "message": "© {year} OpenHands" }, "faq.title": { "message": "Questions Fréquemment Posées", @@ -19,20 +19,20 @@ "message": "Questions Fréquemment Posées" }, "faq.section.title.1": { - "message": "Qu'est-ce qu'OpenDevin ?", + "message": "Qu'est-ce qu'OpenHands ?", "description": "First Section Title" }, "faq.section.highlight": { - "message": "OpenDevin", + "message": "OpenHands", "description": "Highlight Text" }, "faq.section.description.1": { - "message": "est un ingénieur logiciel autonome qui peut résoudre des tâches d'ingénierie logicielle et de navigation web à tout moment. Il peut exécuter des requêtes en sciences des données, telles que \"Trouver le nombre de demandes de pull à l'repository OpenDevin dans les derniers mois\", et des tâches d'ingénierie logicielle, comme \"Veuillez ajouter des tests à ce fichier et vérifier si tous les tests passent. Si ce n'est pas le cas, réparez le fichier.\"", - "description": "Description for OpenDevin" + "message": "est un ingénieur logiciel autonome qui peut résoudre des tâches d'ingénierie logicielle et de navigation web à tout moment. Il peut exécuter des requêtes en sciences des données, telles que \"Trouver le nombre de demandes de pull à l'repository OpenHands dans les derniers mois\", et des tâches d'ingénierie logicielle, comme \"Veuillez ajouter des tests à ce fichier et vérifier si tous les tests passent. Si ce n'est pas le cas, réparez le fichier.\"", + "description": "Description for OpenHands" }, "faq.section.description.2": { - "message": "De plus, OpenDevin est une plateforme et communauté pour les développeurs d'agents qui souhaitent tester et évaluer de nouveaux agents.", - "description": "Further Description for OpenDevin" + "message": "De plus, OpenHands est une plateforme et communauté pour les développeurs d'agents qui souhaitent tester et évaluer de nouveaux agents.", + "description": "Further Description for OpenHands" }, "faq.section.title.2": { "message": "Support", @@ -43,15 +43,15 @@ "description": "Support Answer" }, "faq.section.title.3": { - "message": "Comment résoudre un problème sur GitHub avec OpenDevin ?", + "message": "Comment résoudre un problème sur GitHub avec OpenHands ?", "description": "GitHub Issue Section Title" }, "faq.section.github.steps.intro": { - "message": "Pour résoudre un problème sur GitHub en utilisant OpenDevin, envoyez une commande à OpenDevin demandant qu'il suit des étapes comme les suivantes :", + "message": "Pour résoudre un problème sur GitHub en utilisant OpenHands, envoyez une commande à OpenHands demandant qu'il suit des étapes comme les suivantes :", "description": "GitHub Steps Introduction" }, "faq.section.github.step1": { - "message": "Lisez l'issue https://github.com/OpenDevin/OpenDevin/issues/1611", + "message": "Lisez l'issue https://github.com/All-Hands-AI/OpenHands/issues/1611", "description": "GitHub Step 1" }, "faq.section.github.step2": { @@ -71,11 +71,11 @@ "description": "GitHub Step 5" }, "faq.section.github.steps.preRun": { - "message": "Avant de lancer OpenDevin, vous pouvez faire :", + "message": "Avant de lancer OpenHands, vous pouvez faire :", "description": "GitHub Steps Pre-Run" }, "faq.section.github.steps.tokenInfo": { - "message": "où XXX est un jeton GitHub que vous avez créé et qui a les autorisations pour pousser dans le dépôt OpenDevin. Si vous n'avez pas d'autorisations de modification du dépôt OpenDevin, vous devrez peut-être changer cela en :", + "message": "où XXX est un jeton GitHub que vous avez créé et qui a les autorisations pour pousser dans le dépôt OpenHands. Si vous n'avez pas d'autorisations de modification du dépôt OpenHands, vous devrez peut-être changer cela en :", "description": "GitHub Steps Token Info" }, "faq.section.github.steps.usernameInfo": { @@ -83,23 +83,23 @@ "description": "GitHub Steps Username Info" }, "faq.section.title.4": { - "message": "Comment OpenDevin est-il différent de Devin ?", + "message": "Comment OpenHands est-il différent de Devin ?", "description": "Devin Section Title" }, - "faq.section.devin.linkText": { + "faq.section.openhands.linkText": { "message": "Devin", "description": "Devin Link Text" }, - "faq.section.devin.description": { - "message": "est un produit commercial par Cognition Inc., qui a servi d'inspiration initiale pour OpenDevin. Les deux visent à bien faire le travail d'ingénierie logicielle, mais vous pouvez télécharger, utiliser et modifier OpenDevin, tandis que Devin peut être utilisé uniquement via le site de Cognition. De plus, OpenDevin a évolué au-delà de l'inspiration initiale, et est maintenant un écosystème communautaire pour le développement d'agents en général, et nous serions ravis de vous voir rejoindre et", + "faq.section.openhands.description": { + "message": "est un produit commercial par Cognition Inc., qui a servi d'inspiration initiale pour OpenHands. Les deux visent à bien faire le travail d'ingénierie logicielle, mais vous pouvez télécharger, utiliser et modifier OpenHands, tandis que Devin peut être utilisé uniquement via le site de Cognition. De plus, OpenHands a évolué au-delà de l'inspiration initiale, et est maintenant un écosystème communautaire pour le développement d'agents en général, et nous serions ravis de vous voir rejoindre et", "description": "Devin Description" }, - "faq.section.devin.contribute": { + "faq.section.openhands.contribute": { "message": "contribuer", "description": "Contribute Link" }, "faq.section.title.5": { - "message": "Comment OpenDevin est-il différent de ChatGPT ?", + "message": "Comment OpenHands est-il différent de ChatGPT ?", "description": "ChatGPT Section Title" }, "faq.section.chatgpt.description": { @@ -114,7 +114,7 @@ "message": "Commencer" }, "welcome.message": { - "message": "Bienvenue à OpenDevin, un système d'IA autonome ingénieur logiciel capable d'exécuter des tâches d'ingénierie complexes et de collaborer activement avec les utilisateurs sur les projets de développement logiciel." + "message": "Bienvenue à OpenHands, un système d'IA autonome ingénieur logiciel capable d'exécuter des tâches d'ingénierie complexes et de collaborer activement avec les utilisateurs sur les projets de développement logiciel." }, "theme.ErrorPageContent.title": { "message": "Cette page a planté.", diff --git a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/about.md b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/about.md index aa6fa8d8e2..b03b01d6ab 100644 --- a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/about.md +++ b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/about.md @@ -19,35 +19,35 @@ La réalisation d'une réplication complète des applications de production avec ## 🤝 Comment Contribuer {#how-to-contribute} -OpenDevin est un projet communautaire, et nous accueillons les contributions de tout le monde. Que vous soyez développeur, chercheur, ou simplement enthousiaste à l'idée de faire progresser le domaine de l'ingénierie logicielle avec l'IA, il existe de nombreuses façons de vous impliquer : +OpenHands est un projet communautaire, et nous accueillons les contributions de tout le monde. Que vous soyez développeur, chercheur, ou simplement enthousiaste à l'idée de faire progresser le domaine de l'ingénierie logicielle avec l'IA, il existe de nombreuses façons de vous impliquer : - **Contributions de Code :** Aidez-nous à développer les fonctionnalités de base, l'interface frontend ou les solutions de sandboxing. - **Recherche et Évaluation :** Contribuez à notre compréhension des LLM en ingénierie logicielle, participez à l'évaluation des modèles ou suggérez des améliorations. -- **Retour d'Information et Tests :** Utilisez l'ensemble d'outils OpenDevin, signalez des bogues, suggérez des fonctionnalités ou fournissez des retours sur l'ergonomie. +- **Retour d'Information et Tests :** Utilisez l'ensemble d'outils OpenHands, signalez des bogues, suggérez des fonctionnalités ou fournissez des retours sur l'ergonomie. -Pour plus de détails, veuillez consulter [ce document](https://github.com/OpenDevin/OpenDevin/blob/main/CONTRIBUTING.md). +Pour plus de détails, veuillez consulter [ce document](https://github.com/All-Hands-AI/OpenHands/blob/main/CONTRIBUTING.md). ## 🤖 Rejoignez Notre Communauté {#join-our-community} -Nous avons maintenant à la fois un espace de travail Slack pour la collaboration sur la construction d'OpenDevin et un serveur Discord pour discuter de tout ce qui est lié, par exemple, à ce projet, aux LLM, aux agents, etc. +Nous avons maintenant à la fois un espace de travail Slack pour la collaboration sur la construction d'OpenHands et un serveur Discord pour discuter de tout ce qui est lié, par exemple, à ce projet, aux LLM, aux agents, etc. -- [Espace de travail Slack](https://join.slack.com/t/opendevin/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw) +- [Espace de travail Slack](https://join.slack.com/t/openhands/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw) - [Serveur Discord](https://discord.gg/ESHStjSjD4) Si vous souhaitez contribuer, n'hésitez pas à rejoindre notre communauté. Simplifions l'ingénierie logicielle ensemble ! -🐚 **Codez moins, créez plus avec OpenDevin.** +🐚 **Codez moins, créez plus avec OpenHands.** -[![Star History Chart](https://api.star-history.com/svg?repos=OpenDevin/OpenDevin&type=Date)](https://star-history.com/#OpenDevin/OpenDevin&Date) +[![Star History Chart](https://api.star-history.com/svg?repos=All-Hands-AI/OpenHands&type=Date)](https://star-history.com/#All-Hands-AI/OpenHands&Date) ## 🛠️ Construit Avec {#built-with} -OpenDevin est construit en utilisant une combinaison de cadres et de bibliothèques puissants, offrant une base robuste pour son développement. Voici les technologies clés utilisées dans le projet : +OpenHands est construit en utilisant une combinaison de cadres et de bibliothèques puissants, offrant une base robuste pour son développement. Voici les technologies clés utilisées dans le projet : ![FastAPI](https://img.shields.io/badge/FastAPI-black?style=for-the-badge) ![uvicorn](https://img.shields.io/badge/uvicorn-black?style=for-the-badge) ![LiteLLM](https://img.shields.io/badge/LiteLLM-black?style=for-the-badge) ![Docker](https://img.shields.io/badge/Docker-black?style=for-the-badge) ![Ruff](https://img.shields.io/badge/Ruff-black?style=for-the-badge) ![MyPy](https://img.shields.io/badge/MyPy-black?style=for-the-badge) ![LlamaIndex](https://img.shields.io/badge/LlamaIndex-black?style=for-the-badge) ![React](https://img.shields.io/badge/React-black?style=for-the-badge) -Veuillez noter que la sélection de ces technologies est en cours, et que des technologies supplémentaires peuvent être ajoutées ou des existantes supprimées au fur et à mesure de l'évolution du projet. Nous nous efforçons d'adopter les outils les plus adaptés et efficaces pour améliorer les capacités d'OpenDevin. +Veuillez noter que la sélection de ces technologies est en cours, et que des technologies supplémentaires peuvent être ajoutées ou des existantes supprimées au fur et à mesure de l'évolution du projet. Nous nous efforçons d'adopter les outils les plus adaptés et efficaces pour améliorer les capacités d'OpenHands. ## 📜 Licence {#license} -Distribué sous la licence MIT. Voir [notre licence](https://github.com/OpenDevin/OpenDevin/blob/main/LICENSE) pour plus d'informations. +Distribué sous la licence MIT. Voir [notre licence](https://github.com/All-Hands-AI/OpenHands/blob/main/LICENSE) pour plus d'informations. diff --git a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/agents.md b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/agents.md index f823f5b627..2b723f88b7 100644 --- a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/agents.md +++ b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/agents.md @@ -18,18 +18,18 @@ L'idée conceptuelle est illustrée ci-dessous. À chaque tour, l'agent peut : - Exécuter toute commande `bash` Linux valide - Exécuter tout code `Python` valide avec [un interpréteur Python interactif](https://ipython.org/). Cela est simulé à travers la commande `bash`, voir le système de plugin ci-dessous pour plus de détails. -![image](https://github.com/OpenDevin/OpenDevin/assets/38853559/92b622e3-72ad-4a61-8f41-8c040b6d5fb3) +![image](https://github.com/All-Hands-AI/OpenHands/assets/38853559/92b622e3-72ad-4a61-8f41-8c040b6d5fb3) ### Système de Plugin -Pour rendre l'agent CodeAct plus puissant avec seulement l'accès à l'espace d'action `bash`, l'agent CodeAct exploite le système de plugins d'OpenDevin: +Pour rendre l'agent CodeAct plus puissant avec seulement l'accès à l'espace d'action `bash`, l'agent CodeAct exploite le système de plugins d'OpenHands: -- [Plugin Jupyter](https://github.com/OpenDevin/OpenDevin/tree/main/opendevin/runtime/plugins/jupyter) : pour l'exécution d'IPython via la commande bash -- [Plugin outil agent SWE](https://github.com/OpenDevin/OpenDevin/tree/main/opendevin/runtime/plugins/swe_agent_commands) : Outils de ligne de commande bash puissants pour les tâches de développement logiciel introduits par [swe-agent](https://github.com/princeton-nlp/swe-agent). +- [Plugin Jupyter](https://github.com/All-Hands-AI/OpenHands/tree/main/openhands/runtime/plugins/jupyter) : pour l'exécution d'IPython via la commande bash +- [Plugin outil agent SWE](https://github.com/All-Hands-AI/OpenHands/tree/main/openhands/runtime/plugins/swe_agent_commands) : Outils de ligne de commande bash puissants pour les tâches de développement logiciel introduits par [swe-agent](https://github.com/princeton-nlp/swe-agent). ### Démonstration -https://github.com/OpenDevin/OpenDevin/assets/38853559/f592a192-e86c-4f48-ad31-d69282d5f6ac +https://github.com/All-Hands-AI/OpenHands/assets/38853559/f592a192-e86c-4f48-ad31-d69282d5f6ac _Exemple de CodeActAgent avec `gpt-4-turbo-2024-04-09` effectuant une tâche de science des données (régression linéaire)_ diff --git a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/architecture.mdx b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/architecture.mdx index 8b986ed8cd..fa6436aa22 100644 --- a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/architecture.mdx +++ b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/architecture.mdx @@ -25,14 +25,14 @@ _**Avertissement**: L'architecture du backend est en cours de développement et ## Prérequis - - Un environnement Python dans lequel opendevin est exécutable + - Un environnement Python dans lequel openhands est exécutable (selon les instructions du fichier README.md à la racine du dépôt) - [py2puml](https://github.com/lucsorel/py2puml) installé ## Étapes 1. Générez automatiquement le schéma en exécutant la commande suivante depuis la racine du dépôt : - `py2puml opendevin opendevin > docs/architecture/backend_architecture.puml` + `py2puml openhands openhands > docs/architecture/backend_architecture.puml` 2. Ouvrez le fichier généré dans un éditeur PlantUML, par exemple Visual Studio Code avec l'extension PlantUML ou [PlantText](https://www.planttext.com/) diff --git a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/custom_sandbox_guide.md b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/custom_sandbox_guide.md index d7812087ff..4643c1ef30 100644 --- a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/custom_sandbox_guide.md +++ b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/custom_sandbox_guide.md @@ -1,14 +1,14 @@ # 💿 Comment Créer un Soutien Docker sur Mesure -Le sandbox par défaut OpenDevin est équipé d'une configuration ubuntu minimaliste. Votre cas d'utilisation pourrait nécessiter des logiciels installés par défaut. Cet article vous enseignera comment réaliser cela en utilisant une image docker personnalisée. +Le sandbox par défaut OpenHands est équipé d'une configuration ubuntu minimaliste. Votre cas d'utilisation pourrait nécessiter des logiciels installés par défaut. Cet article vous enseignera comment réaliser cela en utilisant une image docker personnalisée. ## Configuration -Assurez-vous de pouvoir utiliser OpenDevin en suivant la documentation [Development.md](https://github.com/OpenDevin/OpenDevin/blob/main/Development.md). +Assurez-vous de pouvoir utiliser OpenHands en suivant la documentation [Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md). ## Créer Votre Image Docker -Ensuite, vous devez créer votre image docker personnalisée qui doit être basée sur debian/ubuntu. Par exemple, si nous souhaitons que OpenDevin ait accès au "node" binaire, nous utiliserions ce Dockerfile: +Ensuite, vous devez créer votre image docker personnalisée qui doit être basée sur debian/ubuntu. Par exemple, si nous souhaitons que OpenHands ait accès au "node" binaire, nous utiliserions ce Dockerfile: ```bash # Commencez avec l'image ubuntu la plus récente @@ -29,19 +29,19 @@ docker build -t image_personnalisée . Cela produira une nouvelle image appelée ```image_personnalisée``` qui sera disponible dans Docker Engine. -> Remarque: Dans la configuration décrite ici, OpenDevin va fonctionner en tant que utilisateur "opendevin" à l'intérieur du sandbox et donc tous les packages installés via le Dockerfile seront disponibles pour tous les utilisateurs sur le système, pas seulement root. +> Remarque: Dans la configuration décrite ici, OpenHands va fonctionner en tant que utilisateur "openhands" à l'intérieur du sandbox et donc tous les packages installés via le Dockerfile seront disponibles pour tous les utilisateurs sur le système, pas seulement root. > > L'installation avec apt-get ci-dessus installe nodejs pour tous les utilisateurs. ## Spécifiez votre image personnalisée dans le fichier config.toml -La configuration OpenDevin se fait via le fichier de niveau supérieur ```config.toml``` . -Créez un fichier ```config.toml``` dans le répertoire OpenDevin et entrez ces contenus: +La configuration OpenHands se fait via le fichier de niveau supérieur ```config.toml``` . +Créez un fichier ```config.toml``` dans le répertoire OpenHands et entrez ces contenus: ```toml [core] workspace_base="./workspace" -run_as_devin=true +run_as_openhands=true sandbox_container_image="image_personnalisée" ``` @@ -49,7 +49,7 @@ sandbox_container_image="image_personnalisée" ## Exécution -Exécutez OpenDevin en exécutant ```make run``` dans le répertoire racine. +Exécutez OpenHands en exécutant ```make run``` dans le répertoire racine. Naviguez vers ```localhost:3001``` et vérifiez si vos dépendances souhaitées sont disponibles. @@ -59,39 +59,39 @@ Félicitations ! ## Explication technique -Le code pertinent est défini dans [ssh_box.py](https://github.com/OpenDevin/OpenDevin/blob/main/opendevin/runtime/docker/ssh_box.py) et [image_agnostic_util.py](https://github.com/OpenDevin/OpenDevin/blob/main/opendevin/runtime/docker/image_agnostic_util.py). +Le code pertinent est défini dans [ssh_box.py](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/docker/ssh_box.py) et [image_agnostic_util.py](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/docker/image_agnostic_util.py). -En particulier, ssh_box.py vérifie l'objet config pour ```config.sandbox_container_image``` et ensuite tente de récupérer l'image à l'aide de [get_od_sandbox_image](https://github.com/OpenDevin/OpenDevin/blob/main/opendevin/runtime/docker/image_agnostic_util.py#L72), qui est défini dans image_agnostic_util.py. +En particulier, ssh_box.py vérifie l'objet config pour ```config.sandbox_container_image``` et ensuite tente de récupérer l'image à l'aide de [get_od_sandbox_image](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/docker/image_agnostic_util.py#L72), qui est défini dans image_agnostic_util.py. Lorsqu'une image personnalisée est utilisée pour la première fois, elle ne sera pas trouvée et donc elle sera construite (à l'exécution ultérieure, l'image construite sera trouvée et renvoyée). -L'image personnalisée est construite avec [_build_sandbox_image()](https://github.com/OpenDevin/OpenDevin/blob/main/opendevin/runtime/docker/image_agnostic_util.py#L29), qui crée un fichier docker en utilisant votre image personnalisée comme base et configure ensuite l'environnement pour OpenDevin, comme ceci: +L'image personnalisée est construite avec [_build_sandbox_image()](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/docker/image_agnostic_util.py#L29), qui crée un fichier docker en utilisant votre image personnalisée comme base et configure ensuite l'environnement pour OpenHands, comme ceci: ```python dockerfile_content = ( f'FROM {base_image}\n' 'RUN apt update && apt install -y openssh-server wget sudo\n' 'RUN mkdir -p -m0755 /var/run/sshd\n' - 'RUN mkdir -p /opendevin && mkdir -p /opendevin/logs && chmod 777 /opendevin/logs\n' + 'RUN mkdir -p /openhands && mkdir -p /openhands/logs && chmod 777 /openhands/logs\n' 'RUN wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"\n' - 'RUN bash Miniforge3-$(uname)-$(uname -m).sh -b -p /opendevin/miniforge3\n' - 'RUN bash -c ". /opendevin/miniforge3/etc/profile.d/conda.sh && conda config --set changeps1 False && conda config --append channels conda-forge"\n' - 'RUN echo "export PATH=/opendevin/miniforge3/bin:$PATH" >> ~/.bashrc\n' - 'RUN echo "export PATH=/opendevin/miniforge3/bin:$PATH" >> /opendevin/bash.bashrc\n' + 'RUN bash Miniforge3-$(uname)-$(uname -m).sh -b -p /openhands/miniforge3\n' + 'RUN bash -c ". /openhands/miniforge3/etc/profile.d/conda.sh && conda config --set changeps1 False && conda config --append channels conda-forge"\n' + 'RUN echo "export PATH=/openhands/miniforge3/bin:$PATH" >> ~/.bashrc\n' + 'RUN echo "export PATH=/openhands/miniforge3/bin:$PATH" >> /openhands/bash.bashrc\n' ).strip() ``` -> Remarque: Le nom de l'image est modifié via [_get_new_image_name()](https://github.com/OpenDevin/OpenDevin/blob/main/opendevin/runtime/docker/image_agnostic_util.py#L63) et c'est ce nom modifié qui sera recherché lors des exécutions ultérieures. +> Remarque: Le nom de l'image est modifié via [_get_new_image_name()](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/docker/image_agnostic_util.py#L63) et c'est ce nom modifié qui sera recherché lors des exécutions ultérieures. ## Dépannage / Erreurs ### Erreur: ```useradd: UID 1000 est non unique``` -Si vous voyez cette erreur dans la sortie de la console, il s'agit du fait que OpenDevin essaie de créer le utilisateur opendevin dans le sandbox avec un ID d'utilisateur de 1000, cependant cet ID d'utilisateur est déjà utilisé dans l'image (pour une raison inconnue). Pour résoudre ce problème, changez la valeur du champ sandbox_user_id dans le fichier config.toml en une valeur différente: +Si vous voyez cette erreur dans la sortie de la console, il s'agit du fait que OpenHands essaie de créer le utilisateur openhands dans le sandbox avec un ID d'utilisateur de 1000, cependant cet ID d'utilisateur est déjà utilisé dans l'image (pour une raison inconnue). Pour résoudre ce problème, changez la valeur du champ sandbox_user_id dans le fichier config.toml en une valeur différente: ```toml [core] workspace_base="./workspace" -run_as_devin=true +run_as_openhands=true sandbox_container_image="image_personnalisée" sandbox_user_id="1001" ``` @@ -102,4 +102,4 @@ Si vous voyez un message d'erreur indiquant que le port est utilisé ou indispon ## Discuter -Pour d'autres problèmes ou questions rejoignez le [Slack](https://join.slack.com/t/opendevin/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw) ou le [Discord](https://discord.gg/ESHStjSjD4) et demandez! +Pour d'autres problèmes ou questions rejoignez le [Slack](https://join.slack.com/t/openhands/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw) ou le [Discord](https://discord.gg/ESHStjSjD4) et demandez! diff --git a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/feedback.md b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/feedback.md index 78d683f9cf..6abb04abd3 100644 --- a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/feedback.md +++ b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/feedback.md @@ -4,15 +4,15 @@ sidebar_position: 6 # ✅ Fournir des Commentaires -Lorsque vous utilisez OpenDevin, vous rencontrerez sans aucun doute des cas où les choses fonctionnent bien et d'autres où elles ne fonctionnent pas. Nous vous encourageons à fournir des commentaires lorsque vous utilisez OpenDevin pour aider l'équipe de développement et, peut-être plus important encore, créer un corpus ouvert d'exemples de formation pour les agents de codage -- Partagez-OpenDevin ! +Lorsque vous utilisez OpenHands, vous rencontrerez sans aucun doute des cas où les choses fonctionnent bien et d'autres où elles ne fonctionnent pas. Nous vous encourageons à fournir des commentaires lorsque vous utilisez OpenHands pour aider l'équipe de développement et, peut-être plus important encore, créer un corpus ouvert d'exemples de formation pour les agents de codage -- Partagez-OpenHands ! ## 📝 Comment Fournir des Commentaires -Fournir des commentaires est simple ! Lorsque vous utilisez OpenDevin, vous pouvez appuyer sur le bouton de pouce vers le haut ou vers le bas à n'importe quel moment de votre interaction. Vous serez invité à fournir votre adresse email (par exemple, afin que nous puissions vous contacter si nous voulons poser des questions de suivi), et vous pouvez choisir si vous souhaitez fournir des commentaires publiquement ou en privé. +Fournir des commentaires est simple ! Lorsque vous utilisez OpenHands, vous pouvez appuyer sur le bouton de pouce vers le haut ou vers le bas à n'importe quel moment de votre interaction. Vous serez invité à fournir votre adresse email (par exemple, afin que nous puissions vous contacter si nous voulons poser des questions de suivi), et vous pouvez choisir si vous souhaitez fournir des commentaires publiquement ou en privé. ## 📜 Licence de Données et Confidentialité -* Les données **publiques** seront distribuées sous la licence MIT, comme OpenDevin lui-même, et pourront être utilisées par la communauté pour former et tester des modèles. Évidemment, les commentaires que vous pouvez rendre publics seront plus précieux pour la communauté dans son ensemble, donc lorsque vous ne traitez pas d'informations sensibles, nous vous encourageons à choisir cette option ! -* Les données **privées** ne seront partagées qu'avec l'équipe OpenDevin dans le but d'améliorer OpenDevin. +* Les données **publiques** seront distribuées sous la licence MIT, comme OpenHands lui-même, et pourront être utilisées par la communauté pour former et tester des modèles. Évidemment, les commentaires que vous pouvez rendre publics seront plus précieux pour la communauté dans son ensemble, donc lorsque vous ne traitez pas d'informations sensibles, nous vous encourageons à choisir cette option ! +* Les données **privées** ne seront partagées qu'avec l'équipe OpenHands dans le but d'améliorer OpenHands. diff --git a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/intro.mdx b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/intro.mdx index ed66081c48..55aeeaea54 100644 --- a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/intro.mdx +++ b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/intro.mdx @@ -2,47 +2,47 @@ sidebar_position: 1 --- -# 💻 OpenDevin +# 💻 OpenHands -OpenDevin est un **ingénieur logiciel IA autonome** capable d'exécuter des tâches d'ingénierie complexes et de collaborer activement avec les utilisateurs sur des projets de développement logiciel. +OpenHands est un **ingénieur logiciel IA autonome** capable d'exécuter des tâches d'ingénierie complexes et de collaborer activement avec les utilisateurs sur des projets de développement logiciel. Ce projet est entièrement open-source, vous pouvez donc l'utiliser et le modifier comme bon vous semble. :::tip -Explorez le code source d'OpenDevin sur [GitHub](https://github.com/OpenDevin/OpenDevin) ou rejoignez l'une de nos communautés ! +Explorez le code source d'OpenHands sur [GitHub](https://github.com/All-Hands-AI/OpenHands) ou rejoignez l'une de nos communautés ! - + Contributors - + Forks - + Stargazers - + Issues

- + MIT License

- + Join our Slack community docs/architecture/backend_architecture.puml` + `py2puml openhands openhands > docs/architecture/backend_architecture.puml` 2. 在 PlantUML 编辑器中打开生成的文件,例如使用 PlantUML 扩展的 Visual Studio Code 或 [PlantText](https://www.planttext.com/) diff --git a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage/custom_sandbox_guide.md b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage/custom_sandbox_guide.md index 8bae2b75dc..1c99ca32dc 100644 --- a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage/custom_sandbox_guide.md +++ b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage/custom_sandbox_guide.md @@ -1,14 +1,14 @@ # 💿 如何创建自定义 Docker 沙箱 -默认的 OpenDevin 沙箱包含一个[最小化 ubuntu 配置](https://github.com/OpenDevin/OpenDevin/blob/main/containers/sandbox/Dockerfile)。您的应用场景可能需要在默认状态下安装额外的软件。本指南将教您如何通过使用自定义 Docker 映像来实现这一目标。 +默认的 OpenHands 沙箱包含一个[最小化 ubuntu 配置](https://github.com/All-Hands-AI/OpenHands/blob/main/containers/sandbox/Dockerfile)。您的应用场景可能需要在默认状态下安装额外的软件。本指南将教您如何通过使用自定义 Docker 映像来实现这一目标。 ## 环境设置 -确保您能够首先通过 [Development.md](https://github.com/OpenDevin/OpenDevin/blob/main/Development.md) 运行 OpenDevin。 +确保您能够首先通过 [Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md) 运行 OpenHands。 ## 创建您的 Docker 映像 -接下来,您必须创建一个自定义的 Docker 映像,该映像是基于 Debian 或 Ubuntu 的。例如,如果我们希望 OpenDevin 能够访问 "node" 可执行文件,我们可以使用以下 `Dockerfile`: +接下来,您必须创建一个自定义的 Docker 映像,该映像是基于 Debian 或 Ubuntu 的。例如,如果我们希望 OpenHands 能够访问 "node" 可执行文件,我们可以使用以下 `Dockerfile`: ```bash # 从最新版 ubuntu 开始 @@ -29,18 +29,18 @@ docker build -t custom_image . 这将生成一个名为 ```custom_image``` 的新映像,并使其可用于 Docker 服务引擎。 -> 注意:在本文档描述的配置中,OpenDevin 将在沙箱内部以“opendevin”用户身份运行。因此,通过 Dockerfile 安装的所有包应可供系统上的所有用户使用,而不仅仅是 root 用户。 +> 注意:在本文档描述的配置中,OpenHands 将在沙箱内部以“openhands”用户身份运行。因此,通过 Dockerfile 安装的所有包应可供系统上的所有用户使用,而不仅仅是 root 用户。 > 使用 `apt-get` 上面安装的 node 是为所有用户安装的。 ## 在 config.toml 文件中指定自定义映像 -在 OpenDevin 的配置通过顶层的 `config.toml` 文件发生。在 OpenDevin 目录下创建一个 ```config.toml``` 文件,并输入以下内容: +在 OpenHands 的配置通过顶层的 `config.toml` 文件发生。在 OpenHands 目录下创建一个 ```config.toml``` 文件,并输入以下内容: ``` [core] workspace_base="./workspace" -run_as_devin=true +run_as_openhands=true sandbox_container_image="custom_image" ``` @@ -48,7 +48,7 @@ sandbox_container_image="custom_image" ## 运行 -通过运行 ```make run``` 在顶层目录下运行 OpenDevin。 +通过运行 ```make run``` 在顶层目录下运行 OpenHands。 导航至 ```localhost:3001``` 并检查所需依赖是否可用。 @@ -58,40 +58,40 @@ sandbox_container_image="custom_image" ## 技术解释 -相关代码定义在 [ssh_box.py](https://github.com/OpenDevin/OpenDevin/blob/main/opendevin/runtime/docker/ssh_box.py) 和 [image_agnostic_util.py](https://github.com/OpenDevin/OpenDevin/blob/main/opendevin/runtime/docker/image_agnostic_util.py) 中。 +相关代码定义在 [ssh_box.py](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/docker/ssh_box.py) 和 [image_agnostic_util.py](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/docker/image_agnostic_util.py) 中。 -特别是 ssh_box.py 检查配置对象中的 ```config.sandbox_container_image```,然后尝试使用 [get_od_sandbox_image](https://github.com/OpenDevin/OpenDevin/blob/main/opendevin/runtime/docker/image_agnostic_util.py#L72),在 image_agnostic_util.py 定义中进行检索。 +特别是 ssh_box.py 检查配置对象中的 ```config.sandbox_container_image```,然后尝试使用 [get_od_sandbox_image](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/docker/image_agnostic_util.py#L72),在 image_agnostic_util.py 定义中进行检索。 初次使用自定义映像时,该映像将不会被找到,因此将被构建(在后续运行中已构建的映像将被查找并返回)。 -自定义映像是通过 `_build_sandbox_image()` 构建的,在 [image_agnostic_util.py](https://github.com/OpenDevin/OpenDevin/blob/main/opendevin/runtime/docker/image_agnostic_util.py#L29) 中,使用您的 custom_image 作为基础,并为 OpenDevin 配置环境。例如: +自定义映像是通过 `_build_sandbox_image()` 构建的,在 [image_agnostic_util.py](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/docker/image_agnostic_util.py#L29) 中,使用您的 custom_image 作为基础,并为 OpenHands 配置环境。例如: ```python dockerfile_content = ( f'FROM {base_image}\n' 'RUN apt update && apt install -y openssh-server wget sudo\n' 'RUN mkdir -p -m0755 /var/run/sshd\n' - 'RUN mkdir -p /opendevin && mkdir -p /opendevin/logs && chmod 777 /opendevin/logs\n' + 'RUN mkdir -p /openhands && mkdir -p /openhands/logs && chmod 777 /openhands/logs\n' 'RUN wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"\n' - 'RUN bash Miniforge3-$(uname)-$(uname -m).sh -b -p /opendevin/miniforge3\n' - 'RUN bash -c ". /opendevin/miniforge3/etc/profile.d/conda.sh && conda config --set changeps1 False && conda config --append channels conda-forge"\n' - 'RUN echo "export PATH=/opendevin/miniforge3/bin:$PATH" >> ~/.bashrc\n' - 'RUN echo "export PATH=/opendevin/miniforge3/bin:$PATH" >> /opendevin/bash.bashrc\n' + 'RUN bash Miniforge3-$(uname)-$(uname -m).sh -b -p /openhands/miniforge3\n' + 'RUN bash -c ". /openhands/miniforge3/etc/profile.d/conda.sh && conda config --set changeps1 False && conda config --append channels conda-forge"\n' + 'RUN echo "export PATH=/openhands/miniforge3/bin:$PATH" >> ~/.bashrc\n' + 'RUN echo "export PATH=/openhands/miniforge3/bin:$PATH" >> /openhands/bash.bashrc\n' ).strip() ``` -> 注意:映像名称通过 [_get_new_image_name()](https://github.com/OpenDevin/OpenDevin/blob/main/opendevin/runtime/docker/image_agnostic_util.py#L63) 修改,并且是后续运行中搜索的修改后的名称。 +> 注意:映像名称通过 [_get_new_image_name()](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/docker/image_agnostic_util.py#L63) 修改,并且是后续运行中搜索的修改后的名称。 ## 故障排除 / 错误 ### 错误:```useradd: UID 1000 is not unique``` -如果在控制台输出中看到此错误,说明 OpenDevin 尝试在沙箱中以 UID 1000 创建 opendevin 用户,但该 UID 已经被映像中的其他部分使用(不知何故)。要解决这个问题,请更改 config.toml 文件中的 sandbox_user_id 字段为不同的值: +如果在控制台输出中看到此错误,说明 OpenHands 尝试在沙箱中以 UID 1000 创建 openhands 用户,但该 UID 已经被映像中的其他部分使用(不知何故)。要解决这个问题,请更改 config.toml 文件中的 sandbox_user_id 字段为不同的值: ``` [core] workspace_base="./workspace" -run_as_devin=true +run_as_openhands=true sandbox_container_image="custom_image" sandbox_user_id="1001" ``` @@ -102,4 +102,4 @@ sandbox_user_id="1001" ## 讨论 -对于其他问题或疑问,请加入 [Slack](https://join.slack.com/t/opendevin/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw) 或 [Discord](https://discord.gg/ESHStjSjD4),并提问! +对于其他问题或疑问,请加入 [Slack](https://join.slack.com/t/openhands/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw) 或 [Discord](https://discord.gg/ESHStjSjD4),并提问! diff --git a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage/feedback.md b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage/feedback.md index 5dde206396..4da7c75909 100644 --- a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage/feedback.md +++ b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage/feedback.md @@ -4,15 +4,15 @@ sidebar_position: 6 # ✅ 提供反馈 -在使用 OpenDevin 时,你无疑会遇到一些情况,某些地方工作得很好,而另一些地方则可能不尽如人意。我们鼓励你在使用 OpenDevin 时提供反馈,这不仅有助于开发团队改善应用,更为重要的是,可以创建一个开放的编码代理训练样例语料库——Share-OpenDevin! +在使用 OpenHands 时,你无疑会遇到一些情况,某些地方工作得很好,而另一些地方则可能不尽如人意。我们鼓励你在使用 OpenHands 时提供反馈,这不仅有助于开发团队改善应用,更为重要的是,可以创建一个开放的编码代理训练样例语料库——Share-OpenHands! ## 📝 如何提供反馈 -提供反馈很简单!在使用 OpenDevin 时,你可以在任意时刻按下点赞或点踩按钮。你将被要求提供你的电子邮件地址(例如,以便我们在需要进一步询问时联系你),你可以选择公开或私密地提供反馈。 +提供反馈很简单!在使用 OpenHands 时,你可以在任意时刻按下点赞或点踩按钮。你将被要求提供你的电子邮件地址(例如,以便我们在需要进一步询问时联系你),你可以选择公开或私密地提供反馈。 ## 📜 数据许可与隐私 -* **公开** 数据将与 OpenDevin 本身一样以 MIT 许可协议发布,并可被社区用来训练和测试模型。显然,你能够公开的反馈对整个社区来说更有价值,因此当你不涉及敏感信息时,我们鼓励你选择这个选项! -* **私密** 数据将仅与 OpenDevin 团队分享,用于改进 OpenDevin。 +* **公开** 数据将与 OpenHands 本身一样以 MIT 许可协议发布,并可被社区用来训练和测试模型。显然,你能够公开的反馈对整个社区来说更有价值,因此当你不涉及敏感信息时,我们鼓励你选择这个选项! +* **私密** 数据将仅与 OpenHands 团队分享,用于改进 OpenHands。 diff --git a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage/intro.mdx b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage/intro.mdx index e8a172e5d5..06054481fa 100644 --- a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage/intro.mdx +++ b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage/intro.mdx @@ -2,47 +2,47 @@ sidebar_position: 1 --- -# 💻 OpenDevin +# 💻 OpenHands -OpenDevin 是一个**自主 AI 软件工程师**,能够执行复杂的工程任务,并在软件开发项目中积极与用户合作。 +OpenHands 是一个**自主 AI 软件工程师**,能够执行复杂的工程任务,并在软件开发项目中积极与用户合作。 这个项目是完全开源的,所以你可以随意使用和修改它。 :::tip -在 [GitHub](https://github.com/OpenDevin/OpenDevin) 上探索 OpenDevin 的代码库或加入我们的社区! +在 [GitHub](https://github.com/All-Hands-AI/OpenHands) 上探索 OpenHands 的代码库或加入我们的社区! - + Contributors - + Forks - + Stargazers - + Issues

- + MIT License

- + Join our Slack community - OpenDevin System Architecture Diagram Jul 4 2024 -

OpenDevin System Architecture Diagram (July 4, 2024)

+ OpenHands System Architecture Diagram Jul 4 2024 +

OpenHands System Architecture Diagram (July 4, 2024)

This is a high-level overview of the system architecture. The system is divided into two main components: the frontend and the backend. The frontend is responsible for handling user interactions and displaying the results. The backend is responsible for handling the business logic and executing the agents. @@ -33,14 +33,14 @@ _**Disclaimer**: The backend architecture is a work in progress and is subject t ## Prerequisites - - Running python environment in which opendevin is executable + - Running python environment in which openhands is executable (according to the instructions in the README.md file in the root of the repository) - [py2puml](https://github.com/lucsorel/py2puml) installed ## Steps 1. Autogenerate the diagram by running the following command from the root of the repository: - `py2puml opendevin opendevin > docs/architecture/backend_architecture.puml` + `py2puml openhands openhands > docs/architecture/backend_architecture.puml` 2. Open the generated file in a PlantUML editor, e.g. Visual Studio Code with the PlantUML extension or [PlantText](https://www.planttext.com/) diff --git a/docs/modules/usage/architecture/runtime.md b/docs/modules/usage/architecture/runtime.md index 2b865ba293..fe292d90d9 100644 --- a/docs/modules/usage/architecture/runtime.md +++ b/docs/modules/usage/architecture/runtime.md @@ -1,12 +1,12 @@ # 📦 EventStream Runtime -The OpenDevin EventStream Runtime is the core component that enables secure and flexible execution of AI agent's action. +The OpenHands EventStream Runtime is the core component that enables secure and flexible execution of AI agent's action. It creates a sandboxed environment using Docker, where arbitrary code can be run safely without risking the host system. ## Why do we need a sandboxed runtime? -OpenDevin needs to execute arbitrary code in a secure, isolated environment for several reasons: +OpenHands needs to execute arbitrary code in a secure, isolated environment for several reasons: 1. Security: Executing untrusted code can pose significant risks to the host system. A sandboxed environment prevents malicious code from accessing or modifying the host system's resources. @@ -20,11 +20,11 @@ OpenDevin needs to execute arbitrary code in a secure, isolated environment for ## How does our Runtime work? -The OpenDevin Runtime system uses a client-server architecture implemented with Docker containers. Here's an overview of how it works: +The OpenHands Runtime system uses a client-server architecture implemented with Docker containers. Here's an overview of how it works: ```mermaid graph TD - A[User-provided Custom Docker Image] --> B[OpenDevin Backend] + A[User-provided Custom Docker Image] --> B[OpenHands Backend] B -->|Builds| C[OD Runtime Image] C -->|Launches| D[Runtime Client] D -->|Initializes| E[Browser] @@ -53,35 +53,35 @@ graph TD 1. User Input: The user provides a custom base Docker image. -2. Image Building: OpenDevin builds a new Docker image (the "OD runtime image") based on the user-provided image. This new image includes OpenDevin-specific code, primarily the "runtime client." +2. Image Building: OpenHands builds a new Docker image (the "OD runtime image") based on the user-provided image. This new image includes OpenHands-specific code, primarily the "runtime client." -3. Container Launch: When OpenDevin starts, it launches a Docker container using the OD runtime image. +3. Container Launch: When OpenHands starts, it launches a Docker container using the OD runtime image. 4. Client Initialization: The runtime client initializes inside the container, setting up necessary components like a bash shell and loading any specified plugins. -5. Communication: The OpenDevin backend (`runtime.py`) communicates with the runtime client over RESTful API, sending actions and receiving observations. +5. Communication: The OpenHands backend (`runtime.py`) communicates with the runtime client over RESTful API, sending actions and receiving observations. 6. Action Execution: The runtime client receives actions from the backend, executes them in the sandboxed environment, and sends back observations. -7. Observation Return: The client sends execution results back to the OpenDevin backend as observations. +7. Observation Return: The client sends execution results back to the OpenHands backend as observations. The role of the client is crucial: -- It acts as an intermediary between the OpenDevin backend and the sandboxed environment. +- It acts as an intermediary between the OpenHands backend and the sandboxed environment. - It executes various types of actions (shell commands, file operations, Python code, etc.) safely within the container. - It manages the state of the sandboxed environment, including the current working directory and loaded plugins. - It formats and returns observations to the backend, ensuring a consistent interface for processing results. -## Advanced: How OpenDevin builds and maintains OD Runtime images +## Advanced: How OpenHands builds and maintains OD Runtime images -OpenDevin uses a sophisticated approach to build and manage runtime images. This process ensures efficiency, consistency, and flexibility in creating and maintaining Docker images for both production and development environments. +OpenHands uses a sophisticated approach to build and manage runtime images. This process ensures efficiency, consistency, and flexibility in creating and maintaining Docker images for both production and development environments. -Check out [relavant code](https://github.com/OpenDevin/OpenDevin/blob/main/opendevin/runtime/utils/runtime_build.py) if you are interested in more details. +Check out [relavant code](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/utils/runtime_build.py) if you are interested in more details. ### Image Tagging System -OpenDevin uses a dual-tagging system for its runtime images to balance reproducibility with flexibility: +OpenHands uses a dual-tagging system for its runtime images to balance reproducibility with flexibility: 1. Hash-based tag: `{target_image_repo}:{target_image_hash_tag}` Example: `od_runtime:abc123def456` @@ -94,10 +94,10 @@ OpenDevin uses a dual-tagging system for its runtime images to balance reproduci Example: `od_runtime:od_v0.8.3_ubuntu_tag_22.04` - This tag follows the format: `od_runtime:od_v{OD_VERSION}_{BASE_IMAGE_NAME}_tag_{BASE_IMAGE_TAG}` - - It represents the latest build for a particular base image and OpenDevin version combination. + - It represents the latest build for a particular base image and OpenHands version combination. - This tag is updated whenever a new image is built from the same base image, even if the source code changes. -The hash-based tag ensures exact reproducibility, while the generic tag provides a stable reference to the latest version of a particular configuration. This dual-tagging approach allows OpenDevin to efficiently manage both development and production environments. +The hash-based tag ensures exact reproducibility, while the generic tag provides a stable reference to the latest version of a particular configuration. This dual-tagging approach allows OpenHands to efficiently manage both development and production environments. ### Build Process @@ -110,7 +110,7 @@ The hash-based tag ensures exact reproducibility, while the generic tag provides 2. Build Process: - a. Convert the base image name to an OD runtime image name. Example: `ubuntu:22.04` -> `od_runtime:od_v0.8.3_ubuntu_tag_22.04` - - b. Generate a build context (Dockerfile and OpenDevin source code) and calculate its hash. + - b. Generate a build context (Dockerfile and OpenHands source code) and calculate its hash. - c. Check for an existing image with the calculated hash. - d. If not found, check for a recent compatible image to use as a base. - e. If no compatible image exists, build from scratch using the original base image. @@ -151,16 +151,16 @@ This approach ensures that: 1. Identical source code and Dockerfile always produce the same image (via hash-based tags). 2. The system can quickly rebuild images when minor changes occur (by leveraging recent compatible images). -3. The generic tag (e.g., `od_runtime:od_v0.8.3_ubuntu_tag_22.04`) always points to the latest build for a particular base image and OpenDevin version combination. +3. The generic tag (e.g., `od_runtime:od_v0.8.3_ubuntu_tag_22.04`) always points to the latest build for a particular base image and OpenHands version combination. -By using this method, OpenDevin maintains an efficient and flexible system for building and managing runtime images, adapting to both development needs and production requirements. +By using this method, OpenHands maintains an efficient and flexible system for building and managing runtime images, adapting to both development needs and production requirements. ## Advanced: Runtime Plugin System -The OpenDevin Runtime supports a plugin system that allows for extending functionality and customizing the runtime environment. Plugins are initialized when the runtime client starts up. +The OpenHands Runtime supports a plugin system that allows for extending functionality and customizing the runtime environment. Plugins are initialized when the runtime client starts up. -Check [an example of Jupyter plugin here](https://github.com/OpenDevin/OpenDevin/blob/9c44d94cef32e6426ebd8deeeb52963153b2348a/opendevin/runtime/plugins/jupyter/__init__.py#L30-L63) if you want to implement your own plugin. +Check [an example of Jupyter plugin here](https://github.com/All-Hands-AI/OpenHands/blob/9c44d94cef32e6426ebd8deeeb52963153b2348a/openhands/runtime/plugins/jupyter/__init__.py#L30-L63) if you want to implement your own plugin. *More details about the Plugin system are still under construction - contributions are welcomed!* diff --git a/docs/modules/usage/feedback.md b/docs/modules/usage/feedback.md index b5b0152f7c..4e041acdfc 100644 --- a/docs/modules/usage/feedback.md +++ b/docs/modules/usage/feedback.md @@ -4,11 +4,11 @@ sidebar_position: 5 # ✅ Providing Feedback -When using OpenDevin, you will undoubtably encounter cases where things work well, and others where they don't. We encourage you to provide feedback when you use OpenDevin to help give feedback to the development team, and perhaps more importantly, create an open corpus of coding agent training examples -- Share-OpenDevin! +When using OpenHands, you will undoubtably encounter cases where things work well, and others where they don't. We encourage you to provide feedback when you use OpenHands to help give feedback to the development team, and perhaps more importantly, create an open corpus of coding agent training examples -- Share-OpenHands! ## 📝 How to Provide Feedback -Providing feedback is easy! When you are using OpenDevin, you can press the thumbs-up or thumbs-down button at any point during your interaction with. You will be prompted to provide your email address (e.g. so we can contact you if we want to ask any follow-up questions), and you can choose whether you want to provide feedback publicly or privately. +Providing feedback is easy! When you are using OpenHands, you can press the thumbs-up or thumbs-down button at any point during your interaction with. You will be prompted to provide your email address (e.g. so we can contact you if we want to ask any follow-up questions), and you can choose whether you want to provide feedback publicly or privately. @@ -18,12 +18,12 @@ Providing feedback is easy! When you are using OpenDevin, you can press the thum When you submit data, you can submit it either publicly or privately. -* **Public** data will be distributed under the MIT License, like OpenDevin itself, and can be used by the community to train and test models. Obviously, feedback that you can make public will be more valuable for the community as a whole, so when you are not dealing with sensitive information, we would encourage you to choose this option! -* **Private** data will only be shared with the OpenDevin team for the purpose of improving OpenDevin. +* **Public** data will be distributed under the MIT License, like OpenHands itself, and can be used by the community to train and test models. Obviously, feedback that you can make public will be more valuable for the community as a whole, so when you are not dealing with sensitive information, we would encourage you to choose this option! +* **Private** data will only be shared with the OpenHands team for the purpose of improving OpenHands. ### Who collects and stores the data? -The data is collected and stored by [All Hands AI](https://all-hands.dev), a company founded by OpenDevin maintainers to support and improve OpenDevin. +The data is collected and stored by [All Hands AI](https://all-hands.dev), a company founded by OpenHands maintainers to support and improve OpenHands. ### How will public data be released? diff --git a/docs/modules/usage/how-to/custom-sandbox-guide.md b/docs/modules/usage/how-to/custom-sandbox-guide.md index 0a34037f7c..460de151f9 100644 --- a/docs/modules/usage/how-to/custom-sandbox-guide.md +++ b/docs/modules/usage/how-to/custom-sandbox-guide.md @@ -1,6 +1,6 @@ # Create and Use a Custom Docker Sandbox -The default OpenDevin sandbox comes with a [minimal ubuntu configuration](https://github.com/OpenDevin/OpenDevin/blob/main/containers/sandbox/Dockerfile). +The default OpenHands sandbox comes with a [minimal ubuntu configuration](https://github.com/All-Hands-AI/OpenHands/blob/main/containers/sandbox/Dockerfile). Your use case may need additional software installed by default. @@ -24,13 +24,13 @@ For a more feature-rich environment, you might consider using pre-built images l ## Setup -Make sure you are able to run OpenDevin using the [Development.md](https://github.com/OpenDevin/OpenDevin/blob/main/Development.md) first. +Make sure you are able to run OpenHands using the [Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md) first. ## Create Your Docker Image To create a custom docker image, it must be debian/ubuntu based. -For example, if we want OpenDevin to have access to the `node` binary, we would use the following Dockerfile: +For example, if we want OpenHands to have access to the `node` binary, we would use the following Dockerfile: ```dockerfile # Start with latest ubuntu image @@ -53,20 +53,20 @@ docker build -t custom_image . This will produce a new image called ```custom_image``` that will be available in Docker Engine. -> Note that in the configuration described in this document, OpenDevin will run as user "opendevin" inside the sandbox and thus all packages installed via the docker file should be available to all users on the system, not just root. +> Note that in the configuration described in this document, OpenHands will run as user "openhands" inside the sandbox and thus all packages installed via the docker file should be available to all users on the system, not just root. > > Installing with apt-get above installs node for all users. ## Specify your sandbox image in config.toml file -OpenDevin configuration occurs via the top-level `config.toml` file. +OpenHands configuration occurs via the top-level `config.toml` file. -Create a `config.toml` file in the OpenDevin directory and enter these contents: +Create a `config.toml` file in the OpenHands directory and enter these contents: ```toml [core] workspace_base="./workspace" -run_as_devin=true +run_as_openhands=true sandbox_container_image="custom_image" ``` @@ -76,7 +76,7 @@ For `sandbox_container_image`, you can specify either: 2. A pre-existing image from Docker Hub (e.g., `”node:20”` if you want a sandbox with Node.js pre-installed) ## Run -Run OpenDevin by running ```make run``` in the top level directory. +Run OpenHands by running ```make run``` in the top level directory. Navigate to ```localhost:3001``` and check if your desired dependencies are available. @@ -86,18 +86,18 @@ Congratulations! ## Technical Explanation -Please refer to [custom docker image section of the runtime documentation](https://docs.all-hands.dev/modules/usage/runtime#advanced-how-opendevin-builds-and-maintains-od-runtime-images) for more details. +Please refer to [custom docker image section of the runtime documentation](https://docs.all-hands.dev/modules/usage/runtime#advanced-how-openhands-builds-and-maintains-od-runtime-images) for more details. ## Troubleshooting / Errors ### Error: ```useradd: UID 1000 is not unique``` -If you see this error in the console output it is because OpenDevin is trying to create the opendevin user in the sandbox with a UID of 1000, however this UID is already being used in the image (for some reason). To fix this change the sandbox_user_id field in the config.toml file to a different value: +If you see this error in the console output it is because OpenHands is trying to create the openhands user in the sandbox with a UID of 1000, however this UID is already being used in the image (for some reason). To fix this change the sandbox_user_id field in the config.toml file to a different value: ```toml [core] workspace_base="./workspace" -run_as_devin=true +run_as_openhands=true sandbox_container_image="custom_image" sandbox_user_id="1001" ``` @@ -108,4 +108,4 @@ If you see an error about a port being in use or unavailable, try deleting all r ## Discuss -For other issues or questions join the [Slack](https://join.slack.com/t/opendevin/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw) or [Discord](https://discord.gg/ESHStjSjD4) and ask! +For other issues or questions join the [Slack](https://join.slack.com/t/openhands/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw) or [Discord](https://discord.gg/ESHStjSjD4) and ask! diff --git a/docs/modules/usage/how-to/evaluation-harness.md b/docs/modules/usage/how-to/evaluation-harness.md index 90f5a3a774..0be253c74b 100644 --- a/docs/modules/usage/how-to/evaluation-harness.md +++ b/docs/modules/usage/how-to/evaluation-harness.md @@ -1,12 +1,12 @@ -# Contribute to OpenDevin Evaluation Harness +# Contribute to OpenHands Evaluation Harness -This guide provides an overview of how to integrate your own evaluation benchmark into the OpenDevin framework. +This guide provides an overview of how to integrate your own evaluation benchmark into the OpenHands framework. ## Before everything begins: Setup Environment and LLM Configuration -Please follow instruction [here](https://github.com/OpenDevin/OpenDevin/blob/main/Development.md) to setup your local development environment and LLM. +Please follow instruction [here](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md) to setup your local development environment and LLM. -OpenDevin in development mode uses `config.toml` to keep track of most configurations. +OpenHands in development mode uses `config.toml` to keep track of most configurations. Here's an example configuration file you can use to define and use multiple LLMs: @@ -29,12 +29,12 @@ temperature = 0.0 ``` -## How to use OpenDevin in the command line +## How to use OpenHands in the command line -OpenDevin can be run from the command line using the following format: +OpenHands can be run from the command line using the following format: ```bash -poetry run python ./opendevin/core/main.py \ +poetry run python ./openhands/core/main.py \ -i \ -t "" \ -c \ @@ -44,22 +44,22 @@ poetry run python ./opendevin/core/main.py \ For example: ```bash -poetry run python ./opendevin/core/main.py \ +poetry run python ./openhands/core/main.py \ -i 10 \ -t "Write me a bash script that prints hello world." \ -c CodeActAgent \ -l llm ``` -This command runs OpenDevin with: +This command runs OpenHands with: - A maximum of 10 iterations - The specified task description - Using the CodeActAgent - With the LLM configuration defined in the `llm` section of your `config.toml` file -## How does OpenDevin work +## How does OpenHands work -The main entry point for OpenDevin is in `opendevin/core/main.py`. Here's a simplified flow of how it works: +The main entry point for OpenHands is in `openhands/core/main.py`. Here's a simplified flow of how it works: 1. Parse command-line arguments and load the configuration. 2. Create a runtime environment using `create_runtime()`. @@ -69,12 +69,12 @@ The main entry point for OpenDevin is in `opendevin/core/main.py`. Here's a simp - Executes the agent's task - Returns a final state when complete -The `run_controller()` function is the core of OpenDevin's execution. It manages the interaction between the agent, the runtime, and the task, handling things like user input simulation and event processing. +The `run_controller()` function is the core of OpenHands's execution. It manages the interaction between the agent, the runtime, and the task, handling things like user input simulation and event processing. ## Easiest way to get started: Exploring Existing Benchmarks -We encourage you to review the various evaluation benchmarks available in the [`evaluation/` directory](https://github.com/OpenDevin/OpenDevin/blob/main/evaluation) of our repository. +We encourage you to review the various evaluation benchmarks available in the [`evaluation/` directory](https://github.com/All-Hands-AI/OpenHands/blob/main/evaluation) of our repository. To integrate your own benchmark, we suggest starting with the one that most closely resembles your needs. This approach can significantly streamline your integration process, allowing you to build upon existing structures and adapt them to your specific requirements. @@ -83,7 +83,7 @@ To integrate your own benchmark, we suggest starting with the one that most clos To create an evaluation workflow for your benchmark, follow these steps: -1. Import relevant OpenDevin utilities: +1. Import relevant OpenHands utilities: ```python import agenthub from evaluation.utils.shared import ( @@ -94,18 +94,18 @@ To create an evaluation workflow for your benchmark, follow these steps: reset_logger_for_multiprocessing, run_evaluation, ) - from opendevin.controller.state.state import State - from opendevin.core.config import ( + from openhands.controller.state.state import State + from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, parse_arguments, ) - from opendevin.core.logger import opendevin_logger as logger - from opendevin.core.main import create_runtime, run_controller - from opendevin.events.action import CmdRunAction - from opendevin.events.observation import CmdOutputObservation, ErrorObservation - from opendevin.runtime.runtime import Runtime + from openhands.core.logger import openhands_logger as logger + from openhands.core.main import create_runtime, run_controller + from openhands.events.action import CmdRunAction + from openhands.events.observation import CmdOutputObservation, ErrorObservation + from openhands.runtime.runtime import Runtime ``` 2. Create a configuration: @@ -182,12 +182,12 @@ This workflow sets up the configuration, initializes the runtime environment, pr Remember to customize the `get_instruction`, `your_user_response_function`, and `evaluate_agent_actions` functions according to your specific benchmark requirements. -By following this structure, you can create a robust evaluation workflow for your benchmark within the OpenDevin framework. +By following this structure, you can create a robust evaluation workflow for your benchmark within the OpenHands framework. ## Understanding the `user_response_fn` -The `user_response_fn` is a crucial component in OpenDevin's evaluation workflow. It simulates user interaction with the agent, allowing for automated responses during the evaluation process. This function is particularly useful when you want to provide consistent, predefined responses to the agent's queries or actions. +The `user_response_fn` is a crucial component in OpenHands's evaluation workflow. It simulates user interaction with the agent, allowing for automated responses during the evaluation process. This function is particularly useful when you want to provide consistent, predefined responses to the agent's queries or actions. ### Workflow and Interaction diff --git a/docs/modules/usage/how-to/openshift-example.md b/docs/modules/usage/how-to/openshift-example.md index 8952f979bd..3ab3abd24e 100644 --- a/docs/modules/usage/how-to/openshift-example.md +++ b/docs/modules/usage/how-to/openshift-example.md @@ -1,9 +1,9 @@ -# Use OpenDevin in OpenShift/K8S +# Use OpenHands in OpenShift/K8S There are different ways and scenarios that you can do, we're just mentioning one example here: 1. Create a PV "as a cluster admin" to map workspace_base data and docker directory to the pod through the worker node. 2. Create a PVC to be able to mount those PVs to the POD -3. Create a POD which contains two containers; the OpenDevin and Sandbox containers. +3. Create a POD which contains two containers; the OpenHands and Sandbox containers. ## Steps to follow the above example. @@ -144,12 +144,12 @@ Sample POD yaml file below: apiVersion: v1 kind: Pod metadata: - name: opendevin-app-2024 + name: openhands-app-2024 labels: - app: opendevin-app-2024 + app: openhands-app-2024 spec: containers: - - name: opendevin-app-2024 + - name: openhands-app-2024 image: ghcr.io/opendevin/opendevin:0.7.1 env: - name: SANDBOX_USER_ID @@ -163,8 +163,8 @@ spec: mountPath: /var/run/docker.sock ports: - containerPort: 3000 - - name: opendevin-sandbox-2024 - image: ghcr.io/opendevin/sandbox:main + - name: openhands-sandbox-2024 + image: ghcr.io/openhands/sandbox:main ports: - containerPort: 51963 command: ["/usr/sbin/sshd", "-D", "-p 51963", "-o", "PermitRootLogin=yes"] @@ -180,43 +180,43 @@ spec: ```bash # create the pod $ oc create -f pod.yaml -W0716 11:22:07.776271 107626 warnings.go:70] would violate PodSecurity "restricted:v1.24": allowPrivilegeEscalation != false (containers "opendevin-app-2024", "opendevin-sandbox-2024" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (containers "opendevin-app-2024", "opendevin-sandbox-2024" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or containers "opendevin-app-2024", "opendevin-sandbox-2024" must set securityContext.runAsNonRoot=true), seccompProfile (pod or containers "opendevin-app-2024", "opendevin-sandbox-2024" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost") -pod/opendevin-app-2024 created +W0716 11:22:07.776271 107626 warnings.go:70] would violate PodSecurity "restricted:v1.24": allowPrivilegeEscalation != false (containers "openhands-app-2024", "openhands-sandbox-2024" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (containers "openhands-app-2024", "openhands-sandbox-2024" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or containers "openhands-app-2024", "openhands-sandbox-2024" must set securityContext.runAsNonRoot=true), seccompProfile (pod or containers "openhands-app-2024", "openhands-sandbox-2024" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost") +pod/openhands-app-2024 created # Above warning can be ignored for now as we will not modify SCC restrictions. # review $ oc get pods NAME READY STATUS RESTARTS AGE -opendevin-app-2024 0/2 Pending 0 5s +openhands-app-2024 0/2 Pending 0 5s $ oc get pods NAME READY STATUS RESTARTS AGE -opendevin-app-2024 0/2 ContainerCreating 0 15s +openhands-app-2024 0/2 ContainerCreating 0 15s $ oc get events LAST SEEN TYPE REASON OBJECT MESSAGE 38s Normal WaitForFirstConsumer persistentvolumeclaim/docker-pvc waiting for first consumer to be created before binding 23s Normal ExternalProvisioning persistentvolumeclaim/docker-pvc waiting for a volume to be created, either by external provisioner "csi.hetzner.cloud" or manually created by system administrator -27s Normal Provisioning persistentvolumeclaim/docker-pvc External provisioner is provisioning volume for claim "opendevin/docker-pvc" +27s Normal Provisioning persistentvolumeclaim/docker-pvc External provisioner is provisioning volume for claim "openhands/docker-pvc" 17s Normal ProvisioningSucceeded persistentvolumeclaim/docker-pvc Successfully provisioned volume pvc-2b1d223a-1c8f-4990-8e3d-68061a9ae252 -16s Normal Scheduled pod/opendevin-app-2024 Successfully assigned opendevin/opendevin-app-2024 to worker1.hub.internal.blakane.com -9s Normal SuccessfulAttachVolume pod/opendevin-app-2024 AttachVolume.Attach succeeded for volume "pvc-2b1d223a-1c8f-4990-8e3d-68061a9ae252" -9s Normal SuccessfulAttachVolume pod/opendevin-app-2024 AttachVolume.Attach succeeded for volume "pvc-31f15b25-faad-4665-a25f-201a530379af" -6s Normal AddedInterface pod/opendevin-app-2024 Add eth0 [10.128.2.48/23] from openshift-sdn -6s Normal Pulled pod/opendevin-app-2024 Container image "ghcr.io/opendevin/opendevin:0.7.1" already present on machine -6s Normal Created pod/opendevin-app-2024 Created container opendevin-app-2024 -6s Normal Started pod/opendevin-app-2024 Started container opendevin-app-2024 -6s Normal Pulled pod/opendevin-app-2024 Container image "ghcr.io/opendevin/sandbox:main" already present on machine -5s Normal Created pod/opendevin-app-2024 Created container opendevin-sandbox-2024 -5s Normal Started pod/opendevin-app-2024 Started container opendevin-sandbox-2024 +16s Normal Scheduled pod/openhands-app-2024 Successfully assigned All-Hands-AI/OpenHands-app-2024 to worker1.hub.internal.blakane.com +9s Normal SuccessfulAttachVolume pod/openhands-app-2024 AttachVolume.Attach succeeded for volume "pvc-2b1d223a-1c8f-4990-8e3d-68061a9ae252" +9s Normal SuccessfulAttachVolume pod/openhands-app-2024 AttachVolume.Attach succeeded for volume "pvc-31f15b25-faad-4665-a25f-201a530379af" +6s Normal AddedInterface pod/openhands-app-2024 Add eth0 [10.128.2.48/23] from openshift-sdn +6s Normal Pulled pod/openhands-app-2024 Container image "ghcr.io/opendevin/opendevin:0.7.1" already present on machine +6s Normal Created pod/openhands-app-2024 Created container openhands-app-2024 +6s Normal Started pod/openhands-app-2024 Started container openhands-app-2024 +6s Normal Pulled pod/openhands-app-2024 Container image "ghcr.io/openhands/sandbox:main" already present on machine +5s Normal Created pod/openhands-app-2024 Created container openhands-sandbox-2024 +5s Normal Started pod/openhands-app-2024 Started container openhands-sandbox-2024 83s Normal WaitForFirstConsumer persistentvolumeclaim/workspace-pvc waiting for first consumer to be created before binding -27s Normal Provisioning persistentvolumeclaim/workspace-pvc External provisioner is provisioning volume for claim "opendevin/workspace-pvc" +27s Normal Provisioning persistentvolumeclaim/workspace-pvc External provisioner is provisioning volume for claim "openhands/workspace-pvc" 17s Normal ProvisioningSucceeded persistentvolumeclaim/workspace-pvc Successfully provisioned volume pvc-31f15b25-faad-4665-a25f-201a530379af $ oc get pods NAME READY STATUS RESTARTS AGE -opendevin-app-2024 2/2 Running 0 23s +openhands-app-2024 2/2 Running 0 23s $ oc get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE @@ -230,21 +230,21 @@ Sample service creation command below: ```bash # create the service of type NodePort -$ oc create svc nodeport opendevin-app-2024 --tcp=3000:3000 -service/opendevin-app-2024 created +$ oc create svc nodeport openhands-app-2024 --tcp=3000:3000 +service/openhands-app-2024 created # review $ oc get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE -opendevin-app-2024 NodePort 172.30.225.42 3000:30495/TCP 4s +openhands-app-2024 NodePort 172.30.225.42 3000:30495/TCP 4s -$ oc describe svc opendevin-app-2024 -Name: opendevin-app-2024 -Namespace: opendevin -Labels: app=opendevin-app-2024 +$ oc describe svc openhands-app-2024 +Name: openhands-app-2024 +Namespace: openhands +Labels: app=openhands-app-2024 Annotations: -Selector: app=opendevin-app-2024 +Selector: app=openhands-app-2024 Type: NodePort IP Family Policy: SingleStack IP Families: IPv4 @@ -259,7 +259,7 @@ External Traffic Policy: Cluster Events: ``` -6. Connect to OpenDevin UI, configure the Agent, then test: +6. Connect to OpenHands UI, configure the Agent, then test: ![image](https://github.com/user-attachments/assets/12f94804-a0c7-4744-b873-e003c9caf40e) @@ -293,4 +293,4 @@ RUN git --version ## Discuss -For other issues or questions join the [Slack](https://join.slack.com/t/opendevin/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw) or [Discord](https://discord.gg/ESHStjSjD4) and ask! +For other issues or questions join the [Slack](https://join.slack.com/t/openhands/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw) or [Discord](https://discord.gg/ESHStjSjD4) and ask! diff --git a/docs/modules/usage/intro.mdx b/docs/modules/usage/intro.mdx index b571f80cfd..92255b920e 100644 --- a/docs/modules/usage/intro.mdx +++ b/docs/modules/usage/intro.mdx @@ -2,47 +2,47 @@ sidebar_position: 1 --- -# 💻 OpenDevin +# 💻 OpenHands -OpenDevin is an **autonomous AI software engineer** capable of executing complex engineering tasks and collaborating actively with users on software development projects. +OpenHands is an **autonomous AI software engineer** capable of executing complex engineering tasks and collaborating actively with users on software development projects. This project is fully open-source, so you can use and modify it however you like. :::tip -Explore the codebase of OpenDevin on [GitHub](https://github.com/OpenDevin/OpenDevin) or join one of our communities! +Explore the codebase of OpenHands on [GitHub](https://github.com/All-Hands-AI/OpenHands) or join one of our communities! -
+ Contributors - + Forks - + Stargazers - + Issues

- + MIT License

- + Join our Slack community
- OpenDevin + OpenHands

- {'Copyright © {year} OpenDevin'} + {'Copyright © {year} OpenHands'}

diff --git a/docs/src/components/HomepageHeader/HomepageHeader.tsx b/docs/src/components/HomepageHeader/HomepageHeader.tsx index 10445eab8f..7eeb132f0d 100644 --- a/docs/src/components/HomepageHeader/HomepageHeader.tsx +++ b/docs/src/components/HomepageHeader/HomepageHeader.tsx @@ -18,10 +18,10 @@ export function HomepageHeader() {

{siteConfig.tagline}

diff --git a/docs/static/img/backend_architecture.puml b/docs/static/img/backend_architecture.puml index 8b51e49b15..d85242c749 100644 --- a/docs/static/img/backend_architecture.puml +++ b/docs/static/img/backend_architecture.puml @@ -1,88 +1,88 @@ -@startuml opendevin +@startuml openhands !pragma useIntermediatePackages false -class opendevin.action.agent.AgentEchoAction { +class openhands.action.agent.AgentEchoAction { content: str runnable: bool action: str } -class opendevin.action.agent.AgentFinishAction { +class openhands.action.agent.AgentFinishAction { runnable: bool action: str } -class opendevin.observation.AgentMessageObservation { +class openhands.observation.AgentMessageObservation { role: str observation: str } -class opendevin.action.agent.AgentSummarizeAction { +class openhands.action.agent.AgentSummarizeAction { summary: str action: str } -class opendevin.action.agent.AgentThinkAction { +class openhands.action.agent.AgentThinkAction { thought: str runnable: bool action: str } -class opendevin.action.base.ExecutableAction { +class openhands.action.base.ExecutableAction { } -class opendevin.action.base.NotExecutableAction { +class openhands.action.base.NotExecutableAction { } -class opendevin.observation.Observation { +class openhands.observation.Observation { content: str } -class opendevin.action.base.Action { +class openhands.action.base.Action { } -class opendevin.action.base.NullAction { +class openhands.action.base.NullAction { action: str } -class opendevin.action.bash.CmdRunAction { +class openhands.action.bash.CmdRunAction { command: str action: str } -class opendevin.action.browse.BrowseURLAction { +class openhands.action.browse.BrowseURLAction { url: str action: str } -class opendevin.observation.BrowserOutputObservation { +class openhands.observation.BrowserOutputObservation { url: str status_code: int error: bool observation: str } -class opendevin.action.fileop.FileReadAction { +class openhands.action.fileop.FileReadAction { path: str action: str } -class opendevin.observation.FileReadObservation { +class openhands.observation.FileReadObservation { path: str observation: str } -class opendevin.action.fileop.FileWriteAction { +class openhands.action.fileop.FileWriteAction { path: str contents: str action: str } -class opendevin.observation.FileWriteObservation { +class openhands.observation.FileWriteObservation { path: str observation: str } -class opendevin.action.tasks.AddTaskAction { +class openhands.action.tasks.AddTaskAction { parent: str goal: str subtasks: list action: str } -class opendevin.action.tasks.ModifyTaskAction { +class openhands.action.tasks.ModifyTaskAction { id: str state: str action: str } -abstract class opendevin.agent.Agent { +abstract class openhands.agent.Agent { _registry: Dict[str, Type[Agent]] {static} llm: LLM _complete: None } -class opendevin.llm.llm.LLM { +class openhands.llm.llm.LLM { model: None api_key: None base_url: None @@ -91,7 +91,7 @@ class opendevin.llm.llm.LLM { _debug_id: None _completion: None } -class opendevin.controller.agent_controller.AgentController { +class openhands.controller.agent_controller.AgentController { agent: Agent max_iterations: int workdir: str @@ -100,35 +100,35 @@ class opendevin.controller.agent_controller.AgentController { plan: Plan callbacks: List[Callable] } -class opendevin.observation.AgentErrorObservation { +class openhands.observation.AgentErrorObservation { observation: str } -class opendevin.controller.command_manager.CommandManager { +class openhands.controller.command_manager.CommandManager { directory: None shell: None } -class opendevin.observation.NullObservation { +class openhands.observation.NullObservation { observation: str } -class opendevin.plan.Plan { +class openhands.plan.Plan { main_goal: str {static} task: Task {static} main_goal: str task: None } -class opendevin.state.State { +class openhands.state.State { plan: Plan iteration: int history: List[Tuple[Action, Observation]] updated_info: List[Tuple[Action, Observation]] } -class opendevin.observation.CmdOutputObservation { +class openhands.observation.CmdOutputObservation { command_id: int command: str exit_code: int observation: str } -class opendevin.sandbox.sandbox.DockerInteractive { +class openhands.sandbox.sandbox.DockerInteractive { instance_id: None instance_id: None workspace_dir: None @@ -138,11 +138,11 @@ class opendevin.sandbox.sandbox.DockerInteractive { container_image: None container_name: None } -class opendevin.observation.UserMessageObservation { +class openhands.observation.UserMessageObservation { role: str observation: str } -class opendevin.plan.Task { +class openhands.plan.Task { id: str {static} goal: str {static} parent: Task | None {static} @@ -154,49 +154,49 @@ class opendevin.plan.Task { subtasks: None } -class opendevin.server.session.Session { +class openhands.server.session.Session { websocket: None controller: Optional[AgentController] agent: Optional[Agent] agent_task: None } -opendevin.action.base.ExecutableAction <|-- opendevin.action.agent.AgentEchoAction -opendevin.action.base.NotExecutableAction <|-- opendevin.action.agent.AgentFinishAction -opendevin.observation.Observation <|-- opendevin.observation.AgentMessageObservation -opendevin.action.base.NotExecutableAction <|-- opendevin.action.agent.AgentSummarizeAction -opendevin.action.base.NotExecutableAction <|-- opendevin.action.agent.AgentThinkAction -opendevin.action.base.Action <|-- opendevin.action.base.ExecutableAction -opendevin.action.base.Action <|-- opendevin.action.base.NotExecutableAction -opendevin.action.base.NotExecutableAction <|-- opendevin.action.base.NullAction -opendevin.action.base.ExecutableAction <|-- opendevin.action.bash.CmdRunAction -opendevin.action.base.ExecutableAction <|-- opendevin.action.browse.BrowseURLAction -opendevin.observation.Observation <|-- opendevin.observation.BrowserOutputObservation -opendevin.action.base.ExecutableAction <|-- opendevin.action.fileop.FileReadAction -opendevin.observation.Observation <|-- opendevin.observation.FileReadObservation -opendevin.action.base.ExecutableAction <|-- opendevin.action.fileop.FileWriteAction -opendevin.observation.Observation <|-- opendevin.observation.FileWriteObservation -opendevin.action.base.NotExecutableAction <|-- opendevin.action.tasks.AddTaskAction -opendevin.action.base.NotExecutableAction <|-- opendevin.action.tasks.ModifyTaskAction -opendevin.agent.Agent *-- opendevin.agent.Agent -opendevin.agent.Agent *-- opendevin.llm.llm.LLM -opendevin.controller.agent_controller.AgentController *-- opendevin.agent.Agent -opendevin.observation.Observation <|-- opendevin.observation.AgentErrorObservation -opendevin.observation.Observation <|-- opendevin.observation.NullObservation -opendevin.plan.Plan *-- opendevin.plan.Task -opendevin.state.State *-- opendevin.plan.Plan -opendevin.state.State *-- opendevin.observation.CmdOutputObservation -opendevin.state.State *-- opendevin.action.base.Action -opendevin.state.State *-- opendevin.observation.Observation -opendevin.observation.Observation <|-- opendevin.observation.CmdOutputObservation -opendevin.observation.Observation <|-- opendevin.observation.UserMessageObservation -opendevin.plan.Task *-- opendevin.plan.Task -opendevin.server.session.Session *-- opendevin.controller.agent_controller.AgentController -opendevin.server.session.Session *-- opendevin.agent.Agent -opendevin.controller.agent_controller.AgentController -> opendevin.state.State -opendevin.controller.agent_controller.AgentController -> opendevin.plan.Plan -opendevin.controller.agent_controller.AgentController -> opendevin.controller.command_manager.CommandManager -opendevin.controller.command_manager.CommandManager -> opendevin.sandbox.sandbox.DockerInteractive +openhands.action.base.ExecutableAction <|-- openhands.action.agent.AgentEchoAction +openhands.action.base.NotExecutableAction <|-- openhands.action.agent.AgentFinishAction +openhands.observation.Observation <|-- openhands.observation.AgentMessageObservation +openhands.action.base.NotExecutableAction <|-- openhands.action.agent.AgentSummarizeAction +openhands.action.base.NotExecutableAction <|-- openhands.action.agent.AgentThinkAction +openhands.action.base.Action <|-- openhands.action.base.ExecutableAction +openhands.action.base.Action <|-- openhands.action.base.NotExecutableAction +openhands.action.base.NotExecutableAction <|-- openhands.action.base.NullAction +openhands.action.base.ExecutableAction <|-- openhands.action.bash.CmdRunAction +openhands.action.base.ExecutableAction <|-- openhands.action.browse.BrowseURLAction +openhands.observation.Observation <|-- openhands.observation.BrowserOutputObservation +openhands.action.base.ExecutableAction <|-- openhands.action.fileop.FileReadAction +openhands.observation.Observation <|-- openhands.observation.FileReadObservation +openhands.action.base.ExecutableAction <|-- openhands.action.fileop.FileWriteAction +openhands.observation.Observation <|-- openhands.observation.FileWriteObservation +openhands.action.base.NotExecutableAction <|-- openhands.action.tasks.AddTaskAction +openhands.action.base.NotExecutableAction <|-- openhands.action.tasks.ModifyTaskAction +openhands.agent.Agent *-- openhands.agent.Agent +openhands.agent.Agent *-- openhands.llm.llm.LLM +openhands.controller.agent_controller.AgentController *-- openhands.agent.Agent +openhands.observation.Observation <|-- openhands.observation.AgentErrorObservation +openhands.observation.Observation <|-- openhands.observation.NullObservation +openhands.plan.Plan *-- openhands.plan.Task +openhands.state.State *-- openhands.plan.Plan +openhands.state.State *-- openhands.observation.CmdOutputObservation +openhands.state.State *-- openhands.action.base.Action +openhands.state.State *-- openhands.observation.Observation +openhands.observation.Observation <|-- openhands.observation.CmdOutputObservation +openhands.observation.Observation <|-- openhands.observation.UserMessageObservation +openhands.plan.Task *-- openhands.plan.Task +openhands.server.session.Session *-- openhands.controller.agent_controller.AgentController +openhands.server.session.Session *-- openhands.agent.Agent +openhands.controller.agent_controller.AgentController -> openhands.state.State +openhands.controller.agent_controller.AgentController -> openhands.plan.Plan +openhands.controller.agent_controller.AgentController -> openhands.controller.command_manager.CommandManager +openhands.controller.command_manager.CommandManager -> openhands.sandbox.sandbox.DockerInteractive footer Based on f3fda42; Generated by //py2puml// @enduml diff --git a/docs/static/img/backend_architecture.svg b/docs/static/img/backend_architecture.svg index 744b49f2fd..bef2dbd8ca 100644 --- a/docs/static/img/backend_architecture.svg +++ b/docs/static/img/backend_architecture.svg @@ -1 +1 @@ -opendevinactionagentbasebashbrowsefileoptasksobservationagentllm.llmcontrolleragent_controllercommand_managerplanstatesandbox.sandboxserver.sessionAgentEchoActioncontent: strrunnable: boolaction: strAgentFinishActionrunnable: boolaction: strAgentRecallActionquery: straction: strAgentSummarizeActionsummary: straction: strAgentThinkActionthought: strrunnable: boolaction: strExecutableActionNotExecutableActionActionNullActionaction: strCmdKillActionid: intaction: strCmdRunActioncommand: strbackground: boolaction: strBrowseURLActionurl: straction: strFileReadActionpath: straction: strFileWriteActionpath: strcontents: straction: strAddTaskActionparent: strgoal: strsubtasks: listaction: strModifyTaskActionid: strstate: straction: strAgentMessageObservationrole: strobservation: strAgentRecallObservationmemories: List[str]role: strobservation: strObservationcontent: strBrowserOutputObservationurl: strstatus_code: interror: boolobservation: strFileReadObservationpath: strobservation: strFileWriteObservationpath: strobservation: strAgentErrorObservationobservation: strNullObservationobservation: strCmdOutputObservationcommand_id: intcommand: strexit_code: intobservation: strUserMessageObservationrole: strobservation: strAgent_registry: Dict[str, Type[Agent]]llm: LLM_complete: NoneLLMmodel: Noneapi_key: Nonebase_url: None_debug_dir: None_debug_idx: None_debug_id: None_completion: NoneAgentControlleragent: Agentmax_iterations: intworkdir: strcommand_manager: CommandManagerstate: Stateplan: Plancallbacks: List[Callable]CommandManagerdirectory: Noneshell: NonePlanmain_goal: strtask: Taskmain_goal: strtask: NoneTaskid: strgoal: strparent: Task | Nonesubtasks: List[Task]id: Noneid: Noneparent: Nonegoal: strsubtasks: NoneStateplan: Planiteration: intbackground_commands_obs: List[CmdOutputObservation]history: List[Tuple[Action, Observation]]updated_info: List[Tuple[Action, Observation]]DockerInteractivebackground_commands: Dict[int, BackgroundCommand]instance_id: Noneinstance_id: Noneworkspace_dir: Noneworkspace_dir: Noneworkspace_dir: Nonetimeout: intcontainer_image: Nonecontainer_name: NoneBackgroundCommandSessionwebsocket: Nonecontroller: Optional[AgentController]agent: Optional[Agent]agent_task: NoneBased on f3fda42; Generated bypy2puml +openhandsactionagentbasebashbrowsefileoptasksobservationagentllm.llmcontrolleragent_controllercommand_managerplanstatesandbox.sandboxserver.sessionAgentEchoActioncontent: strrunnable: boolaction: strAgentFinishActionrunnable: boolaction: strAgentRecallActionquery: straction: strAgentSummarizeActionsummary: straction: strAgentThinkActionthought: strrunnable: boolaction: strExecutableActionNotExecutableActionActionNullActionaction: strCmdKillActionid: intaction: strCmdRunActioncommand: strbackground: boolaction: strBrowseURLActionurl: straction: strFileReadActionpath: straction: strFileWriteActionpath: strcontents: straction: strAddTaskActionparent: strgoal: strsubtasks: listaction: strModifyTaskActionid: strstate: straction: strAgentMessageObservationrole: strobservation: strAgentRecallObservationmemories: List[str]role: strobservation: strObservationcontent: strBrowserOutputObservationurl: strstatus_code: interror: boolobservation: strFileReadObservationpath: strobservation: strFileWriteObservationpath: strobservation: strAgentErrorObservationobservation: strNullObservationobservation: strCmdOutputObservationcommand_id: intcommand: strexit_code: intobservation: strUserMessageObservationrole: strobservation: strAgent_registry: Dict[str, Type[Agent]]llm: LLM_complete: NoneLLMmodel: Noneapi_key: Nonebase_url: None_debug_dir: None_debug_idx: None_debug_id: None_completion: NoneAgentControlleragent: Agentmax_iterations: intworkdir: strcommand_manager: CommandManagerstate: Stateplan: Plancallbacks: List[Callable]CommandManagerdirectory: Noneshell: NonePlanmain_goal: strtask: Taskmain_goal: strtask: NoneTaskid: strgoal: strparent: Task | Nonesubtasks: List[Task]id: Noneid: Noneparent: Nonegoal: strsubtasks: NoneStateplan: Planiteration: intbackground_commands_obs: List[CmdOutputObservation]history: List[Tuple[Action, Observation]]updated_info: List[Tuple[Action, Observation]]DockerInteractivebackground_commands: Dict[int, BackgroundCommand]instance_id: Noneinstance_id: Noneworkspace_dir: Noneworkspace_dir: Noneworkspace_dir: Nonetimeout: intcontainer_image: Nonecontainer_name: NoneBackgroundCommandSessionwebsocket: Nonecontroller: Optional[AgentController]agent: Optional[Agent]agent_task: NoneBased on f3fda42; Generated bypy2puml diff --git a/docs/static/img/teaser.mp4 b/docs/static/img/teaser.mp4 index 6a3cc0821b..648bb9f4e5 100644 Binary files a/docs/static/img/teaser.mp4 and b/docs/static/img/teaser.mp4 differ diff --git a/evaluation/EDA/README.md b/evaluation/EDA/README.md index 06e453ec7f..a8a2e4fbf0 100644 --- a/evaluation/EDA/README.md +++ b/evaluation/EDA/README.md @@ -20,7 +20,7 @@ where `model_config` is mandatory, while `git-version`, `agent`, `dataset` and ` - `model_config`, e.g. `eval_gpt4_1106_preview`, is the config group name for your LLM settings, as defined in your `config.toml`. -- `git-version`, e.g. `HEAD`, is the git commit hash of the OpenDevin version you would +- `git-version`, e.g. `HEAD`, is the git commit hash of the OpenHands version you would like to evaluate. It could also be a release tag like `0.6.2`. - `agent`, e.g. `CodeActAgent`, is the name of the agent for benchmarks, defaulting diff --git a/evaluation/EDA/run_infer.py b/evaluation/EDA/run_infer.py index 29ce4241c6..9abbf9f424 100644 --- a/evaluation/EDA/run_infer.py +++ b/evaluation/EDA/run_infer.py @@ -13,15 +13,15 @@ from evaluation.utils.shared import ( reset_logger_for_multiprocessing, run_evaluation, ) -from opendevin.controller.state.state import State -from opendevin.core.config import ( +from openhands.controller.state.state import State +from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, get_parser, ) -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.main import create_runtime, run_controller +from openhands.core.logger import openhands_logger as logger +from openhands.core.main import create_runtime, run_controller game = None @@ -58,7 +58,7 @@ def get_config( ) -> AppConfig: config = AppConfig( default_agent=metadata.agent_class, - run_as_devin=False, + run_as_openhands=False, runtime='eventstream', max_iterations=metadata.max_iterations, sandbox=SandboxConfig( diff --git a/evaluation/EDA/scripts/run_infer.sh b/evaluation/EDA/scripts/run_infer.sh index eeaa43a830..bd52c613ff 100755 --- a/evaluation/EDA/scripts/run_infer.sh +++ b/evaluation/EDA/scripts/run_infer.sh @@ -34,9 +34,9 @@ if [ -z "$OPENAI_API_KEY" ]; then exit 1 fi -# IMPORTANT: Because Agent's prompt changes fairly often in the rapidly evolving codebase of OpenDevin +# 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 opendevin.controller.agent import Agent; print(Agent.get_cls('$AGENT').VERSION)") +AGENT_VERSION=v$(poetry run python -c "import 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/README.md b/evaluation/README.md index 7ede494b8e..8813e4e883 100644 --- a/evaluation/README.md +++ b/evaluation/README.md @@ -7,12 +7,12 @@ To better organize the evaluation folder, we should follow the rules below: - Each subfolder contains a specific benchmark or experiment. For example, `evaluation/swe_bench` should contain all the preprocessing/evaluation/analysis scripts. - Raw data and experimental records should not be stored within this repo. - - For model outputs, they should be stored at [this huggingface space](https://huggingface.co/spaces/OpenDevin/evaluation) for visualization. + - For model outputs, they should be stored at [this huggingface space](https://huggingface.co/spaces/OpenHands/evaluation) for visualization. - Important data files of manageable size and analysis scripts (e.g., jupyter notebooks) can be directly uploaded to this repo. ## Supported Benchmarks -To learn more about how to integrate your benchmark into OpenDevin, check out [tutorial here](https://docs.all-hands.dev/modules/usage/evaluation_harness). +To learn more about how to integrate your benchmark into OpenHands, check out [tutorial here](https://docs.all-hands.dev/modules/usage/evaluation_harness). ### Software Engineering @@ -41,9 +41,9 @@ To learn more about how to integrate your benchmark into OpenDevin, check out [t ## Before everything begins: Setup Environment and LLM Configuration -Please follow instruction [here](https://github.com/OpenDevin/OpenDevin/blob/main/Development.md) to setup your local development environment and LLM. +Please follow instruction [here](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md) to setup your local development environment and LLM. -OpenDevin in development mode uses `config.toml` to keep track of most configurations. +OpenHands in development mode uses `config.toml` to keep track of most configurations. Here's an example configuration file you can use to define and use multiple LLMs: @@ -68,9 +68,9 @@ temperature = 0.0 ### Result Visualization -Check [this huggingface space](https://huggingface.co/spaces/OpenDevin/evaluation) for visualization of existing experimental results. +Check [this huggingface space](https://huggingface.co/spaces/OpenHands/evaluation) for visualization of existing experimental results. ### Upload your results -You can start your own fork of [our huggingface evaluation outputs](https://huggingface.co/spaces/OpenDevin/evaluation) and submit a PR of your evaluation results to our hosted huggingface repo via PR following the guide [here](https://huggingface.co/docs/hub/en/repositories-pull-requests-discussions#pull-requests-and-discussions). +You can start your own fork of [our huggingface evaluation outputs](https://huggingface.co/spaces/OpenHands/evaluation) and submit a PR of your evaluation results to our hosted huggingface repo via PR following the guide [here](https://huggingface.co/docs/hub/en/repositories-pull-requests-discussions#pull-requests-and-discussions). diff --git a/evaluation/agent_bench/README.md b/evaluation/agent_bench/README.md index f656e17ba7..1133a09a5c 100644 --- a/evaluation/agent_bench/README.md +++ b/evaluation/agent_bench/README.md @@ -14,7 +14,7 @@ Please follow instruction [here](../README.md#setup) to setup your local develop - `model_config`, e.g. `eval_gpt4_1106_preview`, is the config group name for your LLM settings, as defined in your `config.toml`. -- `git-version`, e.g. `HEAD`, is the git commit hash of the OpenDevin version you would +- `git-version`, e.g. `HEAD`, is the git commit hash of the OpenHands version you would like to evaluate. It could also be a release tag like `0.6.2`. - `agent`, e.g. `CodeActAgent`, is the name of the agent for benchmarks, defaulting to `CodeActAgent`. diff --git a/evaluation/agent_bench/helper.py b/evaluation/agent_bench/helper.py index ca17e4f97d..c16fed97bc 100644 --- a/evaluation/agent_bench/helper.py +++ b/evaluation/agent_bench/helper.py @@ -3,7 +3,7 @@ import re from functools import partial from evaluation.utils.shared import codeact_user_response -from opendevin.events.action import CmdRunAction, MessageAction +from openhands.events.action import CmdRunAction, MessageAction def try_parse_answer(act) -> str | None: diff --git a/evaluation/agent_bench/run_infer.py b/evaluation/agent_bench/run_infer.py index 77b7a1e002..63948a3c83 100644 --- a/evaluation/agent_bench/run_infer.py +++ b/evaluation/agent_bench/run_infer.py @@ -21,18 +21,18 @@ from evaluation.utils.shared import ( reset_logger_for_multiprocessing, run_evaluation, ) -from opendevin.controller.state.state import State -from opendevin.core.config import ( +from openhands.controller.state.state import State +from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, parse_arguments, ) -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.main import create_runtime, run_controller -from opendevin.events.action import AgentFinishAction, CmdRunAction, MessageAction -from opendevin.events.observation import CmdOutputObservation -from opendevin.runtime.runtime import Runtime +from openhands.core.logger import openhands_logger as logger +from openhands.core.main import create_runtime, run_controller +from openhands.events.action import AgentFinishAction, CmdRunAction, MessageAction +from openhands.events.observation import CmdOutputObservation +from openhands.runtime.runtime import Runtime def get_config( @@ -40,7 +40,7 @@ def get_config( ) -> AppConfig: config = AppConfig( default_agent=metadata.agent_class, - run_as_devin=False, + run_as_openhands=False, runtime='eventstream', max_iterations=metadata.max_iterations, sandbox=SandboxConfig( diff --git a/evaluation/biocoder/README.md b/evaluation/biocoder/README.md index c549afc9c1..ad9cf55f53 100644 --- a/evaluation/biocoder/README.md +++ b/evaluation/biocoder/README.md @@ -1,4 +1,4 @@ -# BioCoder Evaluation with Opendevin +# BioCoder Evaluation with Openopenhands Implements evaluation of agents on BioCoder from the BioCoder benchmark introduced in [BioCoder: A Benchmark for Bioinformatics Code Generation with Large Language Models](https://arxiv.org/abs/2308.16458). Please see [here](https://github.com/bigcode-project/bigcode-evaluation-harness/blob/main/bigcode_eval/tasks/humanevalpack.py) for the reference implementation used in the paper. @@ -8,14 +8,14 @@ Please follow instruction [here](../README.md#setup) to setup your local develop ## BioCoder Docker Image -In the opendevin branch of the Biocoder repository, we have slightly modified our original Docker image to work with the OpenDevin environment. In the Docker image are testing scripts (`/testing/start_test_opendevin.py` and aux files in `/testing_files/`) to assist with evaluation. Additionally, we have installed all dependencies, including OpenJDK, mamba (with Python 3.6), and many system libraries. Notably, we have **not** packaged all repositories into the image, so they are downloaded at runtime. +In the openhands branch of the Biocoder repository, we have slightly modified our original Docker image to work with the OpenHands environment. In the Docker image are testing scripts (`/testing/start_test_openhands.py` and aux files in `/testing_files/`) to assist with evaluation. Additionally, we have installed all dependencies, including OpenJDK, mamba (with Python 3.6), and many system libraries. Notably, we have **not** packaged all repositories into the image, so they are downloaded at runtime. **Before first execution, pull our Docker image with the following command** ```bash docker pull public.ecr.aws/i5g0m1f6/eval_biocoder:v1.0 ``` -To reproduce this image, please see the Dockerfile_Opendevin in the `biocoder` repository. +To reproduce this image, please see the Dockerfile_Openopenhands in the `biocoder` repository. ## Start the evaluation @@ -29,7 +29,7 @@ where `model_config` is mandatory, while `git-version`, `agent`, `dataset` and ` - `model_config`, e.g. `eval_gpt4_1106_preview`, is the config group name for your LLM settings, as defined in your `config.toml`. -- `git-version`, e.g. `HEAD`, is the git commit hash of the OpenDevin version you would +- `git-version`, e.g. `HEAD`, is the git commit hash of the OpenHands version you would like to evaluate. It could also be a release tag like `0.6.2`. - `agent`, e.g. `CodeActAgent`, is the name of the agent for benchmarks, defaulting @@ -38,7 +38,7 @@ to `CodeActAgent`. - `eval_limit`, e.g. `10`, limits the evaluation to the first `eval_limit` instances. By default it infers all instances. Let's say you'd like to run 1 instance using `eval_gpt4_1106_eval_gpt4o_2024_05_13preview` and CodeActAgent -with current OpenDevin version, then your command would be: +with current OpenHands version, then your command would be: ## Examples diff --git a/evaluation/biocoder/run_infer.py b/evaluation/biocoder/run_infer.py index 3fb2137440..29e8bda37a 100644 --- a/evaluation/biocoder/run_infer.py +++ b/evaluation/biocoder/run_infer.py @@ -18,18 +18,18 @@ from evaluation.utils.shared import ( reset_logger_for_multiprocessing, run_evaluation, ) -from opendevin.controller.state.state import State -from opendevin.core.config import ( +from openhands.controller.state.state import State +from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, parse_arguments, ) -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.main import create_runtime, run_controller -from opendevin.events.action import CmdRunAction -from opendevin.events.observation import CmdOutputObservation -from opendevin.runtime.runtime import Runtime +from openhands.core.logger import openhands_logger as logger +from openhands.core.main import create_runtime, run_controller +from openhands.events.action import CmdRunAction +from openhands.events.observation import CmdOutputObservation +from openhands.runtime.runtime import Runtime AGENT_CLS_TO_FAKE_USER_RESPONSE_FN = { 'CodeActAgent': functools.partial( @@ -58,7 +58,7 @@ def get_config( config = AppConfig( default_agent=metadata.agent_class, - run_as_devin=False, + run_as_openhands=False, runtime='eventstream', max_iterations=metadata.max_iterations, sandbox=SandboxConfig( @@ -212,7 +212,7 @@ async def complete_runtime( assert obs.exit_code == 0 action = CmdRunAction( - command='/home/devin/mambaforge/bin/mamba run -n test python3 /testing/start_test_opendevin.py' + command='/home/openhands/mambaforge/bin/mamba run -n test python3 /testing/start_test_openhands.py' ) logger.info(action, extra={'msg_type': 'ACTION'}) obs = await runtime.run_action(action) diff --git a/evaluation/bird/README.md b/evaluation/bird/README.md index 072da010f8..7818cdbf5a 100644 --- a/evaluation/bird/README.md +++ b/evaluation/bird/README.md @@ -1,4 +1,4 @@ -# BIRD Evaluation with OpenDevin +# BIRD Evaluation with OpenHands Implements evaluation of agents on BIRD introduced in [Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLs](https://arxiv.org/abs/2305.03111). Please see [here](https://bird-bench.github.io/) for the reference implementation used in the paper. @@ -15,12 +15,12 @@ Please follow instruction [here](../README.md#setup) to setup your local develop - `model_config`, e.g. `eval_gpt4_1106_preview`, is the config group name for your LLM settings, as defined in your `config.toml`. -- `git-version`, e.g. `HEAD`, is the git commit hash of the OpenDevin version you would +- `git-version`, e.g. `HEAD`, is the git commit hash of the OpenHands version you would like to evaluate. It could also be a release tag like `0.6.2`. ## Examples -For each problem, OpenDevin is given a set number of iterations to fix the failing code. The history field shows each iteration's response to correct its code that fails any test case. +For each problem, OpenHands is given a set number of iterations to fix the failing code. The history field shows each iteration's response to correct its code that fails any test case. ``` diff --git a/evaluation/bird/run_infer.py b/evaluation/bird/run_infer.py index 86db5eb9eb..1c3666638d 100644 --- a/evaluation/bird/run_infer.py +++ b/evaluation/bird/run_infer.py @@ -21,18 +21,18 @@ from evaluation.utils.shared import ( reset_logger_for_multiprocessing, run_evaluation, ) -from opendevin.controller.state.state import State -from opendevin.core.config import ( +from openhands.controller.state.state import State +from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, parse_arguments, ) -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.main import create_runtime, run_controller -from opendevin.events.action import CmdRunAction, MessageAction -from opendevin.events.observation import CmdOutputObservation -from opendevin.runtime.runtime import Runtime +from openhands.core.logger import openhands_logger as logger +from openhands.core.main import create_runtime, run_controller +from openhands.events.action import CmdRunAction, MessageAction +from openhands.events.observation import CmdOutputObservation +from openhands.runtime.runtime import Runtime def codeact_user_response(state: State) -> str: @@ -71,7 +71,7 @@ def get_config( ) -> AppConfig: config = AppConfig( default_agent=metadata.agent_class, - run_as_devin=False, + run_as_openhands=False, runtime='eventstream', max_iterations=metadata.max_iterations, sandbox=SandboxConfig( diff --git a/evaluation/browsing_delegation/README.md b/evaluation/browsing_delegation/README.md index fe71dacb88..92e9410971 100644 --- a/evaluation/browsing_delegation/README.md +++ b/evaluation/browsing_delegation/README.md @@ -1,6 +1,6 @@ # Browsing Delegation Evalution -Some of OpenDevin's agent supports agent delegation action, for example, CodeActAgent can delegate browsing tasks to BrowsingAgent. +Some of OpenHands's agent supports agent delegation action, for example, CodeActAgent can delegate browsing tasks to BrowsingAgent. This evaluation tests whether CodeActAgent can correctly delegate the instruction from WebArena and MiniWob benchmark to the BrowsingAgent. If so, the browsing performance upper-bound of CodeActAgent will be the performance of BrowsingAgent. @@ -21,7 +21,7 @@ where `model_config` is mandatory, while `agent` and `eval_limit` are optional. `model_config`, e.g. `eval_gpt4_1106_preview`, is the config group name for your LLM settings, as defined in your `config.toml`. -`git-version`, e.g. `HEAD`, is the git commit hash of the OpenDevin version you would +`git-version`, e.g. `HEAD`, is the git commit hash of the OpenHands version you would like to evaluate. It could also be a release tag like `0.6.2`. `agent`, e.g. `CodeActAgent`, is the name of the agent for benchmarks, defaulting diff --git a/evaluation/browsing_delegation/run_infer.py b/evaluation/browsing_delegation/run_infer.py index c4d5ecd4d6..746ccd1a2a 100644 --- a/evaluation/browsing_delegation/run_infer.py +++ b/evaluation/browsing_delegation/run_infer.py @@ -14,15 +14,15 @@ from evaluation.utils.shared import ( reset_logger_for_multiprocessing, run_evaluation, ) -from opendevin.controller.state.state import State -from opendevin.core.config import ( +from openhands.controller.state.state import State +from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, parse_arguments, ) -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.main import create_runtime, run_controller +from openhands.core.logger import openhands_logger as logger +from openhands.core.main import create_runtime, run_controller # Only CodeActAgent can delegate to BrowsingAgent SUPPORTED_AGENT_CLS = {'CodeActAgent'} @@ -36,7 +36,7 @@ def get_config( ), 'max_iterations must be 1 for browsing delegation evaluation.' config = AppConfig( default_agent=metadata.agent_class, - run_as_devin=False, + run_as_openhands=False, runtime='eventstream', max_iterations=metadata.max_iterations, sandbox=SandboxConfig( @@ -131,7 +131,7 @@ async def process_instance( if __name__ == '__main__': args = parse_arguments() - dataset = load_dataset('OpenDevin/eval-browsing-instructions') + dataset = load_dataset('OpenHands/eval-browsing-instructions') dataset = dataset['train'].to_pandas() assert dataset.columns.tolist() == ['instance_id', 'instruction'] diff --git a/evaluation/gaia/README.md b/evaluation/gaia/README.md index cd7e7c9677..bf1c701328 100644 --- a/evaluation/gaia/README.md +++ b/evaluation/gaia/README.md @@ -22,7 +22,7 @@ where `model_config` is mandatory, while `git-version`, `agent`, `eval_limit` an - `model_config`, e.g. `eval_gpt4_1106_preview`, is the config group name for your LLM settings, as defined in your `config.toml`, defaulting to `gpt-3.5-turbo` -- `git-version`, e.g. `HEAD`, is the git commit hash of the OpenDevin version you would +- `git-version`, e.g. `HEAD`, is the git commit hash of the OpenHands version you would like to evaluate. It could also be a release tag like `0.6.2`. - `agent`, e.g. `CodeActAgent`, is the name of the agent for benchmarks, defaulting diff --git a/evaluation/gaia/run_infer.py b/evaluation/gaia/run_infer.py index 0ff4b1a434..b3330632c3 100644 --- a/evaluation/gaia/run_infer.py +++ b/evaluation/gaia/run_infer.py @@ -17,18 +17,18 @@ from evaluation.utils.shared import ( reset_logger_for_multiprocessing, run_evaluation, ) -from opendevin.controller.state.state import State -from opendevin.core.config import ( +from openhands.controller.state.state import State +from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, get_parser, ) -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.main import create_runtime, run_controller -from opendevin.events.action import AgentFinishAction, CmdRunAction, MessageAction -from opendevin.events.observation import CmdOutputObservation -from opendevin.runtime.runtime import Runtime +from openhands.core.logger import openhands_logger as logger +from openhands.core.main import create_runtime, run_controller +from openhands.events.action import AgentFinishAction, CmdRunAction, MessageAction +from openhands.events.observation import CmdOutputObservation +from openhands.runtime.runtime import Runtime DATASET_CACHE_DIR = os.path.join(os.path.dirname(__file__), 'data') @@ -47,7 +47,7 @@ def get_config( ) -> AppConfig: config = AppConfig( default_agent=metadata.agent_class, - run_as_devin=False, + run_as_openhands=False, runtime='eventstream', max_iterations=metadata.max_iterations, sandbox=SandboxConfig( diff --git a/evaluation/gorilla/README.md b/evaluation/gorilla/README.md index 106a83a251..4cd90f554a 100644 --- a/evaluation/gorilla/README.md +++ b/evaluation/gorilla/README.md @@ -1,4 +1,4 @@ -# Gorilla APIBench Evaluation with OpenDevin +# Gorilla APIBench Evaluation with OpenHands This folder contains evaluation harness we built on top of the original [Gorilla APIBench](https://github.com/ShishirPatil/gorilla) ([paper](https://arxiv.org/pdf/2305.15334)). @@ -19,7 +19,7 @@ where `model_config` is mandatory, while all other arguments are optional. `model_config`, e.g. `llm`, is the config group name for your LLM settings, as defined in your `config.toml`. -`git-version`, e.g. `HEAD`, is the git commit hash of the OpenDevin version you would +`git-version`, e.g. `HEAD`, is the git commit hash of the OpenHands version you would like to evaluate. It could also be a release tag like `0.6.2`. `agent`, e.g. `CodeActAgent`, is the name of the agent for benchmarks, defaulting diff --git a/evaluation/gorilla/run_infer.py b/evaluation/gorilla/run_infer.py index 44fb73c234..94f14f0a58 100644 --- a/evaluation/gorilla/run_infer.py +++ b/evaluation/gorilla/run_infer.py @@ -15,15 +15,15 @@ from evaluation.utils.shared import ( reset_logger_for_multiprocessing, run_evaluation, ) -from opendevin.controller.state.state import State -from opendevin.core.config import ( +from openhands.controller.state.state import State +from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, get_parser, ) -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.main import create_runtime, run_controller +from openhands.core.logger import openhands_logger as logger +from openhands.core.main import create_runtime, run_controller AGENT_CLS_TO_FAKE_USER_RESPONSE_FN = { 'CodeActAgent': codeact_user_response, @@ -39,7 +39,7 @@ def get_config( ) -> AppConfig: config = AppConfig( default_agent=metadata.agent_class, - run_as_devin=False, + run_as_openhands=False, runtime='eventstream', max_iterations=metadata.max_iterations, sandbox=SandboxConfig( diff --git a/evaluation/gpqa/README.md b/evaluation/gpqa/README.md index 7e1981c1f0..b96c5913cb 100644 --- a/evaluation/gpqa/README.md +++ b/evaluation/gpqa/README.md @@ -1,4 +1,4 @@ -# Evaluating GPQA (A Graduate-Level Google-Proof Q&A Benchmark) with OpenDevin +# Evaluating GPQA (A Graduate-Level Google-Proof Q&A Benchmark) with OpenHands Implements the evaluation of agents on the GPQA benchmark introduced in [GPQA: A Graduate-Level Google-Proof Q&A Benchmark](https://arxiv.org/abs/2308.07124). @@ -21,14 +21,14 @@ Please follow instruction [here](../README.md#setup) to setup your local develop ## Run Inference on GPQA Benchmark 'gpqa_main', 'gqpa_diamond', 'gpqa_experts', 'gpqa_extended' -- data split options -From the root of the OpenDevin repo, run the following command: +From the root of the OpenHands repo, run the following command: ```bash ./evaluation/gpqa/scripts/run_infer.sh [model_config_name] [git-version] [num_samples_eval] [data_split] [AgentClass] ``` You can replace `model_config_name` with any model you set up in `config.toml`. - `model_config_name`: The model configuration name from `config.toml` that you want to evaluate. -- `git-version`, e.g. `HEAD`, is the git commit hash of the OpenDevin version you would +- `git-version`, e.g. `HEAD`, is the git commit hash of the OpenHands version you would like to evaluate. It could also be a release tag like `0.6.2`. - `num_samples_eval`: Number of samples to evaluate (useful for testing and debugging). - `data_split`: The data split to evaluate on. Must be one of `gpqa_main`, `gqpa_diamond`, `gpqa_experts`, `gpqa_extended`. Defaults to `gpqa_diamond` as done in the paper. diff --git a/evaluation/gpqa/run_infer.py b/evaluation/gpqa/run_infer.py index 8f2df78e5e..0d085cb95e 100644 --- a/evaluation/gpqa/run_infer.py +++ b/evaluation/gpqa/run_infer.py @@ -33,21 +33,21 @@ from evaluation.utils.shared import ( reset_logger_for_multiprocessing, run_evaluation, ) -from opendevin.controller.state.state import State -from opendevin.core.config import ( +from openhands.controller.state.state import State +from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, get_parser, ) -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.main import create_runtime, run_controller -from opendevin.events.action import ( +from openhands.core.logger import openhands_logger as logger +from openhands.core.main import create_runtime, run_controller +from openhands.events.action import ( Action, AgentFinishAction, MessageAction, ) -from opendevin.events.observation import Observation +from openhands.events.observation import Observation ACTION_FORMAT = """ < AppConfig: config = AppConfig( default_agent=metadata.agent_class, - run_as_devin=False, + run_as_openhands=False, runtime='eventstream', max_iterations=metadata.max_iterations, sandbox=SandboxConfig( @@ -328,7 +328,7 @@ if __name__ == '__main__': raise ValueError(f'Could not find LLM config: --llm_config {args.llm_config}') # NOTE: It is preferable to load datasets from huggingface datasets and perform post-processing - # so we don't need to manage file uploading to OpenDevin's repo + # so we don't need to manage file uploading to OpenHands's repo dataset = load_dataset('Idavidrein/gpqa', args.data_split) gpqa_dataset = dataset['train'] # preprocess the dataset diff --git a/evaluation/humanevalfix/README.md b/evaluation/humanevalfix/README.md index 5a056a54da..45967214c4 100644 --- a/evaluation/humanevalfix/README.md +++ b/evaluation/humanevalfix/README.md @@ -1,4 +1,4 @@ -# HumanEvalFix Evaluation with OpenDevin +# HumanEvalFix Evaluation with OpenHands Implements evaluation of agents on HumanEvalFix from the HumanEvalPack benchmark introduced in [OctoPack: Instruction Tuning Code Large Language Models](https://arxiv.org/abs/2308.07124). Please see [here](https://github.com/bigcode-project/bigcode-evaluation-harness/blob/main/bigcode_eval/tasks/humanevalpack.py) for the reference implementation used in the paper. Currently only `python` evaluation is supported. @@ -17,7 +17,7 @@ You can replace `eval_gpt4_1106_preview` with any model you set up in `config.to ## Examples -For each problem, OpenDevin is given a set number of iterations to fix the failing code. The history field shows each iteration's response to correct its code that fails any test case. +For each problem, OpenHands is given a set number of iterations to fix the failing code. The history field shows each iteration's response to correct its code that fails any test case. ``` diff --git a/evaluation/humanevalfix/run_infer.py b/evaluation/humanevalfix/run_infer.py index 8fc8950428..6b0adc569e 100644 --- a/evaluation/humanevalfix/run_infer.py +++ b/evaluation/humanevalfix/run_infer.py @@ -26,18 +26,18 @@ from evaluation.utils.shared import ( reset_logger_for_multiprocessing, run_evaluation, ) -from opendevin.controller.state.state import State -from opendevin.core.config import ( +from openhands.controller.state.state import State +from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, parse_arguments, ) -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.main import create_runtime, run_controller -from opendevin.events.action import CmdRunAction -from opendevin.events.observation import CmdOutputObservation -from opendevin.runtime.runtime import Runtime +from openhands.core.logger import openhands_logger as logger +from openhands.core.main import create_runtime, run_controller +from openhands.events.action import CmdRunAction +from openhands.events.observation import CmdOutputObservation +from openhands.runtime.runtime import Runtime IMPORT_HELPER = { 'python': [ @@ -82,7 +82,7 @@ def get_config( ) -> AppConfig: config = AppConfig( default_agent=metadata.agent_class, - run_as_devin=False, + run_as_openhands=False, runtime='eventstream', max_iterations=metadata.max_iterations, sandbox=SandboxConfig( @@ -270,7 +270,7 @@ if __name__ == '__main__': args = parse_arguments() # NOTE: It is preferable to load datasets from huggingface datasets and perform post-processing - # so we don't need to manage file uploading to OpenDevin's repo + # so we don't need to manage file uploading to OpenHands's repo dataset = load_dataset( 'bigcode/humanevalpack', 'python' ) # TODO: Support other languages diff --git a/evaluation/logic_reasoning/run_infer.py b/evaluation/logic_reasoning/run_infer.py index d0739d4f39..cba25d7c45 100644 --- a/evaluation/logic_reasoning/run_infer.py +++ b/evaluation/logic_reasoning/run_infer.py @@ -13,23 +13,23 @@ from evaluation.utils.shared import ( reset_logger_for_multiprocessing, run_evaluation, ) -from opendevin.controller.state.state import State -from opendevin.core.config import ( +from openhands.controller.state.state import State +from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, get_parser, ) -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.main import create_runtime, run_controller -from opendevin.events.action import ( +from openhands.core.logger import openhands_logger as logger +from openhands.core.main import create_runtime, run_controller +from openhands.events.action import ( AgentFinishAction, CmdRunAction, IPythonRunCellAction, MessageAction, ) -from opendevin.events.observation import CmdOutputObservation -from opendevin.runtime.runtime import Runtime +from openhands.events.observation import CmdOutputObservation +from openhands.runtime.runtime import Runtime AGENT_CLS_TO_FAKE_USER_RESPONSE_FN = { 'CodeActAgent': codeact_user_response, @@ -45,7 +45,7 @@ def get_config( ) -> AppConfig: config = AppConfig( default_agent=metadata.agent_class, - run_as_devin=False, + run_as_openhands=False, runtime='eventstream', max_iterations=metadata.max_iterations, sandbox=SandboxConfig( diff --git a/evaluation/miniwob/README.md b/evaluation/miniwob/README.md index 4426ebff70..b0b0545406 100644 --- a/evaluation/miniwob/README.md +++ b/evaluation/miniwob/README.md @@ -1,4 +1,4 @@ -# WebArena Evaluation with OpenDevin Browsing Agents +# WebArena Evaluation with OpenHands Browsing Agents This folder contains evaluation for [MiniWoB++](https://miniwob.farama.org/) benchmark, powered by [BrowserGym](https://github.com/ServiceNow/BrowserGym) for easy evaluation of how well an agent capable of browsing can perform on synthetic web browsing tasks. @@ -26,7 +26,7 @@ poetry run python evaluation/miniwob/get_success_rate.py evaluation/evaluation_o ## Submit your evaluation results -You can start your own fork of [our huggingface evaluation outputs](https://huggingface.co/spaces/OpenDevin/evaluation) and submit a PR of your evaluation results following the guide [here](https://huggingface.co/docs/hub/en/repositories-pull-requests-discussions#pull-requests-and-discussions). +You can start your own fork of [our huggingface evaluation outputs](https://huggingface.co/spaces/OpenHands/evaluation) and submit a PR of your evaluation results following the guide [here](https://huggingface.co/docs/hub/en/repositories-pull-requests-discussions#pull-requests-and-discussions). ## BrowsingAgent V1.0 result diff --git a/evaluation/miniwob/run_infer.py b/evaluation/miniwob/run_infer.py index 92c96bf425..2ffa8e4a4a 100644 --- a/evaluation/miniwob/run_infer.py +++ b/evaluation/miniwob/run_infer.py @@ -15,26 +15,26 @@ from evaluation.utils.shared import ( reset_logger_for_multiprocessing, run_evaluation, ) -from opendevin.controller.state.state import State -from opendevin.core.config import ( +from openhands.controller.state.state import State +from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, parse_arguments, ) -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.main import create_runtime, run_controller -from opendevin.events.action import ( +from openhands.core.logger import openhands_logger as logger +from openhands.core.main import create_runtime, run_controller +from openhands.events.action import ( BrowseInteractiveAction, CmdRunAction, MessageAction, ) -from opendevin.events.observation import CmdOutputObservation -from opendevin.runtime.browser.browser_env import ( +from openhands.events.observation import CmdOutputObservation +from openhands.runtime.browser.browser_env import ( BROWSER_EVAL_GET_GOAL_ACTION, BROWSER_EVAL_GET_REWARDS_ACTION, ) -from opendevin.runtime.runtime import Runtime +from openhands.runtime.runtime import Runtime SUPPORTED_AGENT_CLS = {'BrowsingAgent'} @@ -45,7 +45,7 @@ def get_config( ) -> AppConfig: config = AppConfig( default_agent=metadata.agent_class, - run_as_devin=False, + run_as_openhands=False, runtime='eventstream', max_iterations=metadata.max_iterations, sandbox=SandboxConfig( diff --git a/evaluation/mint/README.md b/evaluation/mint/README.md index 3925cf5e40..950996cc49 100644 --- a/evaluation/mint/README.md +++ b/evaluation/mint/README.md @@ -22,7 +22,7 @@ where `model_config` is mandatory, while others are optional. - `model_config`, e.g. `eval_gpt4_1106_preview`, is the config group name for your LLM settings, as defined in your `config.toml`. -- `git-version`, e.g. `HEAD`, is the git commit hash of the OpenDevin version you would +- `git-version`, e.g. `HEAD`, is the git commit hash of the OpenHands version you would like to evaluate. It could also be a release tag like `0.6.2`. - `subset`, e.g. `math`, is the subset of the MINT benchmark to evaluate on, defaulting to `math`. It can be either: `math`, `gsm8k`, `mmlu`, `theoremqa`, `mbpp`,`humaneval`. diff --git a/evaluation/mint/env.py b/evaluation/mint/env.py index 8bffb2288e..9fd4636b3c 100644 --- a/evaluation/mint/env.py +++ b/evaluation/mint/env.py @@ -4,7 +4,7 @@ import traceback from datatypes import ParseError, StepOutput, TaskState from tasks.base import Task -from opendevin.controller.state.state import State +from openhands.controller.state.state import State class SimplifiedEnv: diff --git a/evaluation/mint/run_infer.py b/evaluation/mint/run_infer.py index f08034ebd8..d64c89b6c8 100644 --- a/evaluation/mint/run_infer.py +++ b/evaluation/mint/run_infer.py @@ -17,20 +17,20 @@ from evaluation.utils.shared import ( reset_logger_for_multiprocessing, run_evaluation, ) -from opendevin.controller.state.state import State -from opendevin.core.config import ( +from openhands.controller.state.state import State +from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, get_parser, ) -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.main import create_runtime, run_controller -from opendevin.events.action import ( +from openhands.core.logger import openhands_logger as logger +from openhands.core.main import create_runtime, run_controller +from openhands.events.action import ( CmdRunAction, ) -from opendevin.events.observation import CmdOutputObservation -from opendevin.runtime.runtime import Runtime +from openhands.events.observation import CmdOutputObservation +from openhands.runtime.runtime import Runtime def codeact_user_response_mint(state: State, task: Task, task_config: dict[str, int]): @@ -97,7 +97,7 @@ def get_config( ) -> AppConfig: config = AppConfig( default_agent=metadata.agent_class, - run_as_devin=False, + run_as_openhands=False, runtime='eventstream', max_iterations=metadata.max_iterations, sandbox=SandboxConfig( @@ -243,7 +243,7 @@ if __name__ == '__main__': args, _ = parser.parse_known_args() # NOTE: It is preferable to load datasets from huggingface datasets and perform post-processing - # so we don't need to manage file uploading to OpenDevin's repo + # so we don't need to manage file uploading to OpenHands's repo if args.subset == 'all': subsets = SUBSETS else: diff --git a/evaluation/ml_bench/README.md b/evaluation/ml_bench/README.md index e6199327a7..d2f1a2a5d7 100644 --- a/evaluation/ml_bench/README.md +++ b/evaluation/ml_bench/README.md @@ -1,6 +1,6 @@ -# ML-Bench Evaluation with OpenDevin +# ML-Bench Evaluation with OpenHands -This project implements the evaluation of agents on the [ML-Bench](https://arxiv.org/abs/2311.09835) dataset using OpenDevin. [ML-Bench](https://arxiv.org/abs/2311.09835) is a comprehensive benchmark designed to assess the effectiveness of Large Language Models (LLMs) in leveraging existing functions in open-source libraries for machine learning tasks. The benchmark consists of 10,040 samples spanning 130 tasks over 14 notable machine learning GitHub repositories. +This project implements the evaluation of agents on the [ML-Bench](https://arxiv.org/abs/2311.09835) dataset using OpenHands. [ML-Bench](https://arxiv.org/abs/2311.09835) is a comprehensive benchmark designed to assess the effectiveness of Large Language Models (LLMs) in leveraging existing functions in open-source libraries for machine learning tasks. The benchmark consists of 10,040 samples spanning 130 tasks over 14 notable machine learning GitHub repositories. ## Task Overview @@ -47,7 +47,7 @@ This command generates a report on the evaluation output and provides insights i ## Examples -For each task in the ML-Bench dataset, OpenDevin provides the agent with a set number of iterations to complete the task. The `history` field in the evaluation output shows each iteration's response and actions taken by the agent to complete the task. +For each task in the ML-Bench dataset, OpenHands provides the agent with a set number of iterations to complete the task. The `history` field in the evaluation output shows each iteration's response and actions taken by the agent to complete the task. Here's an example of the evaluation output for a single task instance: diff --git a/evaluation/ml_bench/run_analysis.py b/evaluation/ml_bench/run_analysis.py index 14d0acb5ac..eda8fd4bdd 100644 --- a/evaluation/ml_bench/run_analysis.py +++ b/evaluation/ml_bench/run_analysis.py @@ -4,9 +4,9 @@ import pprint import tqdm -from opendevin.core.config import get_llm_config_arg, get_parser, load_app_config -from opendevin.core.logger import opendevin_logger as logger -from opendevin.llm.llm import LLM +from openhands.core.config import get_llm_config_arg, get_parser, load_app_config +from openhands.core.logger import openhands_logger as logger +from openhands.llm.llm import LLM config = load_app_config() @@ -120,7 +120,7 @@ if __name__ == '__main__': ) args, _ = parser.parse_known_args() - # Check https://github.com/OpenDevin/OpenDevin/blob/main/evaluation/swe_bench/README.md#configure-opendevin-and-your-llm + # Check https://github.com/All-Hands-AI/OpenHands/blob/main/evaluation/swe_bench/README.md#configure-openhands-and-your-llm # for details of how to set `llm_config` if args.llm_config: specified_llm_config = get_llm_config_arg(args.llm_config) diff --git a/evaluation/ml_bench/run_infer.py b/evaluation/ml_bench/run_infer.py index c7baa77e03..f73142fd2c 100644 --- a/evaluation/ml_bench/run_infer.py +++ b/evaluation/ml_bench/run_infer.py @@ -28,19 +28,19 @@ from evaluation.utils.shared import ( reset_logger_for_multiprocessing, run_evaluation, ) -from opendevin.controller.state.state import State -from opendevin.core.config import ( +from openhands.controller.state.state import State +from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, get_parser, load_app_config, ) -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.main import create_runtime, run_controller -from opendevin.events.action import CmdRunAction -from opendevin.events.observation import CmdOutputObservation -from opendevin.runtime.runtime import Runtime +from openhands.core.logger import openhands_logger as logger +from openhands.core.main import create_runtime, run_controller +from openhands.events.action import CmdRunAction +from openhands.events.observation import CmdOutputObservation +from openhands.runtime.runtime import Runtime config = load_app_config() @@ -76,7 +76,7 @@ def get_config( ) -> AppConfig: config = AppConfig( default_agent=metadata.agent_class, - run_as_devin=False, + run_as_openhands=False, runtime='eventstream', max_iterations=metadata.max_iterations, sandbox=SandboxConfig( diff --git a/evaluation/regression/README.md b/evaluation/regression/README.md index 5767a4d0f2..40599ab8cc 100644 --- a/evaluation/regression/README.md +++ b/evaluation/regression/README.md @@ -1,10 +1,10 @@ -# OpenDevin - Regression Test Framework +# OpenHands - Regression Test Framework -OpenDevin project is an open-source software engineering AI that can solve various software engineering tasks. This repository contains the regression test framework for OpenDevin project. +OpenHands project is an open-source software engineering AI that can solve various software engineering tasks. This repository contains the regression test framework for OpenHands project. ## Running the Tests -To run the tests for OpenDevin project, you can use the provided test runner script. Follow these steps: +To run the tests for OpenHands project, you can use the provided test runner script. Follow these steps: 1. Ensure you have Python 3.6 or higher installed on your system. 2. Install the required dependencies by running the following command in your terminal: @@ -22,7 +22,7 @@ The test runner will discover and execute all the test cases in the `cases/` dir ## Test Case Structure -The test cases for OpenDevin project are organized in the `cases/` directory. Each test case has the following structure: +The test cases for OpenHands project are organized in the `cases/` directory. Each test case has the following structure: ``` cases/ @@ -47,9 +47,9 @@ cases/ ``` - `task.txt`: This file contains the task description provided by the user. -- `outputs/`: This directory contains the output generated by OpenDevin for each agent. -- `outputs/*/workspace/`: This directory contains the actual output files generated by OpenDevin. -- `test_*.py`: These are the test scripts that validate the output of OpenDevin. +- `outputs/`: This directory contains the output generated by OpenHands for each agent. +- `outputs/*/workspace/`: This directory contains the actual output files generated by OpenHands. +- `test_*.py`: These are the test scripts that validate the output of OpenHands. ## Adding New Test Cases @@ -63,7 +63,7 @@ The test cases can be customized by modifying the fixtures defined in the `conft - `task_file`: The path to the `task.txt` file for the current test case. - `workspace_dir`: The path to the `workspace/` directory for the current test case. - `model`: The model selected start the generation. -- `run_test_case`: A fixture that runs OpenDevin and generates the workspace for the current test case. +- `run_test_case`: A fixture that runs OpenHands and generates the workspace for the current test case. You can modify these fixtures to change the behavior of the test cases or add new ones as needed. diff --git a/evaluation/regression/cases/hello-name/start/hello_world.sh b/evaluation/regression/cases/hello-name/start/hello_world.sh old mode 100755 new mode 100644 diff --git a/evaluation/regression/conftest.py b/evaluation/regression/conftest.py index e824a10bd0..d514622d51 100644 --- a/evaluation/regression/conftest.py +++ b/evaluation/regression/conftest.py @@ -130,7 +130,7 @@ def run_test_case(test_cases_dir, workspace_dir, request): process = subprocess.Popen( [ 'python3', - f'{SCRIPT_DIR}/../../opendevin/main.py', + f'{SCRIPT_DIR}/../../openhands/main.py', '-d', f"{os.path.join(agent_dir, 'workspace')}", '-c', diff --git a/evaluation/regression/run_tests.py b/evaluation/regression/run_tests.py index ed2429b029..1c0af98ffd 100644 --- a/evaluation/regression/run_tests.py +++ b/evaluation/regression/run_tests.py @@ -2,7 +2,7 @@ import argparse import pytest -from opendevin.config import load_app_config +from openhands.config import load_app_config config = load_app_config() diff --git a/evaluation/swe_bench/README.md b/evaluation/swe_bench/README.md index 5475590e43..ee0a901234 100644 --- a/evaluation/swe_bench/README.md +++ b/evaluation/swe_bench/README.md @@ -1,4 +1,4 @@ -# SWE-Bench Evaluation with OpenDevin SWE-Bench Docker Image +# SWE-Bench Evaluation with OpenHands SWE-Bench Docker Image This folder contains the evaluation harness that we built on top of the original [SWE-Bench benchmark](https://www.swebench.com/) ([paper](https://arxiv.org/abs/2310.06770)). @@ -6,7 +6,7 @@ This folder contains the evaluation harness that we built on top of the original The evaluation consists of three steps: -1. Environment setup: [install python environment](../README.md#development-environment), [configure LLM config](../README.md#configure-opendevin-and-your-llm), and [pull docker](#opendevin-swe-bench-instance-level-docker-support). +1. Environment setup: [install python environment](../README.md#development-environment), [configure LLM config](../README.md#configure-openhands-and-your-llm), and [pull docker](#openhands-swe-bench-instance-level-docker-support). 2. [Run inference](#run-inference-on-swe-bench-instances): Generate a edit patch for each Github issue 3. [Evaluate patches using SWE-Bench docker](#evaluate-generated-patches) @@ -14,9 +14,9 @@ The evaluation consists of three steps: Please follow instruction [here](../README.md#setup) to setup your local development environment and LLM. -## OpenDevin SWE-Bench Instance-level Docker Support +## OpenHands SWE-Bench Instance-level Docker Support -OpenDevin now support using the [official evaluation docker](https://github.com/princeton-nlp/SWE-bench/blob/main/docs/20240627_docker/README.md) for both **[inference](#run-inference-on-swe-bench-instances) and [evaluation](#evaluate-generated-patches)**. +OpenHands now support using the [official evaluation docker](https://github.com/princeton-nlp/SWE-bench/blob/main/docs/20240627_docker/README.md) for both **[inference](#run-inference-on-swe-bench-instances) and [evaluation](#evaluate-generated-patches)**. This is now the default behavior. ### Download Docker Images @@ -35,7 +35,7 @@ evaluation/swe_bench/scripts/docker/pull_all_eval_docker.sh env ## Run Inference on SWE-Bench Instances -Make sure your Docker daemon is running, and you have pulled the [instance-level docker image](#opendevin-swe-bench-instance-level-docker-support). +Make sure your Docker daemon is running, and you have pulled the [instance-level docker image](#openhands-swe-bench-instance-level-docker-support). ```bash ./evaluation/swe_bench/scripts/run_infer.sh [model_config] [git-version] [agent] [eval_limit] [max_iter] [num_workers] @@ -46,7 +46,7 @@ where `model_config` is mandatory, and the rest are optional. - `model_config`, e.g. `eval_gpt4_1106_preview`, is the config group name for your LLM settings, as defined in your `config.toml`. -- `git-version`, e.g. `HEAD`, is the git commit hash of the OpenDevin version you would +- `git-version`, e.g. `HEAD`, is the git commit hash of the OpenHands version you would like to evaluate. It could also be a release tag like `0.6.2`. - `agent`, e.g. `CodeActAgent`, is the name of the agent for benchmarks, defaulting to `CodeActAgent`. @@ -95,10 +95,10 @@ With `output.jsonl` file, you can run `eval_infer.sh` to evaluate generated patc > If you want to evaluate existing results, you should first run this to clone existing outputs >```bash ->git clone https://huggingface.co/spaces/OpenDevin/evaluation evaluation/evaluation_outputs +>git clone https://huggingface.co/spaces/OpenHands/evaluation evaluation/evaluation_outputs >``` -NOTE, you should have already pulled the instance-level OR env-level docker images following [this section](#opendevin-swe-bench-instance-level-docker-support). +NOTE, you should have already pulled the instance-level OR env-level docker images following [this section](#openhands-swe-bench-instance-level-docker-support). Then you can run the following: @@ -129,10 +129,10 @@ The final results will be saved to `evaluation/evaluation_outputs/outputs/swe_be ## Visualize Results -First you need to clone `https://huggingface.co/spaces/OpenDevin/evaluation` and add your own running results from opendevin into the `outputs` of the cloned repo. +First you need to clone `https://huggingface.co/spaces/OpenHands/evaluation` and add your own running results from openhands into the `outputs` of the cloned repo. ```bash -git clone https://huggingface.co/spaces/OpenDevin/evaluation +git clone https://huggingface.co/spaces/OpenHands/evaluation ``` **(optional) setup streamlit environment with conda**: @@ -149,11 +149,11 @@ Then, in a separate Python environment with `streamlit` library, you can run the ```bash # Make sure you are inside the cloned `evaluation` repo conda activate streamlit # if you follow the optional conda env setup above -streamlit run 0_📊_OpenDevin_Benchmark.py --server.port 8501 --server.address 0.0.0.0 +streamlit run 0_📊_OpenHands_Benchmark.py --server.port 8501 --server.address 0.0.0.0 ``` Then you can access the SWE-Bench trajectory visualizer at `localhost:8501`. ## Submit your evaluation results -You can start your own fork of [our huggingface evaluation outputs](https://huggingface.co/spaces/OpenDevin/evaluation) and submit a PR of your evaluation results following the guide [here](https://huggingface.co/docs/hub/en/repositories-pull-requests-discussions#pull-requests-and-discussions). +You can start your own fork of [our huggingface evaluation outputs](https://huggingface.co/spaces/OpenHands/evaluation) and submit a PR of your evaluation results following the guide [here](https://huggingface.co/docs/hub/en/repositories-pull-requests-discussions#pull-requests-and-discussions). diff --git a/evaluation/swe_bench/examples/example_model_output.json b/evaluation/swe_bench/examples/example_model_output.json index f2395c093f..e603884143 100644 --- a/evaluation/swe_bench/examples/example_model_output.json +++ b/evaluation/swe_bench/examples/example_model_output.json @@ -2,151 +2,151 @@ { "instance_id": "sphinx-doc__sphinx-8721", "model_patch": "diff --git a/sphinx/ext/viewcode.py b/sphinx/ext/viewcode.py\r\nindex a7d52a91c..e5f058693 100644\r\n--- a/sphinx/ext/viewcode.py\r\n+++ b/sphinx/ext/viewcode.py\r\n@@ -159,6 +159,10 @@ def get_module_filename(app: Sphinx, modname: str) -> Optional[str]:\r\n \r\n def should_generate_module_page(app: Sphinx, modname: str) -> bool:\r\n \"\"\"Check generation of module page is needed.\"\"\"\r\n+ # Do not generate module page if viewcode is disabled for epub\r\n+ if app.builder.name.startswith('epub') and not app.config.viewcode_enable_epub:\r\n+ return False\r\n+\r\n module_filename = get_module_filename(app, modname)\r\n if module_filename is None:\r\n # Always (re-)generate module page when module filename is not found.", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "django__django-15202", "model_patch": "diff --git a/django/core/validators.py b/django/core/validators.py\r\nindex 72fbe15551..14a9eafbab 100644\r\n--- a/django/core/validators.py\r\n+++ b/django/core/validators.py\r\n@@ -127,20 +127,15 @@ class URLValidator(RegexValidator):\r\n raise\r\n else:\r\n # Now verify IPv6 in the netloc part\r\n- host_match = re.search(r'^\\[(.+)\\](?::\\d{1,5})?$', urlsplit(value).netloc)\r\n- if host_match:\r\n- potential_ip = host_match[1]\r\n- try:\r\n+ try:\r\n+ host_match = re.search(r'^\\[(.+)\\](?::\\d{1,5})?$', urlsplit(value).netloc)\r\n+ if host_match:\r\n+ potential_ip = host_match[1]\r\n validate_ipv6_address(potential_ip)\r\n- except ValidationError:\r\n- raise ValidationError(self.message, code=self.code, params={'value': value})\r\n-\r\n- # The maximum length of a full host name is 253 characters per RFC 1034\r\n- # section 3.1. It's defined to be 255 bytes or less, but this includes\r\n- # one byte for the length of the name and one byte for the trailing dot\r\n- # that's used to indicate absolute names in DNS.\r\n- if len(urlsplit(value).hostname) > 253:\r\n- raise ValidationError(self.message, code=self.code, params={'value': value})\r\n+ except ValidationError:\r\n+ raise ValidationError(self.message, code=self.code, params={'value': value})\r\n+ except ValueError:\r\n+ raise ValidationError(self.message, code=self.code, params={'value': value})\r\n \r\n \r\n integer_validator = RegexValidator(\r\ndiff --git a/django/forms/fields.py b/django/forms/fields.py\r\nindex 65d6a9ec82..f02d6d6245 100644\r\n--- a/django/forms/fields.py\r\n+++ b/django/forms/fields.py\r\n@@ -687,10 +687,8 @@ class URLField(CharField):\r\n \"\"\"\r\n try:\r\n return list(urlsplit(url))\r\n- except ValueError:\r\n- # urlparse.urlsplit can raise a ValueError with some\r\n- # misformatted URLs.\r\n- raise ValidationError(self.error_messages['invalid'], code='invalid')\r\n+ except ValueError as e:\r\n+ raise ValidationError(self.error_messages['invalid'], code='invalid') from e\r\n \r\n value = super().to_python(value)\r\n if value:\r\ndiff --git a/tests/forms_tests/field_tests/test_urlfield.py b/tests/forms_tests/field_tests/test_urlfield.py\r\nindex 152456f216..90d4f15736 100644\r\n--- a/tests/forms_tests/field_tests/test_urlfield.py\r\n+++ b/tests/forms_tests/field_tests/test_urlfield.py\r\n@@ -129,3 +129,8 @@ class URLFieldTest(FormFieldAssertionsMixin, SimpleTestCase):\r\n msg = \"__init__() got multiple values for keyword argument 'strip'\"\r\n with self.assertRaisesMessage(TypeError, msg):\r\n URLField(strip=False)\r\n+\r\n+ def test_urlfield_clean_value_error(self):\r\n+ f = URLField()\r\n+ with self.assertRaises(ValidationError):\r\n+ f.clean('////]@N.AN')", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "django__django-14017", "model_patch": "diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py\r\nindex ffc3a7fda5..593a34f95a 100644\r\n--- a/django/db/models/expressions.py\r\n+++ b/django/db/models/expressions.py\r\n@@ -1151,10 +1151,10 @@ class Exists(Subquery):\r\n template = 'EXISTS(%(subquery)s)'\r\n output_field = fields.BooleanField()\r\n \r\n- def __init__(self, queryset, negated=False, **kwargs):\r\n- self.negated = negated\r\n- super().__init__(queryset, **kwargs)\r\n-\r\n+def __rand__(self, other):\r\n+ if not isinstance(other, Q):\r\n+ raise TypeError('Cannot combine a Q object with %s' % type(other))\r\n+ return other & self\r\n def __invert__(self):\r\n clone = self.copy()\r\n clone.negated = not self.negated", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "sympy__sympy-14774", "model_patch": "diff --git a/sympy/printing/latex.py b/sympy/printing/latex.py\r\nindex a3ead157c1..f3b7669e96 100644\r\n--- a/sympy/printing/latex.py\r\n+++ b/sympy/printing/latex.py\r\n@@ -740,7 +740,7 @@ def _print_Function(self, expr, exp=None):\r\n len(args) == 1 and \\\r\n not self._needs_function_brackets(expr.args[0])\r\n \r\n- inv_trig_table = [\"asin\", \"acos\", \"atan\", \"acot\"]\r\n+ inv_trig_table = [\"asin\", \"acos\", \"atan\", \"acsc\", \"asec\", \"acot\"]\r\n \r\n # If the function is an inverse trig function, handle the style\r\n if func in inv_trig_table:", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "scikit-learn__scikit-learn-10508", "model_patch": "diff --git a/sklearn/preprocessing/label.py b/sklearn/preprocessing/label.py\r\nindex 61b8d4a21..6f9c43807 100644\r\n--- a/sklearn/preprocessing/label.py\r\n+++ b/sklearn/preprocessing/label.py\r\n@@ -124,9 +124,14 @@ class LabelEncoder(BaseEstimator, TransformerMixin):\r\n -------\r\n y : array-like of shape [n_samples]\r\n \"\"\"\r\n- check_is_fitted(self, 'classes_')\r\n+ # Directly return an empty array with the expected dtype for empty input\r\n+ if len(y) == 0:\r\n+ return np.array([], dtype=' 0:\r\n- funcargspec = \"%s -- %s\" % (argname, bestrel)\r\n+ funcargspec = f\"{argname} -- scope: {scope} -- {bestrel}\"\r\n else:\r\n- funcargspec = argname\r\n+ funcargspec = f\"{argname} -- scope: {scope}\"\r\n tw.line(funcargspec, green=True)\r\n loc = getlocation(fixturedef.func, curdir)\r\n doc = fixturedef.func.__doc__ or \"\"", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "sympy__sympy-17022", "model_patch": "diff --git a/sympy/printing/lambdarepr.py b/sympy/printing/lambdarepr.py\r\nindex 8f60434e89..851530c286 100644\r\n--- a/sympy/printing/lambdarepr.py\r\n+++ b/sympy/printing/lambdarepr.py\r\n@@ -89,7 +89,12 @@ class NumExprPrinter(LambdaPrinter):\r\n 'contains' : 'contains',\r\n }\r\n \r\n- def _print_ImaginaryUnit(self, expr):\r\n+def _print_Identity(self, expr):\r\n+ from sympy import Integer\r\n+ if isinstance(expr.args[0], Integer):\r\n+ return f\"numpy.eye({expr.args[0]})\"\r\n+ else:\r\n+ raise ValueError(\"Identity matrix dimension must be an Integer\")\r\n return '1j'\r\n \r\n def _print_seq(self, seq, delimiter=', '):", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "django__django-11422", "model_patch": "diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py\r\nindex 7ca0d68fae..9e4a806c31 100644\r\n--- a/django/utils/autoreload.py\r\n+++ b/django/utils/autoreload.py\r\n@@ -114,14 +114,17 @@ def iter_modules_and_files(modules, extra_files):\r\n # During debugging (with PyDev) the 'typing.io' and 'typing.re' objects\r\n # are added to sys.modules, however they are types not modules and so\r\n # cause issues here.\r\n- if not isinstance(module, ModuleType) or getattr(module, '__spec__', None) is None:\r\n+ if not isinstance(module, ModuleType):\r\n continue\r\n- spec = module.__spec__\r\n- # Modules could be loaded from places without a concrete location. If\r\n- # this is the case, skip them.\r\n- if spec.has_location:\r\n- origin = spec.loader.archive if isinstance(spec.loader, zipimporter) else spec.origin\r\n- sys_file_paths.append(origin)\r\n+ if module.__name__ == '__main__':\r\n+ filename = getattr(module, '__file__', None)\r\n+ if filename:\r\n+ sys_file_paths.append(filename)\r\n+ elif getattr(module, '__spec__', None) is not None:\r\n+ spec = module.__spec__\r\n+ if spec.has_location:\r\n+ origin = spec.loader.archive if isinstance(spec.loader, zipimporter) else spec.origin\r\n+ sys_file_paths.append(origin)\r\n \r\n results = set()\r\n for filename in itertools.chain(sys_file_paths, extra_files):\r\ndiff --git a/tests/i18n/sampleproject/sampleproject/settings.py b/tests/i18n/sampleproject/sampleproject/settings.py\r\nindex e69de29bb2..d6cccb516b 100644\r\n--- a/tests/i18n/sampleproject/sampleproject/settings.py\r\n+++ b/tests/i18n/sampleproject/sampleproject/settings.py\r\n@@ -0,0 +1,34 @@\r\n+SECRET_KEY = 'fake-secret-key-for-testing'\r\n+DEBUG = True\r\n+ALLOWED_HOSTS = []\r\n+INSTALLED_APPS = [\r\n+ 'django.contrib.admin',\r\n+ 'django.contrib.auth',\r\n+ 'django.contrib.contenttypes',\r\n+ 'django.contrib.sessions',\r\n+ 'django.contrib.messages',\r\n+ 'django.contrib.staticfiles',\r\n+]\r\n+MIDDLEWARE = [\r\n+ 'django.middleware.security.SecurityMiddleware',\r\n+ 'django.contrib.sessions.middleware.SessionMiddleware',\r\n+ 'django.middleware.common.CommonMiddleware',\r\n+ 'django.middleware.csrf.CsrfViewMiddleware',\r\n+ 'django.contrib.auth.middleware.AuthenticationMiddleware',\r\n+ 'django.contrib.messages.middleware.MessageMiddleware',\r\n+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',\r\n+]\r\n+TEMPLATES = [\r\n+ {\r\n+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',\r\n+ 'APP_DIRS': True,\r\n+ 'OPTIONS': {\r\n+ 'context_processors': [\r\n+ 'django.template.context_processors.debug',\r\n+ 'django.template.context_processors.request',\r\n+ 'django.contrib.auth.context_processors.auth',\r\n+ 'django.contrib.messages.context_processors.messages',\r\n+ ],\r\n+ },\r\n+ },\r\n+]", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "sympy__sympy-20590", "model_patch": "diff --git a/sympy/core/_print_helpers.py b/sympy/core/_print_helpers.py\r\nindex 96d7e72676..b72e022e68 100644\r\n--- a/sympy/core/_print_helpers.py\r\n+++ b/sympy/core/_print_helpers.py\r\n@@ -6,6 +6,7 @@\r\n \"\"\"\r\n \r\n class Printable:\r\n+ __slots__ = ()\r\n \"\"\"\r\n The default implementation of printing for SymPy classes.", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "django__django-15996", "model_patch": "diff --git a/django/db/migrations/serializer.py b/django/db/migrations/serializer.py\r\nindex 38da1e6ecc..f59fd93415 100644\r\n--- a/django/db/migrations/serializer.py\r\n+++ b/django/db/migrations/serializer.py\r\n@@ -121,14 +121,31 @@ class DictionarySerializer(BaseSerializer):\r\n return \"{%s}\" % (\", \".join(\"%s: %s\" % (k, v) for k, v in strings)), imports\r\n \r\n \r\n+from django.utils.module_loading import import_string\r\n+\r\n+from django.utils.module_loading import import_string\r\n+\r\n class EnumSerializer(BaseSerializer):\r\n def serialize(self):\r\n enum_class = self.value.__class__\r\n module = enum_class.__module__\r\n- return (\r\n- \"%s.%s[%r]\" % (module, enum_class.__qualname__, self.value.name),\r\n- {\"import %s\" % module},\r\n- )\r\n+ enum_value = self.value\r\n+\r\n+ # Check if the value is a single enum member\r\n+ if isinstance(enum_value, enum.Enum):\r\n+ value = \"%s.%s['%s']\" % (module, enum_class.__qualname__, enum_value.name)\r\n+ else:\r\n+ # Decompose the value into individual flags\r\n+ enum_member = enum_class._decompose(enum_class, enum_value)\r\n+ if isinstance(enum_member, list):\r\n+ # Create an expression by ORing the individual flags\r\n+ member_names = [member.name for member in enum_member]\r\n+ value = ' | '.join([\"%s.%s['%s']\" % (module, enum_class.__qualname__, name) for name in member_names])\r\n+ else:\r\n+ # It's a single enum member after all\r\n+ value = \"%s.%s['%s']\" % (module, enum_class.__qualname__, enum_member.name)\r\n+\r\n+ return value, {\"import %s\" % module}\r\n \r\n \r\n class FloatSerializer(BaseSimpleSerializer):\r\ndiff --git a/tests/migrations/test_enum_serializer.py b/tests/migrations/test_enum_serializer.py\r\nnew file mode 100644\r\nindex 0000000000..02f4c2f554\r\n--- /dev/null\r\n+++ b/tests/migrations/test_enum_serializer.py\r\n@@ -0,0 +1,15 @@\r\n+import enum\r\n+from django.db.migrations.serializer import EnumSerializer\r\n+\r\n+class TestEnumSerializer:\r\n+ def test_enum_flag_combination_serialization(self):\r\n+ class RegexFlag(enum.IntFlag):\r\n+ IGNORECASE = enum.auto()\r\n+ UNICODE = enum.auto()\r\n+\r\n+ combined_flags = RegexFlag.IGNORECASE | RegexFlag.UNICODE\r\n+ serializer = EnumSerializer(combined_flags)\r\n+\r\n+ serialized_value, imports = serializer.serialize()\r\n+ assert serialized_value == \"tests.migrations.test_enum_serializer.RegexFlag.IGNORECASE | tests.migrations.test_enum_serializer.RegexFlag.UNICODE\"\r\n+ assert \"import tests.migrations.test_enum_serializer\" in imports", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "matplotlib__matplotlib-23476", "model_patch": "diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py\r\nindex c55864243a..a9526e5039 100644\r\n--- a/lib/matplotlib/figure.py\r\n+++ b/lib/matplotlib/figure.py\r\n@@ -2264,7 +2264,7 @@ class Figure(FigureBase):\r\n \r\n dpi : float, default: :rc:`figure.dpi`\r\n Dots per inch.\r\n-\r\n+self._original_dpi = dpi\r\n facecolor : default: :rc:`figure.facecolor`\r\n The figure patch facecolor.\r\n \r\n@@ -3014,7 +3014,7 @@ class Figure(FigureBase):\r\n \r\n def __getstate__(self):\r\n state = super().__getstate__()\r\n-\r\n+ state['dpi'] = self._original_dpi\r\n # The canvas cannot currently be pickled, but this has the benefit\r\n # of meaning that a figure can be detached from one canvas, and\r\n # re-attached to another.", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "django__django-15252", "model_patch": "diff --git a/django/db/migrations/recorder.py b/django/db/migrations/recorder.py\r\nindex 1a37c6b7d0..03a1a4879b 100644\r\n--- a/django/db/migrations/recorder.py\r\n+++ b/django/db/migrations/recorder.py\r\n@@ -56,18 +56,23 @@ class MigrationRecorder:\r\n tables = self.connection.introspection.table_names(cursor)\r\n return self.Migration._meta.db_table in tables\r\n \r\n- def ensure_schema(self):\r\n- \"\"\"Ensure the table exists and has the correct schema.\"\"\"\r\n- # If the table's there, that's fine - we've never changed its schema\r\n- # in the codebase.\r\n- if self.has_table():\r\n- return\r\n- # Make the table\r\n- try:\r\n- with self.connection.schema_editor() as editor:\r\n- editor.create_model(self.Migration)\r\n- except DatabaseError as exc:\r\n- raise MigrationSchemaMissing(\"Unable to create the django_migrations table (%s)\" % exc)\r\n+from django.db import models, DatabaseError, router\r\n+\r\n+def ensure_schema(self):\r\n+ \"\"\"Ensure the table exists and has the correct schema.\"\"\"\r\n+ # If the table's there, that's fine - we've never changed its schema\r\n+ # in the codebase.\r\n+ if self.has_table():\r\n+ return\r\n+ # Check if we're allowed to migrate\r\n+ if not router.allow_migrate(self.connection.alias, self.Migration):\r\n+ return\r\n+ # Make the table\r\n+ try:\r\n+ with self.connection.schema_editor() as editor:\r\n+ editor.create_model(self.Migration)\r\n+ except DatabaseError as exc:\r\n+ raise MigrationSchemaMissing(\"Unable to create the django_migrations table (%s)\" % exc)\r\n \r\n def applied_migrations(self):\r\n \"\"\"", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "sympy__sympy-11897", "model_patch": "", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "matplotlib__matplotlib-23987", "model_patch": "diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py\r\nindex 5bbb786984..5600a3fcb5 100644\r\n--- a/lib/matplotlib/figure.py\r\n+++ b/lib/matplotlib/figure.py\r\n@@ -1310,7 +1310,8 @@ default: %(va)s\r\n as a fraction of the average Axes height.\r\n \"\"\"\r\n if (self.get_layout_engine() is not None and\r\n- not self.get_layout_engine().adjust_compatible):\r\n+ not self.get_layout_engine().adjust_compatible and\r\n+ self.get_constrained_layout()):\r\n _api.warn_external(\r\n \"This figure was using a layout engine that is \"\r\n \"incompatible with subplots_adjust and/or tight_layout; \"", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "sympy__sympy-21171", "model_patch": "", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "django__django-11797", "model_patch": "diff --git a/django/db/models/lookups.py b/django/db/models/lookups.py\r\nindex 105dc93251..9b1355dd29 100644\r\n--- a/django/db/models/lookups.py\r\n+++ b/django/db/models/lookups.py\r\n@@ -261,16 +261,11 @@ class Exact(FieldGetDbPrepValueMixin, BuiltinLookup):\r\n def process_rhs(self, compiler, connection):\r\n from django.db.models.sql.query import Query\r\n if isinstance(self.rhs, Query):\r\n- if self.rhs.has_limit_one():\r\n+ # If the subquery is sliced or has a group by clause, do not alter it.\r\n+ if not (self.rhs.is_sliced or self.rhs.group_by):\r\n # The subquery must select only the pk.\r\n self.rhs.clear_select_clause()\r\n self.rhs.add_fields(['pk'])\r\n- else:\r\n- raise ValueError(\r\n- 'The QuerySet value for an exact lookup must be limited to '\r\n- 'one result using slicing.'\r\n- )\r\n- return super().process_rhs(compiler, connection)\r\n \r\n \r\n @Field.register_lookup\r\ndiff --git a/tests/auth_tests/test_group_by.py b/tests/auth_tests/test_group_by.py\r\nnew file mode 100644\r\nindex 0000000000..38f88cefe3\r\n--- /dev/null\r\n+++ b/tests/auth_tests/test_group_by.py\r\n@@ -0,0 +1,13 @@\r\n+from django.contrib.auth.models import User\r\n+from django.db.models import Max\r\n+from django.test import TestCase\r\n+\r\n+class GroupByTestCase(TestCase):\r\n+ def setUp(self):\r\n+ User.objects.create_user('user1', 'user1@example.com')\r\n+ User.objects.create_user('user2', 'user2@example.com')\r\n+\r\n+ def test_group_by_override(self):\r\n+ a = User.objects.filter(email__isnull=True).values('email').annotate(m=Max('id')).values('m')\r\n+ b = User.objects.filter(id=a[:1])\r\n+ self.assertIn('GROUP BY \"auth_user\".\"email\"', str(b.query))\r\ndiff --git a/tests/test_settings.py b/tests/test_settings.py\r\nnew file mode 100644\r\nindex 0000000000..942e75c86e\r\n--- /dev/null\r\n+++ b/tests/test_settings.py\r\n@@ -0,0 +1,42 @@\r\n+SECRET_KEY = 'fake-key-for-testing'\r\n+\r\n+INSTALLED_APPS = [\r\n+ 'django.contrib.auth',\r\n+ 'django.contrib.contenttypes',\r\n+ 'django.contrib.sessions',\r\n+ 'django.contrib.messages',\r\n+ 'django.contrib.admin',\r\n+]\r\n+\r\n+DATABASES = {\r\n+ 'default': {\r\n+ 'ENGINE': 'django.db.backends.sqlite3',\r\n+ 'NAME': ':memory:',\r\n+ }\r\n+}\r\n+\r\n+MIDDLEWARE = [\r\n+ 'django.middleware.security.SecurityMiddleware',\r\n+ 'django.contrib.sessions.middleware.SessionMiddleware',\r\n+ 'django.middleware.common.CommonMiddleware',\r\n+ 'django.middleware.csrf.CsrfViewMiddleware',\r\n+ 'django.contrib.auth.middleware.AuthenticationMiddleware',\r\n+ 'django.contrib.messages.middleware.MessageMiddleware',\r\n+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',\r\n+]\r\n+\r\n+\r\n+TEMPLATES = [\r\n+ {\r\n+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',\r\n+ 'APP_DIRS': True,\r\n+ 'OPTIONS': {\r\n+ 'context_processors': [\r\n+ 'django.template.context_processors.debug',\r\n+ 'django.template.context_processors.request',\r\n+ 'django.contrib.auth.context_processors.auth',\r\n+ 'django.contrib.messages.context_processors.messages',\r\n+ ],\r\n+ },\r\n+ },\r\n+]", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "scikit-learn__scikit-learn-13142", "model_patch": "diff --git a/sklearn/mixture/base.py b/sklearn/mixture/base.py\r\nindex bd34333c0..4ed41389c 100644\r\n--- a/sklearn/mixture/base.py\r\n+++ b/sklearn/mixture/base.py\r\n@@ -369,9 +369,9 @@ class BaseMixture(DensityMixin, BaseEstimator, metaclass=ABCMeta):\r\n labels : array, shape (n_samples,)\r\n Component labels.\r\n \"\"\"\r\n- self._check_is_fitted()\r\n- X = _check_X(X, None, self.means_.shape[1])\r\n- return self._estimate_weighted_log_prob(X).argmax(axis=1)\r\n+ # Perform an expectation step to ensure the most up-to-date parameters are used\r\n+ _, log_resp = self._e_step(X)\r\n+ return log_resp.argmax(axis=1)\r\n \r\n def predict_proba(self, X):\r\n \"\"\"Predict posterior probability of each component given the data.", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "matplotlib__matplotlib-18869", "model_patch": "", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "django__django-11583", "model_patch": "diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py\r\nindex 25c3b44250..3636ca7a4a 100644\r\n--- a/django/utils/autoreload.py\r\n+++ b/django/utils/autoreload.py\r\n@@ -139,6 +139,9 @@ def iter_modules_and_files(modules, extra_files):\r\n path = Path(filename)\r\n try:\r\n resolved_path = path.resolve(strict=True).absolute()\r\n+ except ValueError:\r\n+ # If a ValueError is encountered, skip this path and continue.\r\n+ continue\r\n except FileNotFoundError:\r\n # The module could have been removed, don't fail loudly if this\r\n # is the case.", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "matplotlib__matplotlib-25311", "model_patch": "diff --git a/draggable_legend_patch.diff b/draggable_legend_patch.diff\r\nnew file mode 100644\r\nindex 0000000000..f2e13c267c\r\n--- /dev/null\r\n+++ b/draggable_legend_patch.diff\r\n@@ -0,0 +1,22 @@\r\n+--- a/lib/matplotlib/legend.py\r\n++++ b/lib/matplotlib/legend.py\r\n+@@ -96,6 +96,21 @@\r\n+ self.legend.set_bbox_to_anchor(loc_in_bbox)\r\n+ \r\n++ def disable_draggable(self):\r\n++ \"\"\"\r\n++ Disable the draggable feature of the legend to allow pickling.\r\n++ \"\"\"\r\n++ if hasattr(self, '_draggable'):\r\n++ self._draggable.disconnect_events()\r\n++ self._draggable = None\r\n++\r\n++ def enable_draggable(self, use_blit=False, update='loc'):\r\n++ \"\"\"\r\n++ Re-enable the draggable feature of the legend after pickling.\r\n++ \"\"\"\r\n++ self.set_draggable(True, use_blit=use_blit, update=update)\r\n++\r\n++\r\n+ _legend_kw_doc_base = \"\"\"\r\n+ bbox_to_anchor : `.BboxBase`, 2-tuple, or 4-tuple of floats\r\ndiff --git a/lib/matplotlib/legend.py.orig b/lib/matplotlib/legend.py.orig\r\nnew file mode 100644\r\nindex 0000000000..ff6abdb958\r\n--- /dev/null\r\n+++ b/lib/matplotlib/legend.py.orig\r\n@@ -0,0 +1,1355 @@\r\n+\"\"\"\r\n+The legend module defines the Legend class, which is responsible for\r\n+drawing legends associated with axes and/or figures.\r\n+\r\n+.. important::\r\n+\r\n+ It is unlikely that you would ever create a Legend instance manually.\r\n+ Most users would normally create a legend via the `~.Axes.legend`\r\n+ function. For more details on legends there is also a :doc:`legend guide\r\n+ `.\r\n+\r\n+The `Legend` class is a container of legend handles and legend texts.\r\n+\r\n+The legend handler map specifies how to create legend handles from artists\r\n+(lines, patches, etc.) in the axes or figures. Default legend handlers are\r\n+defined in the :mod:`~matplotlib.legend_handler` module. While not all artist\r\n+types are covered by the default legend handlers, custom legend handlers can be\r\n+defined to support arbitrary objects.\r\n+\r\n+See the :doc:`legend guide ` for more\r\n+information.\r\n+\"\"\"\r\n+\r\n+import itertools\r\n+import logging\r\n+import time\r\n+\r\n+import numpy as np\r\n+\r\n+import matplotlib as mpl\r\n+from matplotlib import _api, _docstring, colors, offsetbox\r\n+from matplotlib.artist import Artist, allow_rasterization\r\n+from matplotlib.cbook import silent_list\r\n+from matplotlib.font_manager import FontProperties\r\n+from matplotlib.lines import Line2D\r\n+from matplotlib.patches import (Patch, Rectangle, Shadow, FancyBboxPatch,\r\n+ StepPatch)\r\n+from matplotlib.collections import (\r\n+ Collection, CircleCollection, LineCollection, PathCollection,\r\n+ PolyCollection, RegularPolyCollection)\r\n+from matplotlib.text import Text\r\n+from matplotlib.transforms import Bbox, BboxBase, TransformedBbox\r\n+from matplotlib.transforms import BboxTransformTo, BboxTransformFrom\r\n+from matplotlib.offsetbox import (\r\n+ AnchoredOffsetbox, DraggableOffsetBox,\r\n+ HPacker, VPacker,\r\n+ DrawingArea, TextArea,\r\n+)\r\n+from matplotlib.container import ErrorbarContainer, BarContainer, StemContainer\r\n+from . import legend_handler\r\n+\r\n+\r\n+class DraggableLegend(DraggableOffsetBox):\r\n+ def __init__(self, legend, use_blit=False, update=\"loc\"):\r\n+ \"\"\"\r\n+ Wrapper around a `.Legend` to support mouse dragging.\r\n+\r\n+ Parameters\r\n+ ----------\r\n+ legend : `.Legend`\r\n+ The `.Legend` instance to wrap.\r\n+ use_blit : bool, optional\r\n+ Use blitting for faster image composition. For details see\r\n+ :ref:`func-animation`.\r\n+ update : {'loc', 'bbox'}, optional\r\n+ If \"loc\", update the *loc* parameter of the legend upon finalizing.\r\n+ If \"bbox\", update the *bbox_to_anchor* parameter.\r\n+ \"\"\"\r\n+ self.legend = legend\r\n+\r\n+ _api.check_in_list([\"loc\", \"bbox\"], update=update)\r\n+ self._update = update\r\n+\r\n+ super().__init__(legend, legend._legend_box, use_blit=use_blit)\r\n+\r\n+ def finalize_offset(self):\r\n+ if self._update == \"loc\":\r\n+ self._update_loc(self.get_loc_in_canvas())\r\n+ elif self._update == \"bbox\":\r\n+ self._bbox_to_anchor(self.get_loc_in_canvas())\r\n+\r\n+ def _update_loc(self, loc_in_canvas):\r\n+ bbox = self.legend.get_bbox_to_anchor()\r\n+ # if bbox has zero width or height, the transformation is\r\n+ # ill-defined. Fall back to the default bbox_to_anchor.\r\n+ if bbox.width == 0 or bbox.height == 0:\r\n+ self.legend.set_bbox_to_anchor(None)\r\n+ bbox = self.legend.get_bbox_to_anchor()\r\n+ _bbox_transform = BboxTransformFrom(bbox)\r\n+ self.legend._loc = tuple(_bbox_transform.transform(loc_in_canvas))\r\n+\r\n+ def _update_bbox_to_anchor(self, loc_in_canvas):\r\n+ loc_in_bbox = self.legend.axes.transAxes.transform(loc_in_canvas)\r\n+ self.legend.set_bbox_to_anchor(loc_in_bbox)\r\n+\r\n+\r\n+_legend_kw_doc_base = \"\"\"\r\n+bbox_to_anchor : `.BboxBase`, 2-tuple, or 4-tuple of floats\r\n+ Box that is used to position the legend in conjunction with *loc*.\r\n+ Defaults to `axes.bbox` (if called as a method to `.Axes.legend`) or\r\n+ `figure.bbox` (if `.Figure.legend`). This argument allows arbitrary\r\n+ placement of the legend.\r\n+\r\n+ Bbox coordinates are interpreted in the coordinate system given by\r\n+ *bbox_transform*, with the default transform\r\n+ Axes or Figure coordinates, depending on which ``legend`` is called.\r\n+\r\n+ If a 4-tuple or `.BboxBase` is given, then it specifies the bbox\r\n+ ``(x, y, width, height)`` that the legend is placed in.\r\n+ To put the legend in the best location in the bottom right\r\n+ quadrant of the axes (or figure)::\r\n+\r\n+ loc='best', bbox_to_anchor=(0.5, 0., 0.5, 0.5)\r\n+\r\n+ A 2-tuple ``(x, y)`` places the corner of the legend specified by *loc* at\r\n+ x, y. For example, to put the legend's upper right-hand corner in the\r\n+ center of the axes (or figure) the following keywords can be used::\r\n+\r\n+ loc='upper right', bbox_to_anchor=(0.5, 0.5)\r\n+\r\n+ncols : int, default: 1\r\n+ The number of columns that the legend has.\r\n+\r\n+ For backward compatibility, the spelling *ncol* is also supported\r\n+ but it is discouraged. If both are given, *ncols* takes precedence.\r\n+\r\n+prop : None or `matplotlib.font_manager.FontProperties` or dict\r\n+ The font properties of the legend. If None (default), the current\r\n+ :data:`matplotlib.rcParams` will be used.\r\n+\r\n+fontsize : int or {'xx-small', 'x-small', 'small', 'medium', 'large', \\\r\n+'x-large', 'xx-large'}\r\n+ The font size of the legend. If the value is numeric the size will be the\r\n+ absolute font size in points. String values are relative to the current\r\n+ default font size. This argument is only used if *prop* is not specified.\r\n+\r\n+labelcolor : str or list, default: :rc:`legend.labelcolor`\r\n+ The color of the text in the legend. Either a valid color string\r\n+ (for example, 'red'), or a list of color strings. The labelcolor can\r\n+ also be made to match the color of the line or marker using 'linecolor',\r\n+ 'markerfacecolor' (or 'mfc'), or 'markeredgecolor' (or 'mec').\r\n+\r\n+ Labelcolor can be set globally using :rc:`legend.labelcolor`. If None,\r\n+ use :rc:`text.color`.\r\n+\r\n+numpoints : int, default: :rc:`legend.numpoints`\r\n+ The number of marker points in the legend when creating a legend\r\n+ entry for a `.Line2D` (line).\r\n+\r\n+scatterpoints : int, default: :rc:`legend.scatterpoints`\r\n+ The number of marker points in the legend when creating\r\n+ a legend entry for a `.PathCollection` (scatter plot).\r\n+\r\n+scatteryoffsets : iterable of floats, default: ``[0.375, 0.5, 0.3125]``\r\n+ The vertical offset (relative to the font size) for the markers\r\n+ created for a scatter plot legend entry. 0.0 is at the base the\r\n+ legend text, and 1.0 is at the top. To draw all markers at the\r\n+ same height, set to ``[0.5]``.\r\n+\r\n+markerscale : float, default: :rc:`legend.markerscale`\r\n+ The relative size of legend markers compared with the originally\r\n+ drawn ones.\r\n+\r\n+markerfirst : bool, default: True\r\n+ If *True*, legend marker is placed to the left of the legend label.\r\n+ If *False*, legend marker is placed to the right of the legend label.\r\n+\r\n+reverse : bool, default: False\r\n+ If *True*, the legend labels are displayed in reverse order from the input.\r\n+ If *False*, the legend labels are displayed in the same order as the input.\r\n+\r\n+ .. versionadded:: 3.7\r\n+\r\n+frameon : bool, default: :rc:`legend.frameon`\r\n+ Whether the legend should be drawn on a patch (frame).\r\n+\r\n+fancybox : bool, default: :rc:`legend.fancybox`\r\n+ Whether round edges should be enabled around the `.FancyBboxPatch` which\r\n+ makes up the legend's background.\r\n+\r\n+shadow : bool, default: :rc:`legend.shadow`\r\n+ Whether to draw a shadow behind the legend.\r\n+\r\n+framealpha : float, default: :rc:`legend.framealpha`\r\n+ The alpha transparency of the legend's background.\r\n+ If *shadow* is activated and *framealpha* is ``None``, the default value is\r\n+ ignored.\r\n+\r\n+facecolor : \"inherit\" or color, default: :rc:`legend.facecolor`\r\n+ The legend's background color.\r\n+ If ``\"inherit\"``, use :rc:`axes.facecolor`.\r\n+\r\n+edgecolor : \"inherit\" or color, default: :rc:`legend.edgecolor`\r\n+ The legend's background patch edge color.\r\n+ If ``\"inherit\"``, use take :rc:`axes.edgecolor`.\r\n+\r\n+mode : {\"expand\", None}\r\n+ If *mode* is set to ``\"expand\"`` the legend will be horizontally\r\n+ expanded to fill the axes area (or *bbox_to_anchor* if defines\r\n+ the legend's size).\r\n+\r\n+bbox_transform : None or `matplotlib.transforms.Transform`\r\n+ The transform for the bounding box (*bbox_to_anchor*). For a value\r\n+ of ``None`` (default) the Axes'\r\n+ :data:`~matplotlib.axes.Axes.transAxes` transform will be used.\r\n+\r\n+title : str or None\r\n+ The legend's title. Default is no title (``None``).\r\n+\r\n+title_fontproperties : None or `matplotlib.font_manager.FontProperties` or dict\r\n+ The font properties of the legend's title. If None (default), the\r\n+ *title_fontsize* argument will be used if present; if *title_fontsize* is\r\n+ also None, the current :rc:`legend.title_fontsize` will be used.\r\n+\r\n+title_fontsize : int or {'xx-small', 'x-small', 'small', 'medium', 'large', \\\r\n+'x-large', 'xx-large'}, default: :rc:`legend.title_fontsize`\r\n+ The font size of the legend's title.\r\n+ Note: This cannot be combined with *title_fontproperties*. If you want\r\n+ to set the fontsize alongside other font properties, use the *size*\r\n+ parameter in *title_fontproperties*.\r\n+\r\n+alignment : {'center', 'left', 'right'}, default: 'center'\r\n+ The alignment of the legend title and the box of entries. The entries\r\n+ are aligned as a single block, so that markers always lined up.\r\n+\r\n+borderpad : float, default: :rc:`legend.borderpad`\r\n+ The fractional whitespace inside the legend border, in font-size units.\r\n+\r\n+labelspacing : float, default: :rc:`legend.labelspacing`\r\n+ The vertical space between the legend entries, in font-size units.\r\n+\r\n+handlelength : float, default: :rc:`legend.handlelength`\r\n+ The length of the legend handles, in font-size units.\r\n+\r\n+handleheight : float, default: :rc:`legend.handleheight`\r\n+ The height of the legend handles, in font-size units.\r\n+\r\n+handletextpad : float, default: :rc:`legend.handletextpad`\r\n+ The pad between the legend handle and text, in font-size units.\r\n+\r\n+borderaxespad : float, default: :rc:`legend.borderaxespad`\r\n+ The pad between the axes and legend border, in font-size units.\r\n+\r\n+columnspacing : float, default: :rc:`legend.columnspacing`\r\n+ The spacing between columns, in font-size units.\r\n+\r\n+handler_map : dict or None\r\n+ The custom dictionary mapping instances or types to a legend\r\n+ handler. This *handler_map* updates the default handler map\r\n+ found at `matplotlib.legend.Legend.get_legend_handler_map`.\r\n+\r\n+draggable : bool, default: False\r\n+ Whether the legend can be dragged with the mouse.\r\n+\"\"\"\r\n+\r\n+_loc_doc_base = \"\"\"\r\n+loc : str or pair of floats, {0}\r\n+ The location of the legend.\r\n+\r\n+ The strings\r\n+ ``'upper left', 'upper right', 'lower left', 'lower right'``\r\n+ place the legend at the corresponding corner of the axes/figure.\r\n+\r\n+ The strings\r\n+ ``'upper center', 'lower center', 'center left', 'center right'``\r\n+ place the legend at the center of the corresponding edge of the\r\n+ axes/figure.\r\n+\r\n+ The string ``'center'`` places the legend at the center of the axes/figure.\r\n+\r\n+ The string ``'best'`` places the legend at the location, among the nine\r\n+ locations defined so far, with the minimum overlap with other drawn\r\n+ artists. This option can be quite slow for plots with large amounts of\r\n+ data; your plotting speed may benefit from providing a specific location.\r\n+\r\n+ The location can also be a 2-tuple giving the coordinates of the lower-left\r\n+ corner of the legend in axes coordinates (in which case *bbox_to_anchor*\r\n+ will be ignored).\r\n+\r\n+ For back-compatibility, ``'center right'`` (but no other location) can also\r\n+ be spelled ``'right'``, and each \"string\" locations can also be given as a\r\n+ numeric value:\r\n+\r\n+ =============== =============\r\n+ Location String Location Code\r\n+ =============== =============\r\n+ 'best' 0\r\n+ 'upper right' 1\r\n+ 'upper left' 2\r\n+ 'lower left' 3\r\n+ 'lower right' 4\r\n+ 'right' 5\r\n+ 'center left' 6\r\n+ 'center right' 7\r\n+ 'lower center' 8\r\n+ 'upper center' 9\r\n+ 'center' 10\r\n+ =============== =============\r\n+ {1}\"\"\"\r\n+\r\n+_legend_kw_axes_st = (_loc_doc_base.format(\"default: :rc:`legend.loc`\", '') +\r\n+ _legend_kw_doc_base)\r\n+_docstring.interpd.update(_legend_kw_axes=_legend_kw_axes_st)\r\n+\r\n+_outside_doc = \"\"\"\r\n+ If a figure is using the constrained layout manager, the string codes\r\n+ of the *loc* keyword argument can get better layout behaviour using the\r\n+ prefix 'outside'. There is ambiguity at the corners, so 'outside\r\n+ upper right' will make space for the legend above the rest of the\r\n+ axes in the layout, and 'outside right upper' will make space on the\r\n+ right side of the layout. In addition to the values of *loc*\r\n+ listed above, we have 'outside right upper', 'outside right lower',\r\n+ 'outside left upper', and 'outside left lower'. See\r\n+ :doc:`/tutorials/intermediate/legend_guide` for more details.\r\n+\"\"\"\r\n+\r\n+_legend_kw_figure_st = (_loc_doc_base.format(\"default: 'upper right'\",\r\n+ _outside_doc) +\r\n+ _legend_kw_doc_base)\r\n+_docstring.interpd.update(_legend_kw_figure=_legend_kw_figure_st)\r\n+\r\n+_legend_kw_both_st = (\r\n+ _loc_doc_base.format(\"default: 'best' for axes, 'upper right' for figures\",\r\n+ _outside_doc) +\r\n+ _legend_kw_doc_base)\r\n+_docstring.interpd.update(_legend_kw_doc=_legend_kw_both_st)\r\n+\r\n+\r\n+class Legend(Artist):\r\n+ \"\"\"\r\n+ Place a legend on the axes at location loc.\r\n+ \"\"\"\r\n+\r\n+ # 'best' is only implemented for axes legends\r\n+ codes = {'best': 0, **AnchoredOffsetbox.codes}\r\n+ zorder = 5\r\n+\r\n+ def __str__(self):\r\n+ return \"Legend\"\r\n+\r\n+ @_api.make_keyword_only(\"3.6\", \"loc\")\r\n+ @_docstring.dedent_interpd\r\n+ def __init__(\r\n+ self, parent, handles, labels,\r\n+ loc=None,\r\n+ numpoints=None, # number of points in the legend line\r\n+ markerscale=None, # relative size of legend markers vs. original\r\n+ markerfirst=True, # left/right ordering of legend marker and label\r\n+ reverse=False, # reverse ordering of legend marker and label\r\n+ scatterpoints=None, # number of scatter points\r\n+ scatteryoffsets=None,\r\n+ prop=None, # properties for the legend texts\r\n+ fontsize=None, # keyword to set font size directly\r\n+ labelcolor=None, # keyword to set the text color\r\n+\r\n+ # spacing & pad defined as a fraction of the font-size\r\n+ borderpad=None, # whitespace inside the legend border\r\n+ labelspacing=None, # vertical space between the legend entries\r\n+ handlelength=None, # length of the legend handles\r\n+ handleheight=None, # height of the legend handles\r\n+ handletextpad=None, # pad between the legend handle and text\r\n+ borderaxespad=None, # pad between the axes and legend border\r\n+ columnspacing=None, # spacing between columns\r\n+\r\n+ ncols=1, # number of columns\r\n+ mode=None, # horizontal distribution of columns: None or \"expand\"\r\n+\r\n+ fancybox=None, # True: fancy box, False: rounded box, None: rcParam\r\n+ shadow=None,\r\n+ title=None, # legend title\r\n+ title_fontsize=None, # legend title font size\r\n+ framealpha=None, # set frame alpha\r\n+ edgecolor=None, # frame patch edgecolor\r\n+ facecolor=None, # frame patch facecolor\r\n+\r\n+ bbox_to_anchor=None, # bbox to which the legend will be anchored\r\n+ bbox_transform=None, # transform for the bbox\r\n+ frameon=None, # draw frame\r\n+ handler_map=None,\r\n+ title_fontproperties=None, # properties for the legend title\r\n+ alignment=\"center\", # control the alignment within the legend box\r\n+ *,\r\n+ ncol=1, # synonym for ncols (backward compatibility)\r\n+ draggable=False # whether the legend can be dragged with the mouse\r\n+ ):\r\n+ \"\"\"\r\n+ Parameters\r\n+ ----------\r\n+ parent : `~matplotlib.axes.Axes` or `.Figure`\r\n+ The artist that contains the legend.\r\n+\r\n+ handles : list of `.Artist`\r\n+ A list of Artists (lines, patches) to be added to the legend.\r\n+\r\n+ labels : list of str\r\n+ A list of labels to show next to the artists. The length of handles\r\n+ and labels should be the same. If they are not, they are truncated\r\n+ to the length of the shorter list.\r\n+\r\n+ Other Parameters\r\n+ ----------------\r\n+ %(_legend_kw_doc)s\r\n+\r\n+ Attributes\r\n+ ----------\r\n+ legend_handles\r\n+ List of `.Artist` objects added as legend entries.\r\n+\r\n+ .. versionadded:: 3.7\r\n+\r\n+ Notes\r\n+ -----\r\n+ Users can specify any arbitrary location for the legend using the\r\n+ *bbox_to_anchor* keyword argument. *bbox_to_anchor* can be a\r\n+ `.BboxBase` (or derived there from) or a tuple of 2 or 4 floats.\r\n+ See `set_bbox_to_anchor` for more detail.\r\n+\r\n+ The legend location can be specified by setting *loc* with a tuple of\r\n+ 2 floats, which is interpreted as the lower-left corner of the legend\r\n+ in the normalized axes coordinate.\r\n+ \"\"\"\r\n+ # local import only to avoid circularity\r\n+ from matplotlib.axes import Axes\r\n+ from matplotlib.figure import FigureBase\r\n+\r\n+ super().__init__()\r\n+\r\n+ if prop is None:\r\n+ if fontsize is not None:\r\n+ self.prop = FontProperties(size=fontsize)\r\n+ else:\r\n+ self.prop = FontProperties(\r\n+ size=mpl.rcParams[\"legend.fontsize\"])\r\n+ else:\r\n+ self.prop = FontProperties._from_any(prop)\r\n+ if isinstance(prop, dict) and \"size\" not in prop:\r\n+ self.prop.set_size(mpl.rcParams[\"legend.fontsize\"])\r\n+\r\n+ self._fontsize = self.prop.get_size_in_points()\r\n+\r\n+ self.texts = []\r\n+ self.legend_handles = []\r\n+ self._legend_title_box = None\r\n+\r\n+ #: A dictionary with the extra handler mappings for this Legend\r\n+ #: instance.\r\n+ self._custom_handler_map = handler_map\r\n+\r\n+ def val_or_rc(val, rc_name):\r\n+ return val if val is not None else mpl.rcParams[rc_name]\r\n+\r\n+ self.numpoints = val_or_rc(numpoints, 'legend.numpoints')\r\n+ self.markerscale = val_or_rc(markerscale, 'legend.markerscale')\r\n+ self.scatterpoints = val_or_rc(scatterpoints, 'legend.scatterpoints')\r\n+ self.borderpad = val_or_rc(borderpad, 'legend.borderpad')\r\n+ self.labelspacing = val_or_rc(labelspacing, 'legend.labelspacing')\r\n+ self.handlelength = val_or_rc(handlelength, 'legend.handlelength')\r\n+ self.handleheight = val_or_rc(handleheight, 'legend.handleheight')\r\n+ self.handletextpad = val_or_rc(handletextpad, 'legend.handletextpad')\r\n+ self.borderaxespad = val_or_rc(borderaxespad, 'legend.borderaxespad')\r\n+ self.columnspacing = val_or_rc(columnspacing, 'legend.columnspacing')\r\n+ self.shadow = val_or_rc(shadow, 'legend.shadow')\r\n+ # trim handles and labels if illegal label...\r\n+ _lab, _hand = [], []\r\n+ for label, handle in zip(labels, handles):\r\n+ if isinstance(label, str) and label.startswith('_'):\r\n+ _api.warn_external(f\"The label {label!r} of {handle!r} starts \"\r\n+ \"with '_'. It is thus excluded from the \"\r\n+ \"legend.\")\r\n+ else:\r\n+ _lab.append(label)\r\n+ _hand.append(handle)\r\n+ labels, handles = _lab, _hand\r\n+\r\n+ if reverse:\r\n+ labels.reverse()\r\n+ handles.reverse()\r\n+\r\n+ if len(handles) < 2:\r\n+ ncols = 1\r\n+ self._ncols = ncols if ncols != 1 else ncol\r\n+\r\n+ if self.numpoints <= 0:\r\n+ raise ValueError(\"numpoints must be > 0; it was %d\" % numpoints)\r\n+\r\n+ # introduce y-offset for handles of the scatter plot\r\n+ if scatteryoffsets is None:\r\n+ self._scatteryoffsets = np.array([3. / 8., 4. / 8., 2.5 / 8.])\r\n+ else:\r\n+ self._scatteryoffsets = np.asarray(scatteryoffsets)\r\n+ reps = self.scatterpoints // len(self._scatteryoffsets) + 1\r\n+ self._scatteryoffsets = np.tile(self._scatteryoffsets,\r\n+ reps)[:self.scatterpoints]\r\n+\r\n+ # _legend_box is a VPacker instance that contains all\r\n+ # legend items and will be initialized from _init_legend_box()\r\n+ # method.\r\n+ self._legend_box = None\r\n+\r\n+ if isinstance(parent, Axes):\r\n+ self.isaxes = True\r\n+ self.axes = parent\r\n+ self.set_figure(parent.figure)\r\n+ elif isinstance(parent, FigureBase):\r\n+ self.isaxes = False\r\n+ self.set_figure(parent)\r\n+ else:\r\n+ raise TypeError(\r\n+ \"Legend needs either Axes or FigureBase as parent\"\r\n+ )\r\n+ self.parent = parent\r\n+\r\n+ loc0 = loc\r\n+ self._loc_used_default = loc is None\r\n+ if loc is None:\r\n+ loc = mpl.rcParams[\"legend.loc\"]\r\n+ if not self.isaxes and loc in [0, 'best']:\r\n+ loc = 'upper right'\r\n+\r\n+ # handle outside legends:\r\n+ self._outside_loc = None\r\n+ if isinstance(loc, str):\r\n+ if loc.split()[0] == 'outside':\r\n+ # strip outside:\r\n+ loc = loc.split('outside ')[1]\r\n+ # strip \"center\" at the beginning\r\n+ self._outside_loc = loc.replace('center ', '')\r\n+ # strip first\r\n+ self._outside_loc = self._outside_loc.split()[0]\r\n+ locs = loc.split()\r\n+ if len(locs) > 1 and locs[0] in ('right', 'left'):\r\n+ # locs doesn't accept \"left upper\", etc, so swap\r\n+ if locs[0] != 'center':\r\n+ locs = locs[::-1]\r\n+ loc = locs[0] + ' ' + locs[1]\r\n+ # check that loc is in acceptable strings\r\n+ loc = _api.check_getitem(self.codes, loc=loc)\r\n+\r\n+ if self.isaxes and self._outside_loc:\r\n+ raise ValueError(\r\n+ f\"'outside' option for loc='{loc0}' keyword argument only \"\r\n+ \"works for figure legends\")\r\n+\r\n+ if not self.isaxes and loc == 0:\r\n+ raise ValueError(\r\n+ \"Automatic legend placement (loc='best') not implemented for \"\r\n+ \"figure legend\")\r\n+\r\n+ self._mode = mode\r\n+ self.set_bbox_to_anchor(bbox_to_anchor, bbox_transform)\r\n+\r\n+ # We use FancyBboxPatch to draw a legend frame. The location\r\n+ # and size of the box will be updated during the drawing time.\r\n+\r\n+ if facecolor is None:\r\n+ facecolor = mpl.rcParams[\"legend.facecolor\"]\r\n+ if facecolor == 'inherit':\r\n+ facecolor = mpl.rcParams[\"axes.facecolor\"]\r\n+\r\n+ if edgecolor is None:\r\n+ edgecolor = mpl.rcParams[\"legend.edgecolor\"]\r\n+ if edgecolor == 'inherit':\r\n+ edgecolor = mpl.rcParams[\"axes.edgecolor\"]\r\n+\r\n+ if fancybox is None:\r\n+ fancybox = mpl.rcParams[\"legend.fancybox\"]\r\n+\r\n+ self.legendPatch = FancyBboxPatch(\r\n+ xy=(0, 0), width=1, height=1,\r\n+ facecolor=facecolor, edgecolor=edgecolor,\r\n+ # If shadow is used, default to alpha=1 (#8943).\r\n+ alpha=(framealpha if framealpha is not None\r\n+ else 1 if shadow\r\n+ else mpl.rcParams[\"legend.framealpha\"]),\r\n+ # The width and height of the legendPatch will be set (in draw())\r\n+ # to the length that includes the padding. Thus we set pad=0 here.\r\n+ boxstyle=(\"round,pad=0,rounding_size=0.2\" if fancybox\r\n+ else \"square,pad=0\"),\r\n+ mutation_scale=self._fontsize,\r\n+ snap=True,\r\n+ visible=(frameon if frameon is not None\r\n+ else mpl.rcParams[\"legend.frameon\"])\r\n+ )\r\n+ self._set_artist_props(self.legendPatch)\r\n+\r\n+ _api.check_in_list([\"center\", \"left\", \"right\"], alignment=alignment)\r\n+ self._alignment = alignment\r\n+\r\n+ # init with null renderer\r\n+ self._init_legend_box(handles, labels, markerfirst)\r\n+\r\n+ tmp = self._loc_used_default\r\n+ self._set_loc(loc)\r\n+ self._loc_used_default = tmp # ignore changes done by _set_loc\r\n+\r\n+ # figure out title font properties:\r\n+ if title_fontsize is not None and title_fontproperties is not None:\r\n+ raise ValueError(\r\n+ \"title_fontsize and title_fontproperties can't be specified \"\r\n+ \"at the same time. Only use one of them. \")\r\n+ title_prop_fp = FontProperties._from_any(title_fontproperties)\r\n+ if isinstance(title_fontproperties, dict):\r\n+ if \"size\" not in title_fontproperties:\r\n+ title_fontsize = mpl.rcParams[\"legend.title_fontsize\"]\r\n+ title_prop_fp.set_size(title_fontsize)\r\n+ elif title_fontsize is not None:\r\n+ title_prop_fp.set_size(title_fontsize)\r\n+ elif not isinstance(title_fontproperties, FontProperties):\r\n+ title_fontsize = mpl.rcParams[\"legend.title_fontsize\"]\r\n+ title_prop_fp.set_size(title_fontsize)\r\n+\r\n+ self.set_title(title, prop=title_prop_fp)\r\n+\r\n+ self._draggable = None\r\n+ self.set_draggable(state=draggable)\r\n+\r\n+ # set the text color\r\n+\r\n+ color_getters = { # getter function depends on line or patch\r\n+ 'linecolor': ['get_color', 'get_facecolor'],\r\n+ 'markerfacecolor': ['get_markerfacecolor', 'get_facecolor'],\r\n+ 'mfc': ['get_markerfacecolor', 'get_facecolor'],\r\n+ 'markeredgecolor': ['get_markeredgecolor', 'get_edgecolor'],\r\n+ 'mec': ['get_markeredgecolor', 'get_edgecolor'],\r\n+ }\r\n+ if labelcolor is None:\r\n+ if mpl.rcParams['legend.labelcolor'] is not None:\r\n+ labelcolor = mpl.rcParams['legend.labelcolor']\r\n+ else:\r\n+ labelcolor = mpl.rcParams['text.color']\r\n+ if isinstance(labelcolor, str) and labelcolor in color_getters:\r\n+ getter_names = color_getters[labelcolor]\r\n+ for handle, text in zip(self.legend_handles, self.texts):\r\n+ try:\r\n+ if handle.get_array() is not None:\r\n+ continue\r\n+ except AttributeError:\r\n+ pass\r\n+ for getter_name in getter_names:\r\n+ try:\r\n+ color = getattr(handle, getter_name)()\r\n+ if isinstance(color, np.ndarray):\r\n+ if (\r\n+ color.shape[0] == 1\r\n+ or np.isclose(color, color[0]).all()\r\n+ ):\r\n+ text.set_color(color[0])\r\n+ else:\r\n+ pass\r\n+ else:\r\n+ text.set_color(color)\r\n+ break\r\n+ except AttributeError:\r\n+ pass\r\n+ elif isinstance(labelcolor, str) and labelcolor == 'none':\r\n+ for text in self.texts:\r\n+ text.set_color(labelcolor)\r\n+ elif np.iterable(labelcolor):\r\n+ for text, color in zip(self.texts,\r\n+ itertools.cycle(\r\n+ colors.to_rgba_array(labelcolor))):\r\n+ text.set_color(color)\r\n+ else:\r\n+ raise ValueError(f\"Invalid labelcolor: {labelcolor!r}\")\r\n+\r\n+ legendHandles = _api.deprecated('3.7', alternative=\"legend_handles\")(\r\n+ property(lambda self: self.legend_handles))\r\n+\r\n+ def _set_artist_props(self, a):\r\n+ \"\"\"\r\n+ Set the boilerplate props for artists added to axes.\r\n+ \"\"\"\r\n+ a.set_figure(self.figure)\r\n+ if self.isaxes:\r\n+ # a.set_axes(self.axes)\r\n+ a.axes = self.axes\r\n+\r\n+ a.set_transform(self.get_transform())\r\n+\r\n+ def _set_loc(self, loc):\r\n+ # find_offset function will be provided to _legend_box and\r\n+ # _legend_box will draw itself at the location of the return\r\n+ # value of the find_offset.\r\n+ self._loc_used_default = False\r\n+ self._loc_real = loc\r\n+ self.stale = True\r\n+ self._legend_box.set_offset(self._findoffset)\r\n+\r\n+ def set_ncols(self, ncols):\r\n+ \"\"\"Set the number of columns.\"\"\"\r\n+ self._ncols = ncols\r\n+\r\n+ def _get_loc(self):\r\n+ return self._loc_real\r\n+\r\n+ _loc = property(_get_loc, _set_loc)\r\n+\r\n+ def _findoffset(self, width, height, xdescent, ydescent, renderer):\r\n+ \"\"\"Helper function to locate the legend.\"\"\"\r\n+\r\n+ if self._loc == 0: # \"best\".\r\n+ x, y = self._find_best_position(width, height, renderer)\r\n+ elif self._loc in Legend.codes.values(): # Fixed location.\r\n+ bbox = Bbox.from_bounds(0, 0, width, height)\r\n+ x, y = self._get_anchored_bbox(self._loc, bbox,\r\n+ self.get_bbox_to_anchor(),\r\n+ renderer)\r\n+ else: # Axes or figure coordinates.\r\n+ fx, fy = self._loc\r\n+ bbox = self.get_bbox_to_anchor()\r\n+ x, y = bbox.x0 + bbox.width * fx, bbox.y0 + bbox.height * fy\r\n+\r\n+ return x + xdescent, y + ydescent\r\n+\r\n+ @allow_rasterization\r\n+ def draw(self, renderer):\r\n+ # docstring inherited\r\n+ if not self.get_visible():\r\n+ return\r\n+\r\n+ renderer.open_group('legend', gid=self.get_gid())\r\n+\r\n+ fontsize = renderer.points_to_pixels(self._fontsize)\r\n+\r\n+ # if mode == fill, set the width of the legend_box to the\r\n+ # width of the parent (minus pads)\r\n+ if self._mode in [\"expand\"]:\r\n+ pad = 2 * (self.borderaxespad + self.borderpad) * fontsize\r\n+ self._legend_box.set_width(self.get_bbox_to_anchor().width - pad)\r\n+\r\n+ # update the location and size of the legend. This needs to\r\n+ # be done in any case to clip the figure right.\r\n+ bbox = self._legend_box.get_window_extent(renderer)\r\n+ self.legendPatch.set_bounds(bbox.bounds)\r\n+ self.legendPatch.set_mutation_scale(fontsize)\r\n+\r\n+ if self.shadow:\r\n+ Shadow(self.legendPatch, 2, -2).draw(renderer)\r\n+\r\n+ self.legendPatch.draw(renderer)\r\n+ self._legend_box.draw(renderer)\r\n+\r\n+ renderer.close_group('legend')\r\n+ self.stale = False\r\n+\r\n+ # _default_handler_map defines the default mapping between plot\r\n+ # elements and the legend handlers.\r\n+\r\n+ _default_handler_map = {\r\n+ StemContainer: legend_handler.HandlerStem(),\r\n+ ErrorbarContainer: legend_handler.HandlerErrorbar(),\r\n+ Line2D: legend_handler.HandlerLine2D(),\r\n+ Patch: legend_handler.HandlerPatch(),\r\n+ StepPatch: legend_handler.HandlerStepPatch(),\r\n+ LineCollection: legend_handler.HandlerLineCollection(),\r\n+ RegularPolyCollection: legend_handler.HandlerRegularPolyCollection(),\r\n+ CircleCollection: legend_handler.HandlerCircleCollection(),\r\n+ BarContainer: legend_handler.HandlerPatch(\r\n+ update_func=legend_handler.update_from_first_child),\r\n+ tuple: legend_handler.HandlerTuple(),\r\n+ PathCollection: legend_handler.HandlerPathCollection(),\r\n+ PolyCollection: legend_handler.HandlerPolyCollection()\r\n+ }\r\n+\r\n+ # (get|set|update)_default_handler_maps are public interfaces to\r\n+ # modify the default handler map.\r\n+\r\n+ @classmethod\r\n+ def get_default_handler_map(cls):\r\n+ \"\"\"Return the global default handler map, shared by all legends.\"\"\"\r\n+ return cls._default_handler_map\r\n+\r\n+ @classmethod\r\n+ def set_default_handler_map(cls, handler_map):\r\n+ \"\"\"Set the global default handler map, shared by all legends.\"\"\"\r\n+ cls._default_handler_map = handler_map\r\n+\r\n+ @classmethod\r\n+ def update_default_handler_map(cls, handler_map):\r\n+ \"\"\"Update the global default handler map, shared by all legends.\"\"\"\r\n+ cls._default_handler_map.update(handler_map)\r\n+\r\n+ def get_legend_handler_map(self):\r\n+ \"\"\"Return this legend instance's handler map.\"\"\"\r\n+ default_handler_map = self.get_default_handler_map()\r\n+ return ({**default_handler_map, **self._custom_handler_map}\r\n+ if self._custom_handler_map else default_handler_map)\r\n+\r\n+ @staticmethod\r\n+ def get_legend_handler(legend_handler_map, orig_handle):\r\n+ \"\"\"\r\n+ Return a legend handler from *legend_handler_map* that\r\n+ corresponds to *orig_handler*.\r\n+\r\n+ *legend_handler_map* should be a dictionary object (that is\r\n+ returned by the get_legend_handler_map method).\r\n+\r\n+ It first checks if the *orig_handle* itself is a key in the\r\n+ *legend_handler_map* and return the associated value.\r\n+ Otherwise, it checks for each of the classes in its\r\n+ method-resolution-order. If no matching key is found, it\r\n+ returns ``None``.\r\n+ \"\"\"\r\n+ try:\r\n+ return legend_handler_map[orig_handle]\r\n+ except (TypeError, KeyError): # TypeError if unhashable.\r\n+ pass\r\n+ for handle_type in type(orig_handle).mro():\r\n+ try:\r\n+ return legend_handler_map[handle_type]\r\n+ except KeyError:\r\n+ pass\r\n+ return None\r\n+\r\n+ def _init_legend_box(self, handles, labels, markerfirst=True):\r\n+ \"\"\"\r\n+ Initialize the legend_box. The legend_box is an instance of\r\n+ the OffsetBox, which is packed with legend handles and\r\n+ texts. Once packed, their location is calculated during the\r\n+ drawing time.\r\n+ \"\"\"\r\n+\r\n+ fontsize = self._fontsize\r\n+\r\n+ # legend_box is a HPacker, horizontally packed with columns.\r\n+ # Each column is a VPacker, vertically packed with legend items.\r\n+ # Each legend item is a HPacker packed with:\r\n+ # - handlebox: a DrawingArea which contains the legend handle.\r\n+ # - labelbox: a TextArea which contains the legend text.\r\n+\r\n+ text_list = [] # the list of text instances\r\n+ handle_list = [] # the list of handle instances\r\n+ handles_and_labels = []\r\n+\r\n+ # The approximate height and descent of text. These values are\r\n+ # only used for plotting the legend handle.\r\n+ descent = 0.35 * fontsize * (self.handleheight - 0.7) # heuristic.\r\n+ height = fontsize * self.handleheight - descent\r\n+ # each handle needs to be drawn inside a box of (x, y, w, h) =\r\n+ # (0, -descent, width, height). And their coordinates should\r\n+ # be given in the display coordinates.\r\n+\r\n+ # The transformation of each handle will be automatically set\r\n+ # to self.get_transform(). If the artist does not use its\r\n+ # default transform (e.g., Collections), you need to\r\n+ # manually set their transform to the self.get_transform().\r\n+ legend_handler_map = self.get_legend_handler_map()\r\n+\r\n+ for orig_handle, label in zip(handles, labels):\r\n+ handler = self.get_legend_handler(legend_handler_map, orig_handle)\r\n+ if handler is None:\r\n+ _api.warn_external(\r\n+ \"Legend does not support handles for \"\r\n+ f\"{type(orig_handle).__name__} \"\r\n+ \"instances.\\nA proxy artist may be used \"\r\n+ \"instead.\\nSee: https://matplotlib.org/\"\r\n+ \"stable/tutorials/intermediate/legend_guide.html\"\r\n+ \"#controlling-the-legend-entries\")\r\n+ # No handle for this artist, so we just defer to None.\r\n+ handle_list.append(None)\r\n+ else:\r\n+ textbox = TextArea(label, multilinebaseline=True,\r\n+ textprops=dict(\r\n+ verticalalignment='baseline',\r\n+ horizontalalignment='left',\r\n+ fontproperties=self.prop))\r\n+ handlebox = DrawingArea(width=self.handlelength * fontsize,\r\n+ height=height,\r\n+ xdescent=0., ydescent=descent)\r\n+\r\n+ text_list.append(textbox._text)\r\n+ # Create the artist for the legend which represents the\r\n+ # original artist/handle.\r\n+ handle_list.append(handler.legend_artist(self, orig_handle,\r\n+ fontsize, handlebox))\r\n+ handles_and_labels.append((handlebox, textbox))\r\n+\r\n+ columnbox = []\r\n+ # array_split splits n handles_and_labels into ncols columns, with the\r\n+ # first n%ncols columns having an extra entry. filter(len, ...)\r\n+ # handles the case where n < ncols: the last ncols-n columns are empty\r\n+ # and get filtered out.\r\n+ for handles_and_labels_column in filter(\r\n+ len, np.array_split(handles_and_labels, self._ncols)):\r\n+ # pack handlebox and labelbox into itembox\r\n+ itemboxes = [HPacker(pad=0,\r\n+ sep=self.handletextpad * fontsize,\r\n+ children=[h, t] if markerfirst else [t, h],\r\n+ align=\"baseline\")\r\n+ for h, t in handles_and_labels_column]\r\n+ # pack columnbox\r\n+ alignment = \"baseline\" if markerfirst else \"right\"\r\n+ columnbox.append(VPacker(pad=0,\r\n+ sep=self.labelspacing * fontsize,\r\n+ align=alignment,\r\n+ children=itemboxes))\r\n+\r\n+ mode = \"expand\" if self._mode == \"expand\" else \"fixed\"\r\n+ sep = self.columnspacing * fontsize\r\n+ self._legend_handle_box = HPacker(pad=0,\r\n+ sep=sep, align=\"baseline\",\r\n+ mode=mode,\r\n+ children=columnbox)\r\n+ self._legend_title_box = TextArea(\"\")\r\n+ self._legend_box = VPacker(pad=self.borderpad * fontsize,\r\n+ sep=self.labelspacing * fontsize,\r\n+ align=self._alignment,\r\n+ children=[self._legend_title_box,\r\n+ self._legend_handle_box])\r\n+ self._legend_box.set_figure(self.figure)\r\n+ self._legend_box.axes = self.axes\r\n+ self.texts = text_list\r\n+ self.legend_handles = handle_list\r\n+\r\n+ def _auto_legend_data(self):\r\n+ \"\"\"\r\n+ Return display coordinates for hit testing for \"best\" positioning.\r\n+\r\n+ Returns\r\n+ -------\r\n+ bboxes\r\n+ List of bounding boxes of all patches.\r\n+ lines\r\n+ List of `.Path` corresponding to each line.\r\n+ offsets\r\n+ List of (x, y) offsets of all collection.\r\n+ \"\"\"\r\n+ assert self.isaxes # always holds, as this is only called internally\r\n+ bboxes = []\r\n+ lines = []\r\n+ offsets = []\r\n+ for artist in self.parent._children:\r\n+ if isinstance(artist, Line2D):\r\n+ lines.append(\r\n+ artist.get_transform().transform_path(artist.get_path()))\r\n+ elif isinstance(artist, Rectangle):\r\n+ bboxes.append(\r\n+ artist.get_bbox().transformed(artist.get_data_transform()))\r\n+ elif isinstance(artist, Patch):\r\n+ lines.append(\r\n+ artist.get_transform().transform_path(artist.get_path()))\r\n+ elif isinstance(artist, Collection):\r\n+ transform, transOffset, hoffsets, _ = artist._prepare_points()\r\n+ if len(hoffsets):\r\n+ for offset in transOffset.transform(hoffsets):\r\n+ offsets.append(offset)\r\n+\r\n+ return bboxes, lines, offsets\r\n+\r\n+ def get_children(self):\r\n+ # docstring inherited\r\n+ return [self._legend_box, self.get_frame()]\r\n+\r\n+ def get_frame(self):\r\n+ \"\"\"Return the `~.patches.Rectangle` used to frame the legend.\"\"\"\r\n+ return self.legendPatch\r\n+\r\n+ def get_lines(self):\r\n+ r\"\"\"Return the list of `~.lines.Line2D`\\s in the legend.\"\"\"\r\n+ return [h for h in self.legend_handles if isinstance(h, Line2D)]\r\n+\r\n+ def get_patches(self):\r\n+ r\"\"\"Return the list of `~.patches.Patch`\\s in the legend.\"\"\"\r\n+ return silent_list('Patch',\r\n+ [h for h in self.legend_handles\r\n+ if isinstance(h, Patch)])\r\n+\r\n+ def get_texts(self):\r\n+ r\"\"\"Return the list of `~.text.Text`\\s in the legend.\"\"\"\r\n+ return silent_list('Text', self.texts)\r\n+\r\n+ def set_alignment(self, alignment):\r\n+ \"\"\"\r\n+ Set the alignment of the legend title and the box of entries.\r\n+\r\n+ The entries are aligned as a single block, so that markers always\r\n+ lined up.\r\n+\r\n+ Parameters\r\n+ ----------\r\n+ alignment : {'center', 'left', 'right'}.\r\n+\r\n+ \"\"\"\r\n+ _api.check_in_list([\"center\", \"left\", \"right\"], alignment=alignment)\r\n+ self._alignment = alignment\r\n+ self._legend_box.align = alignment\r\n+\r\n+ def get_alignment(self):\r\n+ \"\"\"Get the alignment value of the legend box\"\"\"\r\n+ return self._legend_box.align\r\n+\r\n+ def set_title(self, title, prop=None):\r\n+ \"\"\"\r\n+ Set legend title and title style.\r\n+\r\n+ Parameters\r\n+ ----------\r\n+ title : str\r\n+ The legend title.\r\n+\r\n+ prop : `.font_manager.FontProperties` or `str` or `pathlib.Path`\r\n+ The font properties of the legend title.\r\n+ If a `str`, it is interpreted as a fontconfig pattern parsed by\r\n+ `.FontProperties`. If a `pathlib.Path`, it is interpreted as the\r\n+ absolute path to a font file.\r\n+\r\n+ \"\"\"\r\n+ self._legend_title_box._text.set_text(title)\r\n+ if title:\r\n+ self._legend_title_box._text.set_visible(True)\r\n+ self._legend_title_box.set_visible(True)\r\n+ else:\r\n+ self._legend_title_box._text.set_visible(False)\r\n+ self._legend_title_box.set_visible(False)\r\n+\r\n+ if prop is not None:\r\n+ self._legend_title_box._text.set_fontproperties(prop)\r\n+\r\n+ self.stale = True\r\n+\r\n+ def get_title(self):\r\n+ \"\"\"Return the `.Text` instance for the legend title.\"\"\"\r\n+ return self._legend_title_box._text\r\n+\r\n+ def get_window_extent(self, renderer=None):\r\n+ # docstring inherited\r\n+ if renderer is None:\r\n+ renderer = self.figure._get_renderer()\r\n+ return self._legend_box.get_window_extent(renderer=renderer)\r\n+\r\n+ def get_tightbbox(self, renderer=None):\r\n+ # docstring inherited\r\n+ return self._legend_box.get_window_extent(renderer)\r\n+\r\n+ def get_frame_on(self):\r\n+ \"\"\"Get whether the legend box patch is drawn.\"\"\"\r\n+ return self.legendPatch.get_visible()\r\n+\r\n+ def set_frame_on(self, b):\r\n+ \"\"\"\r\n+ Set whether the legend box patch is drawn.\r\n+\r\n+ Parameters\r\n+ ----------\r\n+ b : bool\r\n+ \"\"\"\r\n+ self.legendPatch.set_visible(b)\r\n+ self.stale = True\r\n+\r\n+ draw_frame = set_frame_on # Backcompat alias.\r\n+\r\n+ def get_bbox_to_anchor(self):\r\n+ \"\"\"Return the bbox that the legend will be anchored to.\"\"\"\r\n+ if self._bbox_to_anchor is None:\r\n+ return self.parent.bbox\r\n+ else:\r\n+ return self._bbox_to_anchor\r\n+\r\n+ def set_bbox_to_anchor(self, bbox, transform=None):\r\n+ \"\"\"\r\n+ Set the bbox that the legend will be anchored to.\r\n+\r\n+ Parameters\r\n+ ----------\r\n+ bbox : `~matplotlib.transforms.BboxBase` or tuple\r\n+ The bounding box can be specified in the following ways:\r\n+\r\n+ - A `.BboxBase` instance\r\n+ - A tuple of ``(left, bottom, width, height)`` in the given\r\n+ transform (normalized axes coordinate if None)\r\n+ - A tuple of ``(left, bottom)`` where the width and height will be\r\n+ assumed to be zero.\r\n+ - *None*, to remove the bbox anchoring, and use the parent bbox.\r\n+\r\n+ transform : `~matplotlib.transforms.Transform`, optional\r\n+ A transform to apply to the bounding box. If not specified, this\r\n+ will use a transform to the bounding box of the parent.\r\n+ \"\"\"\r\n+ if bbox is None:\r\n+ self._bbox_to_anchor = None\r\n+ return\r\n+ elif isinstance(bbox, BboxBase):\r\n+ self._bbox_to_anchor = bbox\r\n+ else:\r\n+ try:\r\n+ l = len(bbox)\r\n+ except TypeError as err:\r\n+ raise ValueError(f\"Invalid bbox: {bbox}\") from err\r\n+\r\n+ if l == 2:\r\n+ bbox = [bbox[0], bbox[1], 0, 0]\r\n+\r\n+ self._bbox_to_anchor = Bbox.from_bounds(*bbox)\r\n+\r\n+ if transform is None:\r\n+ transform = BboxTransformTo(self.parent.bbox)\r\n+\r\n+ self._bbox_to_anchor = TransformedBbox(self._bbox_to_anchor,\r\n+ transform)\r\n+ self.stale = True\r\n+\r\n+ def _get_anchored_bbox(self, loc, bbox, parentbbox, renderer):\r\n+ \"\"\"\r\n+ Place the *bbox* inside the *parentbbox* according to a given\r\n+ location code. Return the (x, y) coordinate of the bbox.\r\n+\r\n+ Parameters\r\n+ ----------\r\n+ loc : int\r\n+ A location code in range(1, 11). This corresponds to the possible\r\n+ values for ``self._loc``, excluding \"best\".\r\n+ bbox : `~matplotlib.transforms.Bbox`\r\n+ bbox to be placed, in display coordinates.\r\n+ parentbbox : `~matplotlib.transforms.Bbox`\r\n+ A parent box which will contain the bbox, in display coordinates.\r\n+ \"\"\"\r\n+ return offsetbox._get_anchored_bbox(\r\n+ loc, bbox, parentbbox,\r\n+ self.borderaxespad * renderer.points_to_pixels(self._fontsize))\r\n+\r\n+ def _find_best_position(self, width, height, renderer, consider=None):\r\n+ \"\"\"\r\n+ Determine the best location to place the legend.\r\n+\r\n+ *consider* is a list of ``(x, y)`` pairs to consider as a potential\r\n+ lower-left corner of the legend. All are display coords.\r\n+ \"\"\"\r\n+ assert self.isaxes # always holds, as this is only called internally\r\n+\r\n+ start_time = time.perf_counter()\r\n+\r\n+ bboxes, lines, offsets = self._auto_legend_data()\r\n+\r\n+ bbox = Bbox.from_bounds(0, 0, width, height)\r\n+ if consider is None:\r\n+ consider = [self._get_anchored_bbox(x, bbox,\r\n+ self.get_bbox_to_anchor(),\r\n+ renderer)\r\n+ for x in range(1, len(self.codes))]\r\n+\r\n+ candidates = []\r\n+ for idx, (l, b) in enumerate(consider):\r\n+ legendBox = Bbox.from_bounds(l, b, width, height)\r\n+ badness = 0\r\n+ # XXX TODO: If markers are present, it would be good to take them\r\n+ # into account when checking vertex overlaps in the next line.\r\n+ badness = (sum(legendBox.count_contains(line.vertices)\r\n+ for line in lines)\r\n+ + legendBox.count_contains(offsets)\r\n+ + legendBox.count_overlaps(bboxes)\r\n+ + sum(line.intersects_bbox(legendBox, filled=False)\r\n+ for line in lines))\r\n+ if badness == 0:\r\n+ return l, b\r\n+ # Include the index to favor lower codes in case of a tie.\r\n+ candidates.append((badness, idx, (l, b)))\r\n+\r\n+ _, _, (l, b) = min(candidates)\r\n+\r\n+ if self._loc_used_default and time.perf_counter() - start_time > 1:\r\n+ _api.warn_external(\r\n+ 'Creating legend with loc=\"best\" can be slow with large '\r\n+ 'amounts of data.')\r\n+\r\n+ return l, b\r\n+\r\n+ def contains(self, event):\r\n+ inside, info = self._default_contains(event)\r\n+ if inside is not None:\r\n+ return inside, info\r\n+ return self.legendPatch.contains(event)\r\n+\r\n+ def set_draggable(self, state, use_blit=False, update='loc'):\r\n+ \"\"\"\r\n+ Enable or disable mouse dragging support of the legend.\r\n+\r\n+ Parameters\r\n+ ----------\r\n+ state : bool\r\n+ Whether mouse dragging is enabled.\r\n+ use_blit : bool, optional\r\n+ Use blitting for faster image composition. For details see\r\n+ :ref:`func-animation`.\r\n+ update : {'loc', 'bbox'}, optional\r\n+ The legend parameter to be changed when dragged:\r\n+\r\n+ - 'loc': update the *loc* parameter of the legend\r\n+ - 'bbox': update the *bbox_to_anchor* parameter of the legend\r\n+\r\n+ Returns\r\n+ -------\r\n+ `.DraggableLegend` or *None*\r\n+ If *state* is ``True`` this returns the `.DraggableLegend` helper\r\n+ instance. Otherwise this returns *None*.\r\n+ \"\"\"\r\n+ if state:\r\n+ if self._draggable is None:\r\n+ self._draggable = DraggableLegend(self,\r\n+ use_blit,\r\n+ update=update)\r\n+ else:\r\n+ if self._draggable is not None:\r\n+ self._draggable.disconnect()\r\n+ self._draggable = None\r\n+ return self._draggable\r\n+\r\n+ def get_draggable(self):\r\n+ \"\"\"Return ``True`` if the legend is draggable, ``False`` otherwise.\"\"\"\r\n+ return self._draggable is not None\r\n+\r\n+\r\n+# Helper functions to parse legend arguments for both `figure.legend` and\r\n+# `axes.legend`:\r\n+def _get_legend_handles(axs, legend_handler_map=None):\r\n+ \"\"\"Yield artists that can be used as handles in a legend.\"\"\"\r\n+ handles_original = []\r\n+ for ax in axs:\r\n+ handles_original += [\r\n+ *(a for a in ax._children\r\n+ if isinstance(a, (Line2D, Patch, Collection, Text))),\r\n+ *ax.containers]\r\n+ # support parasite axes:\r\n+ if hasattr(ax, 'parasites'):\r\n+ for axx in ax.parasites:\r\n+ handles_original += [\r\n+ *(a for a in axx._children\r\n+ if isinstance(a, (Line2D, Patch, Collection, Text))),\r\n+ *axx.containers]\r\n+\r\n+ handler_map = {**Legend.get_default_handler_map(),\r\n+ **(legend_handler_map or {})}\r\n+ has_handler = Legend.get_legend_handler\r\n+ for handle in handles_original:\r\n+ label = handle.get_label()\r\n+ if label != '_nolegend_' and has_handler(handler_map, handle):\r\n+ yield handle\r\n+ elif (label and not label.startswith('_') and\r\n+ not has_handler(handler_map, handle)):\r\n+ _api.warn_external(\r\n+ \"Legend does not support handles for \"\r\n+ f\"{type(handle).__name__} \"\r\n+ \"instances.\\nSee: https://matplotlib.org/stable/\"\r\n+ \"tutorials/intermediate/legend_guide.html\"\r\n+ \"#implementing-a-custom-legend-handler\")\r\n+ continue\r\n+\r\n+\r\n+def _get_legend_handles_labels(axs, legend_handler_map=None):\r\n+ \"\"\"Return handles and labels for legend.\"\"\"\r\n+ handles = []\r\n+ labels = []\r\n+ for handle in _get_legend_handles(axs, legend_handler_map):\r\n+ label = handle.get_label()\r\n+ if label and not label.startswith('_'):\r\n+ handles.append(handle)\r\n+ labels.append(label)\r\n+ return handles, labels\r\n+\r\n+\r\n+def _parse_legend_args(axs, *args, handles=None, labels=None, **kwargs):\r\n+ \"\"\"\r\n+ Get the handles and labels from the calls to either ``figure.legend``\r\n+ or ``axes.legend``.\r\n+\r\n+ The parser is a bit involved because we support::\r\n+\r\n+ legend()\r\n+ legend(labels)\r\n+ legend(handles, labels)\r\n+ legend(labels=labels)\r\n+ legend(handles=handles)\r\n+ legend(handles=handles, labels=labels)\r\n+\r\n+ The behavior for a mixture of positional and keyword handles and labels\r\n+ is undefined and issues a warning.\r\n+\r\n+ Parameters\r\n+ ----------\r\n+ axs : list of `.Axes`\r\n+ If handles are not given explicitly, the artists in these Axes are\r\n+ used as handles.\r\n+ *args : tuple\r\n+ Positional parameters passed to ``legend()``.\r\n+ handles\r\n+ The value of the keyword argument ``legend(handles=...)``, or *None*\r\n+ if that keyword argument was not used.\r\n+ labels\r\n+ The value of the keyword argument ``legend(labels=...)``, or *None*\r\n+ if that keyword argument was not used.\r\n+ **kwargs\r\n+ All other keyword arguments passed to ``legend()``.\r\n+\r\n+ Returns\r\n+ -------\r\n+ handles : list of `.Artist`\r\n+ The legend handles.\r\n+ labels : list of str\r\n+ The legend labels.\r\n+ extra_args : tuple\r\n+ *args* with positional handles and labels removed.\r\n+ kwargs : dict\r\n+ *kwargs* with keywords handles and labels removed.\r\n+\r\n+ \"\"\"\r\n+ log = logging.getLogger(__name__)\r\n+\r\n+ handlers = kwargs.get('handler_map')\r\n+ extra_args = ()\r\n+\r\n+ if (handles is not None or labels is not None) and args:\r\n+ _api.warn_external(\"You have mixed positional and keyword arguments, \"\r\n+ \"some input may be discarded.\")\r\n+\r\n+ # if got both handles and labels as kwargs, make same length\r\n+ if handles and labels:\r\n+ handles, labels = zip(*zip(handles, labels))\r\n+\r\n+ elif handles is not None and labels is None:\r\n+ labels = [handle.get_label() for handle in handles]\r\n+\r\n+ elif labels is not None and handles is None:\r\n+ # Get as many handles as there are labels.\r\n+ handles = [handle for handle, label\r\n+ in zip(_get_legend_handles(axs, handlers), labels)]\r\n+\r\n+ # No arguments - automatically detect labels and handles.\r\n+ elif len(args) == 0:\r\n+ handles, labels = _get_legend_handles_labels(axs, handlers)\r\n+ if not handles:\r\n+ log.warning(\r\n+ \"No artists with labels found to put in legend. Note that \"\r\n+ \"artists whose label start with an underscore are ignored \"\r\n+ \"when legend() is called with no argument.\")\r\n+\r\n+ # One argument. User defined labels - automatic handle detection.\r\n+ elif len(args) == 1:\r\n+ labels, = args\r\n+ if any(isinstance(l, Artist) for l in labels):\r\n+ raise TypeError(\"A single argument passed to legend() must be a \"\r\n+ \"list of labels, but found an Artist in there.\")\r\n+\r\n+ # Get as many handles as there are labels.\r\n+ handles = [handle for handle, label\r\n+ in zip(_get_legend_handles(axs, handlers), labels)]\r\n+\r\n+ # Two arguments:\r\n+ # * user defined handles and labels\r\n+ elif len(args) >= 2:\r\n+ handles, labels = args[:2]\r\n+ extra_args = args[2:]\r\n+\r\n+ else:\r\n+ raise TypeError('Invalid arguments to legend.')\r\n+\r\n+ return handles, labels, extra_args, kwargs\r\ndiff --git a/lib/matplotlib/legend.py.rej b/lib/matplotlib/legend.py.rej\r\nnew file mode 100644\r\nindex 0000000000..2c44e6f220\r\n--- /dev/null\r\n+++ b/lib/matplotlib/legend.py.rej\r\n@@ -0,0 +1,24 @@\r\n+--- legend.py\r\n++++ legend.py\r\n+@@ -96,6 +96,21 @@\r\n+ self.legend.set_bbox_to_anchor(loc_in_bbox)\r\n+ \r\n++ def disable_draggable(self):\r\n++ \"\"\"\r\n++ Disable the draggable feature of the legend to allow pickling.\r\n++ \"\"\"\r\n++ if hasattr(self, '_draggable'):\r\n++ self._draggable.disconnect_events()\r\n++ self._draggable = None\r\n++\r\n++ def enable_draggable(self, use_blit=False, update='loc'):\r\n++ \"\"\"\r\n++ Re-enable the draggable feature of the legend after pickling.\r\n++ \"\"\"\r\n++ self.set_draggable(True, use_blit=use_blit, update=update)\r\n++\r\n++\r\n+ _legend_kw_doc_base = \"\"\"\r\n+ bbox_to_anchor : `.BboxBase`, 2-tuple, or 4-tuple of floats\r\n+ \r\n+", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "django__django-12113", "model_patch": "diff --git a/tests/test_sqlite.py b/tests/test_sqlite.py\r\nindex f1b65f7d01..1b3b294773 100644\r\n--- a/tests/test_sqlite.py\r\n+++ b/tests/test_sqlite.py\r\n@@ -15,9 +15,11 @@\r\n DATABASES = {\r\n 'default': {\r\n 'ENGINE': 'django.db.backends.sqlite3',\r\n+ 'NAME': 'django_tests_default.sqlite3',\r\n },\r\n 'other': {\r\n 'ENGINE': 'django.db.backends.sqlite3',\r\n+ 'NAME': 'django_tests_other.sqlite3',\r\n }\r\n }", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "matplotlib__matplotlib-24334", "model_patch": "", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "django__django-15738", "model_patch": "diff --git a/tests/i18n/sampleproject/authors/__init__.py b/tests/i18n/sampleproject/authors/__init__.py\r\nnew file mode 100644\r\nindex 0000000000..e69de29bb2\r\ndiff --git a/tests/i18n/sampleproject/authors/admin.py b/tests/i18n/sampleproject/authors/admin.py\r\nnew file mode 100644\r\nindex 0000000000..8c38f3f3da\r\n--- /dev/null\r\n+++ b/tests/i18n/sampleproject/authors/admin.py\r\n@@ -0,0 +1,3 @@\r\n+from django.contrib import admin\r\n+\r\n+# Register your models here.\r\ndiff --git a/tests/i18n/sampleproject/authors/apps.py b/tests/i18n/sampleproject/authors/apps.py\r\nnew file mode 100644\r\nindex 0000000000..4fead46d63\r\n--- /dev/null\r\n+++ b/tests/i18n/sampleproject/authors/apps.py\r\n@@ -0,0 +1,6 @@\r\n+from django.apps import AppConfig\r\n+\r\n+\r\n+class AuthorsConfig(AppConfig):\r\n+ default_auto_field = \"django.db.models.BigAutoField\"\r\n+ name = \"authors\"\r\ndiff --git a/tests/i18n/sampleproject/authors/migrations/0001_initial.py b/tests/i18n/sampleproject/authors/migrations/0001_initial.py\r\nnew file mode 100644\r\nindex 0000000000..3b1a2cd8b7\r\n--- /dev/null\r\n+++ b/tests/i18n/sampleproject/authors/migrations/0001_initial.py\r\n@@ -0,0 +1,108 @@\r\n+# Generated by Django 4.2.dev20220601171126 on 2024-05-04 20:05\r\n+\r\n+from django.db import migrations, models\r\n+import django.db.models.deletion\r\n+\r\n+\r\n+class Migration(migrations.Migration):\r\n+\r\n+ initial = True\r\n+\r\n+ dependencies = []\r\n+\r\n+ operations = [\r\n+ migrations.CreateModel(\r\n+ name=\"DataSet\",\r\n+ fields=[\r\n+ (\r\n+ \"id\",\r\n+ models.BigAutoField(\r\n+ auto_created=True,\r\n+ primary_key=True,\r\n+ serialize=False,\r\n+ verbose_name=\"ID\",\r\n+ ),\r\n+ ),\r\n+ (\"name\", models.TextField(max_length=50)),\r\n+ ],\r\n+ ),\r\n+ migrations.CreateModel(\r\n+ name=\"Project\",\r\n+ fields=[\r\n+ (\r\n+ \"id\",\r\n+ models.BigAutoField(\r\n+ auto_created=True,\r\n+ primary_key=True,\r\n+ serialize=False,\r\n+ verbose_name=\"ID\",\r\n+ ),\r\n+ ),\r\n+ (\"name\", models.TextField(max_length=50)),\r\n+ ],\r\n+ ),\r\n+ migrations.CreateModel(\r\n+ name=\"ProjectDataSet\",\r\n+ fields=[\r\n+ (\r\n+ \"id\",\r\n+ models.BigAutoField(\r\n+ auto_created=True,\r\n+ primary_key=True,\r\n+ serialize=False,\r\n+ verbose_name=\"ID\",\r\n+ ),\r\n+ ),\r\n+ (\r\n+ \"data_set\",\r\n+ models.ForeignKey(\r\n+ on_delete=django.db.models.deletion.PROTECT,\r\n+ to=\"authors.dataset\",\r\n+ ),\r\n+ ),\r\n+ (\r\n+ \"project\",\r\n+ models.ForeignKey(\r\n+ on_delete=django.db.models.deletion.PROTECT,\r\n+ to=\"authors.project\",\r\n+ ),\r\n+ ),\r\n+ ],\r\n+ options={\r\n+ \"unique_together\": {(\"data_set\", \"project\")},\r\n+ },\r\n+ ),\r\n+ migrations.AddField(\r\n+ model_name=\"project\",\r\n+ name=\"data_sets\",\r\n+ field=models.ManyToManyField(\r\n+ through=\"authors.ProjectDataSet\", to=\"authors.dataset\"\r\n+ ),\r\n+ ),\r\n+ migrations.CreateModel(\r\n+ name=\"Authors\",\r\n+ fields=[\r\n+ (\r\n+ \"id\",\r\n+ models.BigAutoField(\r\n+ auto_created=True,\r\n+ primary_key=True,\r\n+ serialize=False,\r\n+ verbose_name=\"ID\",\r\n+ ),\r\n+ ),\r\n+ (\"state\", models.IntegerField()),\r\n+ (\"start_date\", models.DateField()),\r\n+ (\r\n+ \"project_data_set\",\r\n+ models.ForeignKey(\r\n+ on_delete=django.db.models.deletion.PROTECT,\r\n+ to=\"authors.projectdataset\",\r\n+ ),\r\n+ ),\r\n+ ],\r\n+ options={\r\n+ \"unique_together\": {(\"project_data_set\", \"state\", \"start_date\")},\r\n+ },\r\n+ ),\r\n+ ]\r\ndiff --git a/tests/i18n/sampleproject/authors/migrations/__init__.py b/tests/i18n/sampleproject/authors/migrations/__init__.py\r\nnew file mode 100644\r\nindex 0000000000..e69de29bb2\r\ndiff --git a/tests/i18n/sampleproject/authors/models.py b/tests/i18n/sampleproject/authors/models.py\r\nnew file mode 100644\r\nindex 0000000000..290af49445\r\n--- /dev/null\r\n+++ b/tests/i18n/sampleproject/authors/models.py\r\n@@ -0,0 +1,22 @@\r\n+from django.db import models\r\n+\r\n+class DataSet(models.Model):\r\n+ name = models.TextField(max_length=50)\r\n+\r\n+class Project(models.Model):\r\n+ data_sets = models.ManyToManyField(DataSet, through='ProjectDataSet')\r\n+ name = models.TextField(max_length=50)\r\n+\r\n+class ProjectDataSet(models.Model):\r\n+ data_set = models.ForeignKey(DataSet, on_delete=models.PROTECT)\r\n+ project = models.ForeignKey(Project, on_delete=models.PROTECT)\r\n+ class Meta:\r\n+ unique_together = (('data_set', 'project'),)\r\n+\r\n+class Authors(models.Model):\r\n+ project_data_set = models.ForeignKey(ProjectDataSet, on_delete=models.PROTECT)\r\n+ state = models.IntegerField()\r\n+ start_date = models.DateField()\r\n+ class Meta:\r\n+ unique_together = (('project_data_set', 'state', 'start_date'),)\r\n+\r\ndiff --git a/tests/i18n/sampleproject/authors/tests.py b/tests/i18n/sampleproject/authors/tests.py\r\nnew file mode 100644\r\nindex 0000000000..7ce503c2dd\r\n--- /dev/null\r\n+++ b/tests/i18n/sampleproject/authors/tests.py\r\n@@ -0,0 +1,3 @@\r\n+from django.test import TestCase\r\n+\r\n+# Create your tests here.\r\ndiff --git a/tests/i18n/sampleproject/authors/views.py b/tests/i18n/sampleproject/authors/views.py\r\nnew file mode 100644\r\nindex 0000000000..91ea44a218\r\n--- /dev/null\r\n+++ b/tests/i18n/sampleproject/authors/views.py\r\n@@ -0,0 +1,3 @@\r\n+from django.shortcuts import render\r\n+\r\n+# Create your views here.\r\ndiff --git a/tests/i18n/sampleproject/db.sqlite3 b/tests/i18n/sampleproject/db.sqlite3\r\nnew file mode 100644\r\nindex 0000000000..92499e59ae\r\nBinary files /dev/null and b/tests/i18n/sampleproject/db.sqlite3 differ\r\ndiff --git a/tests/i18n/sampleproject/sampleproject/settings.py b/tests/i18n/sampleproject/sampleproject/settings.py\r\nindex e69de29bb2..3e2c845651 100644\r\n--- a/tests/i18n/sampleproject/sampleproject/settings.py\r\n+++ b/tests/i18n/sampleproject/sampleproject/settings.py\r\n@@ -0,0 +1,10 @@\r\n+SECRET_KEY = 'fake-key'\r\n+INSTALLED_APPS = []\r\n+\r\n+INSTALLED_APPS = ['authors']\r\n+DATABASES = {\r\n+ 'default': {\r\n+ 'ENGINE': 'django.db.backends.sqlite3',\r\n+ 'NAME': 'db.sqlite3',\r\n+ }\r\n+}\r\ndiff --git a/tests/migrations/migrations_test_apps/alter_fk/author_app/models.py b/tests/migrations/migrations_test_apps/alter_fk/author_app/models.py\r\nnew file mode 100644\r\nindex 0000000000..290af49445\r\n--- /dev/null\r\n+++ b/tests/migrations/migrations_test_apps/alter_fk/author_app/models.py\r\n@@ -0,0 +1,22 @@\r\n+from django.db import models\r\n+\r\n+class DataSet(models.Model):\r\n+ name = models.TextField(max_length=50)\r\n+\r\n+class Project(models.Model):\r\n+ data_sets = models.ManyToManyField(DataSet, through='ProjectDataSet')\r\n+ name = models.TextField(max_length=50)\r\n+\r\n+class ProjectDataSet(models.Model):\r\n+ data_set = models.ForeignKey(DataSet, on_delete=models.PROTECT)\r\n+ project = models.ForeignKey(Project, on_delete=models.PROTECT)\r\n+ class Meta:\r\n+ unique_together = (('data_set', 'project'),)\r\n+\r\n+class Authors(models.Model):\r\n+ project_data_set = models.ForeignKey(ProjectDataSet, on_delete=models.PROTECT)\r\n+ state = models.IntegerField()\r\n+ start_date = models.DateField()\r\n+ class Meta:\r\n+ unique_together = (('project_data_set', 'state', 'start_date'),)\r\n+", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "sympy__sympy-21612", "model_patch": "diff --git a/sympy/printing/str.py b/sympy/printing/str.py\r\nindex c3fdcdd435..3e4b7d1b19 100644\r\n--- a/sympy/printing/str.py\r\n+++ b/sympy/printing/str.py\r\n@@ -333,7 +333,7 @@ def apow(i):\r\n b.append(apow(item))\r\n else:\r\n if (len(item.args[0].args) != 1 and\r\n- isinstance(item.base, Mul)):\r\n+ isinstance(item.base, (Mul, Pow))):\r\n # To avoid situations like #14160\r\n pow_paren.append(item)\r\n b.append(item.base)\r\ndiff --git a/sympy/printing/tests/test_issue_sympy_21537.py b/sympy/printing/tests/test_issue_sympy_21537.py\r\nnew file mode 100644\r\nindex 0000000000..89930cc45e\r\n--- /dev/null\r\n+++ b/sympy/printing/tests/test_issue_sympy_21537.py\r\n@@ -0,0 +1,10 @@\r\n+from sympy import symbols, Mul, Pow\r\n+from sympy.parsing.latex import parse_latex\r\n+\r\n+def test_latex_parsing_issue_21537():\r\n+ x, y = symbols('x y')\r\n+ expr = parse_latex(\"\\\\frac{x}{\\\\frac{1}{y}}\")\r\n+ expected = Mul(x, Pow(y, -1, evaluate=False), evaluate=False)\r\n+ assert expr == expected\r\n+\r\n+# test_latex_parsing_issue_21537()", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "pytest-dev__pytest-11148", "model_patch": "diff --git a/testing/__init__.py b/testing/__init__.py\r\nnew file mode 100644\r\nindex 000000000..e69de29bb\r\ndiff --git a/testing/test_commands.py b/testing/test_commands.py\r\nnew file mode 100644\r\nindex 000000000..2117b6eb8\r\n--- /dev/null\r\n+++ b/testing/test_commands.py\r\n@@ -0,0 +1,14 @@\r\n+import sys\r\n+import os\r\n+sys.path.insert(0, os.path.dirname(__file__))\r\n+import pytest\r\n+from test_logging import Logger\r\n+\r\n+class TestCommands:\r\n+ @classmethod\r\n+ def setup_class(cls):\r\n+ Logger.initialize(store=[])\r\n+ Logger.message(\"logged\", \"testrunner\", \"some text\")\r\n+\r\n+ def test_logger_initialized(self):\r\n+ assert Logger.store is not None, \"Logger.store should be initialized.\"\r\ndiff --git a/testing/test_logging.py b/testing/test_logging.py\r\nnew file mode 100644\r\nindex 000000000..6833dde1c\r\n--- /dev/null\r\n+++ b/testing/test_logging.py\r\n@@ -0,0 +1,13 @@\r\n+class Logger:\r\n+ store = None\r\n+\r\n+ @classmethod\r\n+ def initialize(cls, store):\r\n+ cls.store = store\r\n+\r\n+ @classmethod\r\n+ def message(cls, channel, nick, text):\r\n+ if cls.store is None:\r\n+ raise ValueError('Logger not initialized with a store.')\r\n+ cls.store.append((channel, nick, text))\r\n+", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "sphinx-doc__sphinx-8282", "model_patch": "diff --git a/sphinx/ext/autodoc/typehints.py b/sphinx/ext/autodoc/typehints.py\r\nindex 4f81a6eae..67dbe278c 100644\r\n--- a/sphinx/ext/autodoc/typehints.py\r\n+++ b/sphinx/ext/autodoc/typehints.py\r\n@@ -21,6 +21,8 @@ from sphinx.application import Sphinx\r\n from sphinx.util import inspect, typing\r\n \r\n \r\n+from sphinx.pycode import ModuleAnalyzer, PycodeError\r\n+\r\n def record_typehints(app: Sphinx, objtype: str, name: str, obj: Any,\r\n options: Dict, args: str, retann: str) -> None:\r\n \"\"\"Record type hints to env object.\"\"\"\r\n@@ -28,14 +30,39 @@ def record_typehints(app: Sphinx, objtype: str, name: str, obj: Any,\r\n if callable(obj):\r\n annotations = app.env.temp_data.setdefault('annotations', {})\r\n annotation = annotations.setdefault(name, OrderedDict())\r\n- sig = inspect.signature(obj)\r\n- for param in sig.parameters.values():\r\n- if param.annotation is not param.empty:\r\n- annotation[param.name] = typing.stringify(param.annotation)\r\n- if sig.return_annotation is not sig.empty:\r\n- annotation['return'] = typing.stringify(sig.return_annotation)\r\n+ # Check if the object is overloaded and handle accordingly\r\n+ try:\r\n+ analyzer = ModuleAnalyzer.for_module(obj.__module__)\r\n+ analyzer.parse()\r\n+ qualname = obj.__qualname__\r\n+ if qualname in analyzer.overloads:\r\n+ # Record type hints for each overload\r\n+ for overload in analyzer.overloads[qualname]:\r\n+ sig = inspect.signature(overload)\r\n+ for param in sig.parameters.values():\r\n+ if param.annotation is not param.empty:\r\n+ annotation[param.name] = typing.stringify(param.annotation)\r\n+ if sig.return_annotation is not sig.empty:\r\n+ annotation['return'] = typing.stringify(sig.return_annotation)\r\n+ else:\r\n+ # Record type hints for non-overloaded functions\r\n+ sig = inspect.signature(obj)\r\n+ for param in sig.parameters.values():\r\n+ if param.annotation is not param.empty:\r\n+ annotation[param.name] = typing.stringify(param.annotation)\r\n+ if sig.return_annotation is not sig.empty:\r\n+ annotation['return'] = typing.stringify(sig.return_annotation)\r\n+ except (PycodeError, TypeError, ValueError):\r\n+ # If there's an error analyzing the module, fall back to non-overloaded handling\r\n+ sig = inspect.signature(obj)\r\n+ for param in sig.parameters.values():\r\n+ if param.annotation is not param.empty:\r\n+ annotation[param.name] = typing.stringify(param.annotation)\r\n+ if sig.return_annotation is not sig.empty:\r\n+ annotation['return'] = typing.stringify(sig.return_annotation)\r\n except (TypeError, ValueError):\r\n pass\r\n+ pass\r\n \r\n \r\n def merge_typehints(app: Sphinx, domain: str, objtype: str, contentnode: Element) -> None:", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" }, { "instance_id": "astropy__astropy-12907", "model_patch": "diff --git a/astropy/modeling/separable.py b/astropy/modeling/separable.py\r\nindex a308e2729..c6a3dae0e 100644\r\n--- a/astropy/modeling/separable.py\r\n+++ b/astropy/modeling/separable.py\r\n@@ -217,32 +217,26 @@ def _coord_matrix(model, pos, noutp):\r\n \r\n \r\n def _cstack(left, right):\r\n- \"\"\"\r\n- Function corresponding to '&' operation.\r\n-\r\n- Parameters\r\n- ----------\r\n- left, right : `astropy.modeling.Model` or ndarray\r\n- If input is of an array, it is the output of `coord_matrix`.\r\n-\r\n- Returns\r\n- -------\r\n- result : ndarray\r\n- Result from this operation.\r\n-\r\n- \"\"\"\r\n noutp = _compute_n_outputs(left, right)\r\n \r\n if isinstance(left, Model):\r\n cleft = _coord_matrix(left, 'left', noutp)\r\n else:\r\n- cleft = np.zeros((noutp, left.shape[1]))\r\n- cleft[: left.shape[0], : left.shape[1]] = left\r\n+ cleft = left\r\n+\r\n if isinstance(right, Model):\r\n cright = _coord_matrix(right, 'right', noutp)\r\n else:\r\n- cright = np.zeros((noutp, right.shape[1]))\r\n- cright[-right.shape[0]:, -right.shape[1]:] = 1\r\n+ cright = right\r\n+\r\n+ # Ensure the matrices have the correct shape before stacking\r\n+ if cleft.shape[1] != cright.shape[1]:\r\n+ # Pad the matrix with fewer columns with zeros on the right\r\n+ max_cols = max(cleft.shape[1], cright.shape[1])\r\n+ if cleft.shape[1] < max_cols:\r\n+ cleft = np.hstack([cleft, np.zeros((cleft.shape[0], max_cols - cleft.shape[1]))])\r\n+ else:\r\n+ cright = np.hstack([cright, np.zeros((cright.shape[0], max_cols - cright.shape[1]))])\r\n \r\n return np.hstack([cleft, cright])", - "model_name_or_path": "opendevin" + "model_name_or_path": "openhands" } ] diff --git a/evaluation/swe_bench/run_infer.py b/evaluation/swe_bench/run_infer.py index 089b6f0402..d350783612 100644 --- a/evaluation/swe_bench/run_infer.py +++ b/evaluation/swe_bench/run_infer.py @@ -19,18 +19,18 @@ from evaluation.utils.shared import ( reset_logger_for_multiprocessing, run_evaluation, ) -from opendevin.controller.state.state import State -from opendevin.core.config import ( +from openhands.controller.state.state import State +from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, parse_arguments, ) -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.main import create_runtime, run_controller -from opendevin.events.action import CmdRunAction -from opendevin.events.observation import CmdOutputObservation, ErrorObservation -from opendevin.runtime.runtime import Runtime +from openhands.core.logger import openhands_logger as logger +from openhands.core.main import create_runtime, run_controller +from openhands.events.action import CmdRunAction +from openhands.events.observation import CmdOutputObservation, ErrorObservation +from openhands.runtime.runtime import Runtime USE_HINT_TEXT = os.environ.get('USE_HINT_TEXT', 'false').lower() == 'true' USE_INSTANCE_IMAGE = os.environ.get('USE_INSTANCE_IMAGE', 'false').lower() == 'true' @@ -90,7 +90,7 @@ def get_config( instance: pd.Series, metadata: EvalMetadata, ) -> AppConfig: - SWE_BENCH_CONTAINER_IMAGE = 'ghcr.io/opendevin/eval-swe-bench:full-v1.2.1' + SWE_BENCH_CONTAINER_IMAGE = 'ghcr.io/openhands/eval-swe-bench:full-v1.2.1' if USE_INSTANCE_IMAGE: # We use a different instance image for the each instance of swe-bench eval container_image = 'sweb.eval.x86_64.' + instance['instance_id'] @@ -99,7 +99,7 @@ def get_config( config = AppConfig( default_agent=metadata.agent_class, - run_as_devin=False, + run_as_openhands=False, runtime='eventstream', max_budget_per_task=4, max_iterations=metadata.max_iterations, @@ -377,7 +377,7 @@ if __name__ == '__main__': args = parse_arguments() # NOTE: It is preferable to load datasets from huggingface datasets and perform post-processing - # so we don't need to manage file uploading to OpenDevin's repo + # so we don't need to manage file uploading to OpenHands's repo dataset = load_dataset('princeton-nlp/SWE-bench_Lite') swe_bench_tests = filter_dataset(dataset['test'].to_pandas(), 'instance_id') diff --git a/evaluation/swe_bench/scripts/docker/pull_all_eval_docker.sh b/evaluation/swe_bench/scripts/docker/pull_all_eval_docker.sh old mode 100755 new mode 100644 diff --git a/evaluation/swe_bench/scripts/eval/convert_od_output_to_swe_json.py b/evaluation/swe_bench/scripts/eval/convert_od_output_to_swe_json.py index 41d4fe6dae..81dbfc9a59 100644 --- a/evaluation/swe_bench/scripts/eval/convert_od_output_to_swe_json.py +++ b/evaluation/swe_bench/scripts/eval/convert_od_output_to_swe_json.py @@ -24,7 +24,7 @@ def process_git_patch(patch): patch = patch.replace('\r\n', '\n') # There might be some weird characters at the beginning of the patch - # due to some OpenDevin inference command outputs + # due to some OpenHands inference command outputs # FOR EXAMPLE: # git diff --no-color --cached 895f28f9cbed817c00ab68770433170d83132d90 diff --git a/evaluation/swe_bench/scripts/setup/compare_patch_filename.py b/evaluation/swe_bench/scripts/setup/compare_patch_filename.py old mode 100644 new mode 100755 index 048ac4ddc0..ed54440baa --- a/evaluation/swe_bench/scripts/setup/compare_patch_filename.py +++ b/evaluation/swe_bench/scripts/setup/compare_patch_filename.py @@ -1,5 +1,5 @@ -"""This script compares gold patches with OpenDevin-generated patches and check whether -OpenDevin found the right (set of) files to modify. +"""This script compares gold patches with OpenHands-generated patches and check whether +OpenHands found the right (set of) files to modify. """ import argparse diff --git a/evaluation/swe_bench/scripts/setup/instance_swe_entry.sh b/evaluation/swe_bench/scripts/setup/instance_swe_entry.sh old mode 100644 new mode 100755 index 1d4051fd84..3532152dc6 --- a/evaluation/swe_bench/scripts/setup/instance_swe_entry.sh +++ b/evaluation/swe_bench/scripts/setup/instance_swe_entry.sh @@ -13,7 +13,7 @@ source ~/.bashrc SWEUTIL_DIR=/swe_util # Create logs directory -LOG_DIR=/opendevin/logs +LOG_DIR=/openhands/logs mkdir -p $LOG_DIR && chmod 777 $LOG_DIR # FIXME: Cannot read SWE_INSTANCE_ID from the environment variable @@ -35,7 +35,7 @@ WORKSPACE_NAME=$(echo "$item" | jq -r '.repo + "__" + .version | gsub("/"; "__") echo "WORKSPACE_NAME: $WORKSPACE_NAME" -SWE_TASK_DIR=/opendevin/swe_tasks +SWE_TASK_DIR=/openhands/swe_tasks mkdir -p $SWE_TASK_DIR # Dump test_patch to /workspace/test.patch echo "$item" | jq -r '.test_patch' > $SWE_TASK_DIR/test.patch diff --git a/evaluation/swe_bench/scripts/setup/prepare_swe_utils.sh b/evaluation/swe_bench/scripts/setup/prepare_swe_utils.sh index d3601960b3..a70e07eda7 100755 --- a/evaluation/swe_bench/scripts/setup/prepare_swe_utils.sh +++ b/evaluation/swe_bench/scripts/setup/prepare_swe_utils.sh @@ -6,13 +6,13 @@ mkdir -p $EVAL_WORKSPACE # 1. Prepare REPO echo "==== Prepare SWE-bench repo ====" -OD_SWE_BENCH_REPO_PATH="https://github.com/OpenDevin/OD-SWE-bench.git" +OD_SWE_BENCH_REPO_PATH="https://github.com/All-Hands-AI/OD-SWE-bench.git" OD_SWE_BENCH_REPO_BRANCH="eval" git clone -b $OD_SWE_BENCH_REPO_BRANCH $OD_SWE_BENCH_REPO_PATH $EVAL_WORKSPACE/OD-SWE-bench # 2. Prepare DATA echo "==== Prepare SWE-bench data ====" -EVAL_IMAGE=ghcr.io/opendevin/eval-swe-bench:builder_with_conda +EVAL_IMAGE=ghcr.io/openhands/eval-swe-bench:builder_with_conda EVAL_WORKSPACE=$(realpath $EVAL_WORKSPACE) chmod +x $EVAL_WORKSPACE/OD-SWE-bench/swebench/harness/prepare_data.sh if [ -d $EVAL_WORKSPACE/eval_data ]; then diff --git a/evaluation/swe_bench/scripts/setup/swe_entry.sh b/evaluation/swe_bench/scripts/setup/swe_entry.sh index b3ec157d99..1714119ef0 100755 --- a/evaluation/swe_bench/scripts/setup/swe_entry.sh +++ b/evaluation/swe_bench/scripts/setup/swe_entry.sh @@ -13,7 +13,7 @@ source ~/.bashrc SWEUTIL_DIR=/swe_util # Create logs directory -LOG_DIR=/opendevin/logs +LOG_DIR=/openhands/logs mkdir -p $LOG_DIR && chmod 777 $LOG_DIR # FIXME: Cannot read SWE_INSTANCE_ID from the environment variable @@ -35,7 +35,7 @@ CONDA_ENV_NAME=$(echo "$item" | jq -r '.repo + "__" + .version | gsub("/"; "__") echo "CONDA_ENV_NAME: $CONDA_ENV_NAME" -SWE_TASK_DIR=/opendevin/swe_tasks +SWE_TASK_DIR=/openhands/swe_tasks mkdir -p $SWE_TASK_DIR # Dump test_patch to /workspace/test.patch echo "$item" | jq -r '.test_patch' > $SWE_TASK_DIR/test.patch diff --git a/evaluation/toolqa/README.md b/evaluation/toolqa/README.md index 9e9dba3915..07f74645e2 100644 --- a/evaluation/toolqa/README.md +++ b/evaluation/toolqa/README.md @@ -1,4 +1,4 @@ -# ToolQA Evaluation with OpenDevin +# ToolQA Evaluation with OpenHands This folder contains an evaluation harness we built on top of the original [ToolQA](https://github.com/night-chen/ToolQA) ([paper](https://arxiv.org/pdf/2306.13304)). @@ -19,7 +19,7 @@ where `model_config` is mandatory, while all other arguments are optional. `model_config`, e.g. `llm`, is the config group name for your LLM settings, as defined in your `config.toml`. -`git-version`, e.g. `HEAD`, is the git commit hash of the OpenDevin version you would +`git-version`, e.g. `HEAD`, is the git commit hash of the OpenHands version you would like to evaluate. It could also be a release tag like `0.6.2`. `agent`, e.g. `CodeActAgent`, is the name of the agent for benchmarks, defaulting diff --git a/evaluation/toolqa/run_infer.py b/evaluation/toolqa/run_infer.py index 930f1199e6..8b5906c0e5 100644 --- a/evaluation/toolqa/run_infer.py +++ b/evaluation/toolqa/run_infer.py @@ -14,18 +14,18 @@ from evaluation.utils.shared import ( reset_logger_for_multiprocessing, run_evaluation, ) -from opendevin.controller.state.state import State -from opendevin.core.config import ( +from openhands.controller.state.state import State +from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, get_parser, ) -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.main import create_runtime, run_controller -from opendevin.events.action import CmdRunAction -from opendevin.events.observation import CmdOutputObservation -from opendevin.runtime.runtime import Runtime +from openhands.core.logger import openhands_logger as logger +from openhands.core.main import create_runtime, run_controller +from openhands.events.action import CmdRunAction +from openhands.events.observation import CmdOutputObservation +from openhands.runtime.runtime import Runtime AGENT_CLS_TO_FAKE_USER_RESPONSE_FN = { 'CodeActAgent': codeact_user_response, @@ -41,7 +41,7 @@ def get_config( ) -> AppConfig: config = AppConfig( default_agent=metadata.agent_class, - run_as_devin=False, + run_as_openhands=False, runtime='eventstream', max_iterations=metadata.max_iterations, sandbox=SandboxConfig( diff --git a/evaluation/toolqa/scripts/run_infer.sh b/evaluation/toolqa/scripts/run_infer.sh old mode 100644 new mode 100755 diff --git a/evaluation/utils/shared.py b/evaluation/utils/shared.py index 771157f155..a27ff5e3c1 100644 --- a/evaluation/utils/shared.py +++ b/evaluation/utils/shared.py @@ -13,12 +13,12 @@ import pandas as pd from pydantic import BaseModel from tqdm import tqdm -from opendevin.controller.state.state import State -from opendevin.core.config import LLMConfig -from opendevin.core.logger import get_console_handler -from opendevin.core.logger import opendevin_logger as logger -from opendevin.events.action import Action -from opendevin.events.action.message import MessageAction +from openhands.controller.state.state import State +from openhands.core.config import LLMConfig +from openhands.core.logger import get_console_handler +from openhands.core.logger import openhands_logger as logger +from openhands.events.action import Action +from openhands.events.action.message import MessageAction class EvalMetadata(BaseModel): diff --git a/evaluation/utils/version_control.sh b/evaluation/utils/version_control.sh index 2ab2ada484..1fc59250cb 100644 --- a/evaluation/utils/version_control.sh +++ b/evaluation/utils/version_control.sh @@ -9,14 +9,14 @@ checkout_eval_branch() { return 0 fi - echo "Start to checkout opendevin version to $COMMIT_HASH, but keep current evaluation harness" + echo "Start to checkout openhands version to $COMMIT_HASH, but keep current evaluation harness" if ! git diff-index --quiet HEAD --; then echo "There are uncommitted changes, please stash or commit them first" exit 1 fi current_branch=$(git rev-parse --abbrev-ref HEAD) echo "Current version is: $current_branch" - echo "Check out OpenDevin to version: $COMMIT_HASH" + echo "Check out OpenHands to version: $COMMIT_HASH" if ! git checkout $COMMIT_HASH; then echo "Failed to check out to $COMMIT_HASH" exit 1 @@ -40,7 +40,7 @@ checkout_original_branch() { } get_agent_version() { - # IMPORTANT: Because Agent's prompt changes fairly often in the rapidly evolving codebase of OpenDevin + # 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 opendevin.controller.agent import Agent; print(Agent.get_cls('$AGENT').VERSION)") + AGENT_VERSION=v$(poetry run python -c "import agenthub; from openhands.controller.agent import Agent; print(Agent.get_cls('$AGENT').VERSION)") } diff --git a/evaluation/webarena/README.md b/evaluation/webarena/README.md index 2ed3f214ba..3467465eb7 100644 --- a/evaluation/webarena/README.md +++ b/evaluation/webarena/README.md @@ -1,4 +1,4 @@ -# WebArena Evaluation with OpenDevin Browsing Agents +# WebArena Evaluation with OpenHands Browsing Agents This folder contains evaluation for [WebArena](https://github.com/web-arena-x/webarena) benchmark, powered by [BrowserGym](https://github.com/ServiceNow/BrowserGym) for easy evaluation of how well an agent capable of browsing can perform on realistic web browsing tasks. @@ -7,7 +7,7 @@ This folder contains evaluation for [WebArena](https://github.com/web-arena-x/we Please follow instruction [here](../README.md#setup) to setup your local development environment and LLM. ## Setup WebArena Environment -WebArena requires you to set up websites containing pre-populated content that is accessible via URL to the machine running the OpenDevin agents. +WebArena requires you to set up websites containing pre-populated content that is accessible via URL to the machine running the OpenHands agents. Follow [this document](https://github.com/web-arena-x/webarena/blob/main/environment_docker/README.md) to set up your own WebArena environment through local servers or AWS EC2 instances. Take note of the base URL (`$WEBARENA_BASE_URL`) of the machine where the environment is installed. @@ -36,7 +36,7 @@ poetry run python evaluation/webarena/get_success_rate.py evaluation/evaluation_ ## Submit your evaluation results -You can start your own fork of [our huggingface evaluation outputs](https://huggingface.co/spaces/OpenDevin/evaluation) and submit a PR of your evaluation results following the guide [here](https://huggingface.co/docs/hub/en/repositories-pull-requests-discussions#pull-requests-and-discussions). +You can start your own fork of [our huggingface evaluation outputs](https://huggingface.co/spaces/OpenHands/evaluation) and submit a PR of your evaluation results following the guide [here](https://huggingface.co/docs/hub/en/repositories-pull-requests-discussions#pull-requests-and-discussions). ## BrowsingAgent V1.0 result diff --git a/evaluation/webarena/run_infer.py b/evaluation/webarena/run_infer.py index f661a147c9..78448b99a7 100644 --- a/evaluation/webarena/run_infer.py +++ b/evaluation/webarena/run_infer.py @@ -15,26 +15,26 @@ from evaluation.utils.shared import ( reset_logger_for_multiprocessing, run_evaluation, ) -from opendevin.controller.state.state import State -from opendevin.core.config import ( +from openhands.controller.state.state import State +from openhands.core.config import ( AppConfig, SandboxConfig, get_llm_config_arg, parse_arguments, ) -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.main import create_runtime, run_controller -from opendevin.events.action import ( +from openhands.core.logger import openhands_logger as logger +from openhands.core.main import create_runtime, run_controller +from openhands.events.action import ( BrowseInteractiveAction, CmdRunAction, MessageAction, ) -from opendevin.events.observation import CmdOutputObservation -from opendevin.runtime.browser.browser_env import ( +from openhands.events.observation import CmdOutputObservation +from openhands.runtime.browser.browser_env import ( BROWSER_EVAL_GET_GOAL_ACTION, BROWSER_EVAL_GET_REWARDS_ACTION, ) -from opendevin.runtime.runtime import Runtime +from openhands.runtime.runtime import Runtime SUPPORTED_AGENT_CLS = {'BrowsingAgent'} @@ -50,7 +50,7 @@ def get_config( config = AppConfig( default_agent=metadata.agent_class, - run_as_devin=False, + run_as_openhands=False, runtime='eventstream', max_iterations=metadata.max_iterations, sandbox=SandboxConfig( diff --git a/evaluation/webarena/scripts/run_infer.sh b/evaluation/webarena/scripts/run_infer.sh old mode 100644 new mode 100755 diff --git a/frontend/README.md b/frontend/README.md index 4e6b58c79f..5a9a5b9771 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,4 +1,4 @@ -# Getting Started with the OpenDevin Frontend +# Getting Started with the OpenHands Frontend The frontend code can be run against the docker image defined in the [Main README](../README.md) as a backend diff --git a/frontend/index.html b/frontend/index.html index 299acf0d17..3e25fa66d7 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -13,7 +13,7 @@ - OpenDevin + OpenHands diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 5b879e21a1..f9b109f126 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,11 +1,11 @@ { - "name": "opendevin-frontend", + "name": "openhands-frontend", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "opendevin-frontend", + "name": "openhands-frontend", "version": "0.1.0", "dependencies": { "@monaco-editor/react": "^4.6.0", diff --git a/frontend/package.json b/frontend/package.json index 8d05c9fc9b..392bb49c05 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,5 +1,5 @@ { - "name": "opendevin-frontend", + "name": "openhands-frontend", "version": "0.1.0", "private": true, "type": "module", diff --git a/frontend/src/components/modals/feedback/FeedbackModal.tsx b/frontend/src/components/modals/feedback/FeedbackModal.tsx index 6b462ae4a5..e4f7c39d11 100644 --- a/frontend/src/components/modals/feedback/FeedbackModal.tsx +++ b/frontend/src/components/modals/feedback/FeedbackModal.tsx @@ -16,7 +16,7 @@ const isEmailValid = (email: string) => { return emailRegex.test(email); }; -const VIEWER_PAGE = "https://www.all-hands.dev/share-opendevin"; +const VIEWER_PAGE = "https://www.all-hands.dev/share-openhands"; const FEEDBACK_VERSION = "1.0"; interface FeedbackModalProps { diff --git a/frontend/src/components/modals/security/invariant/Invariant.tsx b/frontend/src/components/modals/security/invariant/Invariant.tsx index fbd7340e8c..8372ae4743 100644 --- a/frontend/src/components/modals/security/invariant/Invariant.tsx +++ b/frontend/src/components/modals/security/invariant/Invariant.tsx @@ -125,7 +125,7 @@ function SecurityInvariant(): JSX.Element { const data = await request(`/api/security/export-trace`); toast.info("Trace exported"); - const filename = `opendevin-trace-${getFormattedDateTime()}.json`; + const filename = `openhands-trace-${getFormattedDateTime()}.json`; downloadJSON(data, filename); } @@ -281,7 +281,7 @@ function SecurityInvariant(): JSX.Element { Invariant Analyzer

- Invariant Analyzer continuously monitors your OpenDevin agent for + Invariant Analyzer continuously monitors your OpenHands agent for security issues.{" "} State | None: """Main coroutine to run the agent controller with task input flexibility. - It's only used when you launch opendevin backend directly via cmdline. + It's only used when you launch openhands backend directly via cmdline. Args: config: The app config. diff --git a/opendevin/core/message.py b/openhands/core/message.py similarity index 100% rename from opendevin/core/message.py rename to openhands/core/message.py diff --git a/opendevin/core/metrics.py b/openhands/core/metrics.py similarity index 100% rename from opendevin/core/metrics.py rename to openhands/core/metrics.py diff --git a/opendevin/core/schema/__init__.py b/openhands/core/schema/__init__.py similarity index 100% rename from opendevin/core/schema/__init__.py rename to openhands/core/schema/__init__.py diff --git a/opendevin/core/schema/action.py b/openhands/core/schema/action.py similarity index 100% rename from opendevin/core/schema/action.py rename to openhands/core/schema/action.py diff --git a/opendevin/core/schema/agent.py b/openhands/core/schema/agent.py similarity index 100% rename from opendevin/core/schema/agent.py rename to openhands/core/schema/agent.py diff --git a/opendevin/core/schema/config.py b/openhands/core/schema/config.py similarity index 97% rename from opendevin/core/schema/config.py rename to openhands/core/schema/config.py index 2cb42bcb76..b1b19f4b23 100644 --- a/opendevin/core/schema/config.py +++ b/openhands/core/schema/config.py @@ -23,7 +23,7 @@ class ConfigType(str, Enum): LLM_MODEL = 'LLM_MODEL' CONFIRMATION_MODE = 'CONFIRMATION_MODE' SANDBOX_CONTAINER_IMAGE = 'SANDBOX_CONTAINER_IMAGE' - RUN_AS_DEVIN = 'RUN_AS_DEVIN' + RUN_AS_OPENHANDS = 'RUN_AS_OPENHANDS' LLM_EMBEDDING_MODEL = 'LLM_EMBEDDING_MODEL' LLM_EMBEDDING_BASE_URL = 'LLM_EMBEDDING_BASE_URL' LLM_EMBEDDING_DEPLOYMENT_NAME = 'LLM_EMBEDDING_DEPLOYMENT_NAME' diff --git a/opendevin/core/schema/observation.py b/openhands/core/schema/observation.py similarity index 100% rename from opendevin/core/schema/observation.py rename to openhands/core/schema/observation.py diff --git a/opendevin/core/utils/__init__.py b/openhands/core/utils/__init__.py similarity index 100% rename from opendevin/core/utils/__init__.py rename to openhands/core/utils/__init__.py diff --git a/opendevin/core/utils/json.py b/openhands/core/utils/json.py similarity index 90% rename from opendevin/core/utils/json.py rename to openhands/core/utils/json.py index c90ea543f0..cec1fe8163 100644 --- a/opendevin/core/utils/json.py +++ b/openhands/core/utils/json.py @@ -3,9 +3,9 @@ from datetime import datetime from json_repair import repair_json -from opendevin.core.exceptions import LLMResponseError -from opendevin.events.event import Event -from opendevin.events.serialization import event_to_dict +from openhands.core.exceptions import LLMResponseError +from openhands.events.event import Event +from openhands.events.serialization import event_to_dict def my_default_encoder(obj): diff --git a/opendevin/core/utils/singleton.py b/openhands/core/utils/singleton.py similarity index 88% rename from opendevin/core/utils/singleton.py rename to openhands/core/utils/singleton.py index 7cf25ad62f..dcaaf6583c 100644 --- a/opendevin/core/utils/singleton.py +++ b/openhands/core/utils/singleton.py @@ -1,5 +1,7 @@ import dataclasses -from opendevin.core import logger + +from openhands.core import logger + class Singleton(type): _instances: dict = {} @@ -16,7 +18,9 @@ class Singleton(type): if hasattr(instance, key): setattr(instance, key, value) else: - logger.opendevin_logger.warning(f'Unknown key for {cls.__name__}: "{key}"') + logger.openhands_logger.warning( + f'Unknown key for {cls.__name__}: "{key}"' + ) return cls._instances[cls] @classmethod diff --git a/opendevin/events/__init__.py b/openhands/events/__init__.py similarity index 100% rename from opendevin/events/__init__.py rename to openhands/events/__init__.py diff --git a/opendevin/events/action/__init__.py b/openhands/events/action/__init__.py similarity index 100% rename from opendevin/events/action/__init__.py rename to openhands/events/action/__init__.py diff --git a/opendevin/events/action/action.py b/openhands/events/action/action.py similarity index 81% rename from opendevin/events/action/action.py rename to openhands/events/action/action.py index 2a2b261c01..0605af7ed5 100644 --- a/opendevin/events/action/action.py +++ b/openhands/events/action/action.py @@ -2,19 +2,22 @@ from dataclasses import dataclass from enum import Enum from typing import ClassVar -from opendevin.events.event import Event +from openhands.events.event import Event + class ActionConfirmationStatus(str, Enum): CONFIRMED = 'confirmed' REJECTED = 'rejected' AWAITING_CONFIRMATION = 'awaiting_confirmation' + class ActionSecurityRisk(int, Enum): UNKNOWN = -1 LOW = 0 MEDIUM = 1 HIGH = 2 + @dataclass class Action(Event): - runnable: ClassVar[bool] = False \ No newline at end of file + runnable: ClassVar[bool] = False diff --git a/opendevin/events/action/agent.py b/openhands/events/action/agent.py similarity index 97% rename from opendevin/events/action/agent.py rename to openhands/events/action/agent.py index d57e02b038..e4b57dc5e9 100644 --- a/opendevin/events/action/agent.py +++ b/openhands/events/action/agent.py @@ -1,7 +1,7 @@ from dataclasses import dataclass, field from typing import Any -from opendevin.core.schema import ActionType +from openhands.core.schema import ActionType from .action import Action diff --git a/opendevin/events/action/browse.py b/openhands/events/action/browse.py similarity index 96% rename from opendevin/events/action/browse.py rename to openhands/events/action/browse.py index 943cf7fd08..f3e949c021 100644 --- a/opendevin/events/action/browse.py +++ b/openhands/events/action/browse.py @@ -1,7 +1,7 @@ from dataclasses import dataclass from typing import ClassVar -from opendevin.core.schema import ActionType +from openhands.core.schema import ActionType from .action import Action, ActionSecurityRisk diff --git a/opendevin/events/action/commands.py b/openhands/events/action/commands.py similarity index 97% rename from opendevin/events/action/commands.py rename to openhands/events/action/commands.py index 21f06b339e..848aae23c2 100644 --- a/opendevin/events/action/commands.py +++ b/openhands/events/action/commands.py @@ -1,7 +1,7 @@ from dataclasses import dataclass from typing import ClassVar -from opendevin.core.schema import ActionType +from openhands.core.schema import ActionType from .action import Action, ActionConfirmationStatus, ActionSecurityRisk @@ -54,4 +54,4 @@ class IPythonRunCellAction(Action): @property def message(self) -> str: - return f'Running Python code interactively: {self.code}' \ No newline at end of file + return f'Running Python code interactively: {self.code}' diff --git a/opendevin/events/action/empty.py b/openhands/events/action/empty.py similarity index 84% rename from opendevin/events/action/empty.py rename to openhands/events/action/empty.py index 9d50e24db9..1cb885ce05 100644 --- a/opendevin/events/action/empty.py +++ b/openhands/events/action/empty.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from opendevin.core.schema import ActionType +from openhands.core.schema import ActionType from .action import Action diff --git a/opendevin/events/action/files.py b/openhands/events/action/files.py similarity index 95% rename from opendevin/events/action/files.py rename to openhands/events/action/files.py index d50081f588..dd1bf277cc 100644 --- a/opendevin/events/action/files.py +++ b/openhands/events/action/files.py @@ -1,7 +1,7 @@ from dataclasses import dataclass from typing import ClassVar -from opendevin.core.schema import ActionType +from openhands.core.schema import ActionType from .action import Action, ActionSecurityRisk diff --git a/opendevin/events/action/message.py b/openhands/events/action/message.py similarity index 93% rename from opendevin/events/action/message.py rename to openhands/events/action/message.py index b9d1a55165..d0586330ea 100644 --- a/opendevin/events/action/message.py +++ b/openhands/events/action/message.py @@ -1,9 +1,10 @@ from dataclasses import dataclass -from opendevin.core.schema import ActionType +from openhands.core.schema import ActionType from .action import Action, ActionSecurityRisk + @dataclass class MessageAction(Action): content: str diff --git a/opendevin/events/action/tasks.py b/openhands/events/action/tasks.py similarity index 92% rename from opendevin/events/action/tasks.py rename to openhands/events/action/tasks.py index d6c3137f6d..95df784d35 100644 --- a/opendevin/events/action/tasks.py +++ b/openhands/events/action/tasks.py @@ -1,6 +1,6 @@ from dataclasses import dataclass, field -from opendevin.core.schema import ActionType +from openhands.core.schema import ActionType from .action import Action diff --git a/opendevin/events/event.py b/openhands/events/event.py similarity index 100% rename from opendevin/events/event.py rename to openhands/events/event.py diff --git a/opendevin/events/observation/__init__.py b/openhands/events/observation/__init__.py similarity index 100% rename from opendevin/events/observation/__init__.py rename to openhands/events/observation/__init__.py diff --git a/opendevin/events/observation/agent.py b/openhands/events/observation/agent.py similarity index 87% rename from opendevin/events/observation/agent.py rename to openhands/events/observation/agent.py index 43ea0184b2..f18010e8da 100644 --- a/opendevin/events/observation/agent.py +++ b/openhands/events/observation/agent.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from opendevin.core.schema import ObservationType +from openhands.core.schema import ObservationType from .observation import Observation diff --git a/opendevin/events/observation/browse.py b/openhands/events/observation/browse.py similarity index 96% rename from opendevin/events/observation/browse.py rename to openhands/events/observation/browse.py index 901b9ffb75..f110f382a9 100644 --- a/opendevin/events/observation/browse.py +++ b/openhands/events/observation/browse.py @@ -1,6 +1,6 @@ from dataclasses import dataclass, field -from opendevin.core.schema import ObservationType +from openhands.core.schema import ObservationType from .observation import Observation diff --git a/opendevin/events/observation/commands.py b/openhands/events/observation/commands.py similarity index 95% rename from opendevin/events/observation/commands.py rename to openhands/events/observation/commands.py index cc019e6135..1ca7d09451 100644 --- a/opendevin/events/observation/commands.py +++ b/openhands/events/observation/commands.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from opendevin.core.schema import ObservationType +from openhands.core.schema import ObservationType from .observation import Observation diff --git a/opendevin/events/observation/delegate.py b/openhands/events/observation/delegate.py similarity index 91% rename from opendevin/events/observation/delegate.py rename to openhands/events/observation/delegate.py index c50a0a37da..d5c68278fd 100644 --- a/opendevin/events/observation/delegate.py +++ b/openhands/events/observation/delegate.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from opendevin.core.schema import ObservationType +from openhands.core.schema import ObservationType from .observation import Observation diff --git a/opendevin/events/observation/empty.py b/openhands/events/observation/empty.py similarity index 88% rename from opendevin/events/observation/empty.py rename to openhands/events/observation/empty.py index 5558625f8a..3dcfe3ead9 100644 --- a/opendevin/events/observation/empty.py +++ b/openhands/events/observation/empty.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from opendevin.core.schema import ObservationType +from openhands.core.schema import ObservationType from .observation import Observation diff --git a/opendevin/events/observation/error.py b/openhands/events/observation/error.py similarity index 86% rename from opendevin/events/observation/error.py rename to openhands/events/observation/error.py index dcd0cc9970..348b898be0 100644 --- a/opendevin/events/observation/error.py +++ b/openhands/events/observation/error.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from opendevin.core.schema import ObservationType +from openhands.core.schema import ObservationType from .observation import Observation diff --git a/opendevin/events/observation/files.py b/openhands/events/observation/files.py similarity index 92% rename from opendevin/events/observation/files.py rename to openhands/events/observation/files.py index 4a2b70e32e..a1fc178f7a 100644 --- a/opendevin/events/observation/files.py +++ b/openhands/events/observation/files.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from opendevin.core.schema import ObservationType +from openhands.core.schema import ObservationType from .observation import Observation diff --git a/opendevin/events/observation/observation.py b/openhands/events/observation/observation.py similarity index 68% rename from opendevin/events/observation/observation.py rename to openhands/events/observation/observation.py index 76da5ed196..46f8a0e712 100644 --- a/opendevin/events/observation/observation.py +++ b/openhands/events/observation/observation.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from opendevin.events.event import Event +from openhands.events.event import Event @dataclass diff --git a/opendevin/events/observation/reject.py b/openhands/events/observation/reject.py similarity index 86% rename from opendevin/events/observation/reject.py rename to openhands/events/observation/reject.py index 2bb34ba48f..2d97f853ef 100644 --- a/opendevin/events/observation/reject.py +++ b/openhands/events/observation/reject.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from opendevin.core.schema import ObservationType +from openhands.core.schema import ObservationType from .observation import Observation diff --git a/opendevin/events/observation/success.py b/openhands/events/observation/success.py similarity index 86% rename from opendevin/events/observation/success.py rename to openhands/events/observation/success.py index 40f4f4c7d6..269fe2345b 100644 --- a/opendevin/events/observation/success.py +++ b/openhands/events/observation/success.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from opendevin.core.schema import ObservationType +from openhands.core.schema import ObservationType from .observation import Observation diff --git a/opendevin/events/serialization/__init__.py b/openhands/events/serialization/__init__.py similarity index 100% rename from opendevin/events/serialization/__init__.py rename to openhands/events/serialization/__init__.py diff --git a/opendevin/events/serialization/action.py b/openhands/events/serialization/action.py similarity index 76% rename from opendevin/events/serialization/action.py rename to openhands/events/serialization/action.py index 2465f0b5d6..05638526fb 100644 --- a/opendevin/events/serialization/action.py +++ b/openhands/events/serialization/action.py @@ -1,20 +1,20 @@ -from opendevin.core.exceptions import LLMMalformedActionError -from opendevin.events.action.action import Action -from opendevin.events.action.agent import ( +from openhands.core.exceptions import LLMMalformedActionError +from openhands.events.action.action import Action +from openhands.events.action.agent import ( AgentDelegateAction, AgentFinishAction, AgentRejectAction, ChangeAgentStateAction, ) -from opendevin.events.action.browse import BrowseInteractiveAction, BrowseURLAction -from opendevin.events.action.commands import ( +from openhands.events.action.browse import BrowseInteractiveAction, BrowseURLAction +from openhands.events.action.commands import ( CmdRunAction, IPythonRunCellAction, ) -from opendevin.events.action.empty import NullAction -from opendevin.events.action.files import FileReadAction, FileWriteAction -from opendevin.events.action.message import MessageAction -from opendevin.events.action.tasks import AddTaskAction, ModifyTaskAction +from openhands.events.action.empty import NullAction +from openhands.events.action.files import FileReadAction, FileWriteAction +from openhands.events.action.message import MessageAction +from openhands.events.action.tasks import AddTaskAction, ModifyTaskAction actions = ( NullAction, diff --git a/opendevin/events/serialization/event.py b/openhands/events/serialization/event.py similarity index 96% rename from opendevin/events/serialization/event.py rename to openhands/events/serialization/event.py index 652e307089..9645c90df3 100644 --- a/opendevin/events/serialization/event.py +++ b/openhands/events/serialization/event.py @@ -1,8 +1,8 @@ from dataclasses import asdict from datetime import datetime -from opendevin.events import Event, EventSource -from opendevin.events.observation.observation import Observation +from openhands.events import Event, EventSource +from openhands.events.observation.observation import Observation from .action import action_from_dict from .observation import observation_from_dict diff --git a/opendevin/events/serialization/observation.py b/openhands/events/serialization/observation.py similarity index 67% rename from opendevin/events/serialization/observation.py rename to openhands/events/serialization/observation.py index 37183e9a21..1ffbc645a2 100644 --- a/opendevin/events/serialization/observation.py +++ b/openhands/events/serialization/observation.py @@ -1,16 +1,16 @@ -from opendevin.events.observation.agent import AgentStateChangedObservation -from opendevin.events.observation.browse import BrowserOutputObservation -from opendevin.events.observation.commands import ( +from openhands.events.observation.agent import AgentStateChangedObservation +from openhands.events.observation.browse import BrowserOutputObservation +from openhands.events.observation.commands import ( CmdOutputObservation, IPythonRunCellObservation, ) -from opendevin.events.observation.delegate import AgentDelegateObservation -from opendevin.events.observation.empty import NullObservation -from opendevin.events.observation.error import ErrorObservation -from opendevin.events.observation.files import FileReadObservation, FileWriteObservation -from opendevin.events.observation.observation import Observation -from opendevin.events.observation.reject import UserRejectObservation -from opendevin.events.observation.success import SuccessObservation +from openhands.events.observation.delegate import AgentDelegateObservation +from openhands.events.observation.empty import NullObservation +from openhands.events.observation.error import ErrorObservation +from openhands.events.observation.files import FileReadObservation, FileWriteObservation +from openhands.events.observation.observation import Observation +from openhands.events.observation.reject import UserRejectObservation +from openhands.events.observation.success import SuccessObservation observations = ( NullObservation, diff --git a/opendevin/events/serialization/utils.py b/openhands/events/serialization/utils.py similarity index 100% rename from opendevin/events/serialization/utils.py rename to openhands/events/serialization/utils.py diff --git a/opendevin/events/stream.py b/openhands/events/stream.py similarity index 96% rename from opendevin/events/stream.py rename to openhands/events/stream.py index 62a9e919fa..c04de94b03 100644 --- a/opendevin/events/stream.py +++ b/openhands/events/stream.py @@ -4,10 +4,10 @@ from datetime import datetime from enum import Enum from typing import Callable, Iterable -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.utils import json -from opendevin.events.serialization.event import event_from_dict, event_to_dict -from opendevin.storage import FileStore +from openhands.core.logger import openhands_logger as logger +from openhands.core.utils import json +from openhands.events.serialization.event import event_from_dict, event_to_dict +from openhands.storage import FileStore from .event import Event, EventSource diff --git a/opendevin/llm/bedrock.py b/openhands/llm/bedrock.py similarity index 94% rename from opendevin/llm/bedrock.py rename to openhands/llm/bedrock.py index 7e276c52b4..2f32b2d79e 100644 --- a/opendevin/llm/bedrock.py +++ b/openhands/llm/bedrock.py @@ -1,6 +1,6 @@ import boto3 -from opendevin.core.logger import opendevin_logger as logger +from openhands.core.logger import openhands_logger as logger def list_foundation_models( diff --git a/opendevin/llm/llm.py b/openhands/llm/llm.py similarity index 98% rename from opendevin/llm/llm.py rename to openhands/llm/llm.py index 8413a70d23..b42c27caf1 100644 --- a/opendevin/llm/llm.py +++ b/openhands/llm/llm.py @@ -3,7 +3,7 @@ import copy import warnings from functools import partial -from opendevin.core.config import LLMConfig +from openhands.core.config import LLMConfig with warnings.catch_warnings(): warnings.simplefilter('ignore') @@ -26,10 +26,10 @@ from tenacity import ( wait_random_exponential, ) -from opendevin.core.exceptions import UserCancelledError -from opendevin.core.logger import llm_prompt_logger, llm_response_logger -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.metrics import Metrics +from openhands.core.exceptions import UserCancelledError +from openhands.core.logger import llm_prompt_logger, llm_response_logger +from openhands.core.logger import openhands_logger as logger +from openhands.core.metrics import Metrics __all__ = ['LLM'] diff --git a/opendevin/memory/README.md b/openhands/memory/README.md similarity index 100% rename from opendevin/memory/README.md rename to openhands/memory/README.md diff --git a/opendevin/memory/__init__.py b/openhands/memory/__init__.py similarity index 100% rename from opendevin/memory/__init__.py rename to openhands/memory/__init__.py diff --git a/opendevin/memory/condenser.py b/openhands/memory/condenser.py similarity index 89% rename from opendevin/memory/condenser.py rename to openhands/memory/condenser.py index e0cef4ac38..bd48d18430 100644 --- a/opendevin/memory/condenser.py +++ b/openhands/memory/condenser.py @@ -1,5 +1,5 @@ -from opendevin.core.logger import opendevin_logger as logger -from opendevin.llm.llm import LLM +from openhands.core.logger import openhands_logger as logger +from openhands.llm.llm import LLM class MemoryCondenser: diff --git a/opendevin/memory/history.py b/openhands/memory/history.py similarity index 92% rename from opendevin/memory/history.py rename to openhands/memory/history.py index cbe186f387..7b0bc3a7da 100644 --- a/opendevin/memory/history.py +++ b/openhands/memory/history.py @@ -1,21 +1,21 @@ from typing import ClassVar, Iterable -from opendevin.core.logger import opendevin_logger as logger -from opendevin.events.action.action import Action -from opendevin.events.action.agent import ( +from openhands.core.logger import openhands_logger as logger +from openhands.events.action.action import Action +from openhands.events.action.agent import ( AgentDelegateAction, ChangeAgentStateAction, ) -from opendevin.events.action.empty import NullAction -from opendevin.events.action.message import MessageAction -from opendevin.events.event import Event, EventSource -from opendevin.events.observation.agent import AgentStateChangedObservation -from opendevin.events.observation.commands import CmdOutputObservation -from opendevin.events.observation.delegate import AgentDelegateObservation -from opendevin.events.observation.empty import NullObservation -from opendevin.events.observation.observation import Observation -from opendevin.events.serialization.event import event_to_dict -from opendevin.events.stream import EventStream +from openhands.events.action.empty import NullAction +from openhands.events.action.message import MessageAction +from openhands.events.event import Event, EventSource +from openhands.events.observation.agent import AgentStateChangedObservation +from openhands.events.observation.commands import CmdOutputObservation +from openhands.events.observation.delegate import AgentDelegateObservation +from openhands.events.observation.empty import NullObservation +from openhands.events.observation.observation import Observation +from openhands.events.serialization.event import event_to_dict +from openhands.events.stream import EventStream class ShortTermHistory(list[Event]): diff --git a/opendevin/memory/memory.py b/openhands/memory/memory.py similarity index 97% rename from opendevin/memory/memory.py rename to openhands/memory/memory.py index f000060cc0..67806fefc7 100644 --- a/opendevin/memory/memory.py +++ b/openhands/memory/memory.py @@ -8,9 +8,9 @@ from tenacity import ( wait_random_exponential, ) -from opendevin.core.config import LLMConfig -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.utils import json +from openhands.core.config import LLMConfig +from openhands.core.logger import openhands_logger as logger +from openhands.core.utils import json try: import chromadb diff --git a/opendevin/runtime/__init__.py b/openhands/runtime/__init__.py similarity index 100% rename from opendevin/runtime/__init__.py rename to openhands/runtime/__init__.py diff --git a/opendevin/runtime/browser/__init__.py b/openhands/runtime/browser/__init__.py similarity index 100% rename from opendevin/runtime/browser/__init__.py rename to openhands/runtime/browser/__init__.py diff --git a/opendevin/runtime/browser/browser_env.py b/openhands/runtime/browser/browser_env.py similarity index 98% rename from opendevin/runtime/browser/browser_env.py rename to openhands/runtime/browser/browser_env.py index 7d060580bd..41efb9bb29 100644 --- a/opendevin/runtime/browser/browser_env.py +++ b/openhands/runtime/browser/browser_env.py @@ -14,8 +14,8 @@ import tenacity from browsergym.utils.obs import flatten_dom_to_str from PIL import Image -from opendevin.core.exceptions import BrowserInitException -from opendevin.core.logger import opendevin_logger as logger +from openhands.core.exceptions import BrowserInitException +from openhands.core.logger import openhands_logger as logger BROWSER_EVAL_GET_GOAL_ACTION = 'GET_EVAL_GOAL' BROWSER_EVAL_GET_REWARDS_ACTION = 'GET_EVAL_REWARDS' diff --git a/opendevin/runtime/browser/utils.py b/openhands/runtime/browser/utils.py similarity index 89% rename from opendevin/runtime/browser/utils.py rename to openhands/runtime/browser/utils.py index b456874da0..336b3801e3 100644 --- a/opendevin/runtime/browser/utils.py +++ b/openhands/runtime/browser/utils.py @@ -1,10 +1,10 @@ import os -from opendevin.core.exceptions import BrowserUnavailableException -from opendevin.core.schema import ActionType -from opendevin.events.action import BrowseInteractiveAction, BrowseURLAction -from opendevin.events.observation import BrowserOutputObservation -from opendevin.runtime.browser.browser_env import BrowserEnv +from openhands.core.exceptions import BrowserUnavailableException +from openhands.core.schema import ActionType +from openhands.events.action import BrowseInteractiveAction, BrowseURLAction +from openhands.events.observation import BrowserOutputObservation +from openhands.runtime.browser.browser_env import BrowserEnv async def browse( diff --git a/opendevin/runtime/builder/__init__.py b/openhands/runtime/builder/__init__.py similarity index 100% rename from opendevin/runtime/builder/__init__.py rename to openhands/runtime/builder/__init__.py diff --git a/opendevin/runtime/builder/base.py b/openhands/runtime/builder/base.py similarity index 100% rename from opendevin/runtime/builder/base.py rename to openhands/runtime/builder/base.py diff --git a/opendevin/runtime/builder/docker.py b/openhands/runtime/builder/docker.py similarity index 97% rename from opendevin/runtime/builder/docker.py rename to openhands/runtime/builder/docker.py index c16af0d846..952df244d8 100644 --- a/opendevin/runtime/builder/docker.py +++ b/openhands/runtime/builder/docker.py @@ -1,6 +1,6 @@ import docker -from opendevin.core.logger import opendevin_logger as logger +from openhands.core.logger import openhands_logger as logger from .base import RuntimeBuilder diff --git a/opendevin/runtime/client/client.py b/openhands/runtime/client/client.py similarity index 96% rename from opendevin/runtime/client/client.py rename to openhands/runtime/client/client.py index 0af103f4a3..ff25e0d4af 100644 --- a/opendevin/runtime/client/client.py +++ b/openhands/runtime/client/client.py @@ -1,6 +1,6 @@ """ This is the main file for the runtime client. -It is responsible for executing actions received from OpenDevin backend and producing observations. +It is responsible for executing actions received from OpenHands backend and producing observations. NOTE: this will be executed inside the docker sandbox. """ @@ -22,8 +22,8 @@ from pathspec.patterns import GitWildMatchPattern from pydantic import BaseModel from uvicorn import run -from opendevin.core.logger import opendevin_logger as logger -from opendevin.events.action import ( +from openhands.core.logger import openhands_logger as logger +from openhands.events.action import ( Action, BrowseInteractiveAction, BrowseURLAction, @@ -32,7 +32,7 @@ from opendevin.events.action import ( FileWriteAction, IPythonRunCellAction, ) -from opendevin.events.observation import ( +from openhands.events.observation import ( CmdOutputObservation, ErrorObservation, FileReadObservation, @@ -40,16 +40,16 @@ from opendevin.events.observation import ( IPythonRunCellObservation, Observation, ) -from opendevin.events.serialization import event_from_dict, event_to_dict -from opendevin.runtime.browser import browse -from opendevin.runtime.browser.browser_env import BrowserEnv -from opendevin.runtime.plugins import ( +from openhands.events.serialization import event_from_dict, event_to_dict +from openhands.runtime.browser import browse +from openhands.runtime.browser.browser_env import BrowserEnv +from openhands.runtime.plugins import ( ALL_PLUGINS, JupyterPlugin, Plugin, ) -from opendevin.runtime.utils import split_bash_commands -from opendevin.runtime.utils.files import insert_lines, read_lines +from openhands.runtime.utils import split_bash_commands +from openhands.runtime.utils.files import insert_lines, read_lines class ActionRequest(BaseModel): @@ -58,15 +58,15 @@ class ActionRequest(BaseModel): ROOT_GID = 0 INIT_COMMANDS = [ - 'git config --global user.name "opendevin"', - 'git config --global user.email "opendevin@all-hands.dev"', + 'git config --global user.name "openhands"', + 'git config --global user.email "openhands@all-hands.dev"', "alias git='git --no-pager'", ] class RuntimeClient: """RuntimeClient is running inside docker sandbox. - It is responsible for executing actions received from OpenDevin backend and producing observations. + It is responsible for executing actions received from OpenHands backend and producing observations. """ def __init__( @@ -110,7 +110,7 @@ class RuntimeClient: if 'agent_skills' in self.plugins and 'jupyter' in self.plugins: obs = await self.run_ipython( IPythonRunCellAction( - code='from opendevin.runtime.plugins.agent_skills.agentskills import *\n' + code='from openhands.runtime.plugins.agent_skills.agentskills import *\n' ) ) logger.info(f'AgentSkills initialized: {obs}') @@ -440,7 +440,7 @@ if __name__ == '__main__': parser.add_argument('--working-dir', type=str, help='Working directory') parser.add_argument('--plugins', type=str, help='Plugins to initialize', nargs='+') parser.add_argument( - '--username', type=str, help='User to run as', default='opendevin' + '--username', type=str, help='User to run as', default='openhands' ) parser.add_argument('--user-id', type=int, help='User ID to run as', default=1000) parser.add_argument( diff --git a/opendevin/runtime/client/runtime.py b/openhands/runtime/client/runtime.py similarity index 93% rename from opendevin/runtime/client/runtime.py rename to openhands/runtime/client/runtime.py index fbcfb60aef..6f56755019 100644 --- a/opendevin/runtime/client/runtime.py +++ b/openhands/runtime/client/runtime.py @@ -8,10 +8,10 @@ import aiohttp import docker import tenacity -from opendevin.core.config import AppConfig -from opendevin.core.logger import opendevin_logger as logger -from opendevin.events import EventStream -from opendevin.events.action import ( +from openhands.core.config import AppConfig +from openhands.core.logger import openhands_logger as logger +from openhands.events import EventStream +from openhands.events.action import ( BrowseInteractiveAction, BrowseURLAction, CmdRunAction, @@ -19,19 +19,19 @@ from opendevin.events.action import ( FileWriteAction, IPythonRunCellAction, ) -from opendevin.events.action.action import Action -from opendevin.events.observation import ( +from openhands.events.action.action import Action +from openhands.events.observation import ( ErrorObservation, NullObservation, Observation, ) -from opendevin.events.serialization import event_to_dict, observation_from_dict -from opendevin.events.serialization.action import ACTION_TYPE_TO_CLASS -from opendevin.runtime.builder import DockerRuntimeBuilder -from opendevin.runtime.plugins import PluginRequirement -from opendevin.runtime.runtime import Runtime -from opendevin.runtime.utils import find_available_tcp_port -from opendevin.runtime.utils.runtime_build import build_runtime_image +from openhands.events.serialization import event_to_dict, observation_from_dict +from openhands.events.serialization.action import ACTION_TYPE_TO_CLASS +from openhands.runtime.builder import DockerRuntimeBuilder +from openhands.runtime.plugins import PluginRequirement +from openhands.runtime.runtime import Runtime +from openhands.runtime.utils import find_available_tcp_port +from openhands.runtime.utils.runtime_build import build_runtime_image class EventStreamRuntime(Runtime): @@ -39,7 +39,7 @@ class EventStreamRuntime(Runtime): When receive an event, it will send the event to od-runtime-client which run inside the docker environment. """ - container_name_prefix = 'opendevin-sandbox-' + container_name_prefix = 'openhands-sandbox-' def __init__( self, @@ -157,18 +157,18 @@ class EventStreamRuntime(Runtime): container = self.docker_client.containers.run( self.container_image, command=( - f'/opendevin/miniforge3/bin/mamba run --no-capture-output -n base ' + f'/openhands/miniforge3/bin/mamba run --no-capture-output -n base ' 'PYTHONUNBUFFERED=1 poetry run ' - f'python -u -m opendevin.runtime.client.client {self._port} ' + f'python -u -m openhands.runtime.client.client {self._port} ' f'--working-dir {sandbox_workspace_dir} ' f'{plugin_arg}' - f'--username {"opendevin" if self.config.run_as_devin else "root"} ' + f'--username {"openhands" if self.config.run_as_openhands else "root"} ' f'--user-id {self.config.sandbox.user_id} ' f'{browsergym_arg}' ), network_mode=network_mode, ports=port_mapping, - working_dir='/opendevin/code/', + working_dir='/openhands/code/', name=self.container_name, detach=True, environment={'DEBUG': 'true'} if self.config.debug else None, diff --git a/opendevin/runtime/e2b/README.md b/openhands/runtime/e2b/README.md similarity index 91% rename from opendevin/runtime/e2b/README.md rename to openhands/runtime/e2b/README.md index 1c0b60e025..b759132377 100644 --- a/opendevin/runtime/e2b/README.md +++ b/openhands/runtime/e2b/README.md @@ -14,8 +14,8 @@ ``` Full CLI API is [here](https://e2b.dev/docs/cli/installation). -## OpenDevin sandbox -You can use the E2B CLI to create a custom sandbox with a Dockerfile. Read the full guide [here](https://e2b.dev/docs/guide/custom-sandbox). The premade OpenDevin sandbox for E2B is set up in the [`containers` directory](/containers/e2b-sandbox). and it's called `open-devin`. +## OpenHands sandbox +You can use the E2B CLI to create a custom sandbox with a Dockerfile. Read the full guide [here](https://e2b.dev/docs/guide/custom-sandbox). The premade OpenHands sandbox for E2B is set up in the [`containers` directory](/containers/e2b-sandbox). and it's called `openhands`. ## Debugging You can connect to a running E2B sandbox with E2B CLI in your terminal. diff --git a/opendevin/runtime/e2b/filestore.py b/openhands/runtime/e2b/filestore.py similarity index 90% rename from opendevin/runtime/e2b/filestore.py rename to openhands/runtime/e2b/filestore.py index 0494dde21a..86c6edae0c 100644 --- a/opendevin/runtime/e2b/filestore.py +++ b/openhands/runtime/e2b/filestore.py @@ -1,4 +1,4 @@ -from opendevin.storage.files import FileStore +from openhands.storage.files import FileStore class E2BFileStore(FileStore): diff --git a/opendevin/runtime/e2b/runtime.py b/openhands/runtime/e2b/runtime.py similarity index 87% rename from opendevin/runtime/e2b/runtime.py rename to openhands/runtime/e2b/runtime.py index 0a185d5c97..8694c94636 100644 --- a/opendevin/runtime/e2b/runtime.py +++ b/openhands/runtime/e2b/runtime.py @@ -1,17 +1,17 @@ -from opendevin.core.config import AppConfig -from opendevin.events.action import ( +from openhands.core.config import AppConfig +from openhands.events.action import ( FileReadAction, FileWriteAction, ) -from opendevin.events.observation import ( +from openhands.events.observation import ( ErrorObservation, FileReadObservation, FileWriteObservation, Observation, ) -from opendevin.events.stream import EventStream -from opendevin.runtime.plugins import PluginRequirement -from opendevin.runtime.runtime import Runtime +from openhands.events.stream import EventStream +from openhands.runtime.plugins import PluginRequirement +from openhands.runtime.runtime import Runtime from ..utils.files import insert_lines, read_lines from .filestore import E2BFileStore diff --git a/opendevin/runtime/e2b/sandbox.py b/openhands/runtime/e2b/sandbox.py similarity index 94% rename from opendevin/runtime/e2b/sandbox.py rename to openhands/runtime/e2b/sandbox.py index 08af9eb02b..a8f4c6de98 100644 --- a/opendevin/runtime/e2b/sandbox.py +++ b/openhands/runtime/e2b/sandbox.py @@ -1,6 +1,6 @@ +import copy import os import tarfile -import copy from glob import glob from e2b import Sandbox as E2BSandbox @@ -8,8 +8,9 @@ from e2b.sandbox.exception import ( TimeoutException, ) -from opendevin.core.config import SandboxConfig -from opendevin.core.logger import opendevin_logger as logger +from openhands.core.config import SandboxConfig +from openhands.core.logger import openhands_logger as logger + class E2BBox: closed = False @@ -21,7 +22,7 @@ class E2BBox: self, config: SandboxConfig, e2b_api_key: str, - template: str = 'open-devin', + template: str = 'openhands', ): self.config = copy.deepcopy(config) self.initialize_plugins: bool = config.initialize_plugins @@ -62,9 +63,7 @@ class E2BBox: tar.add(host_src, arcname=srcname) return tar_filename - def execute( - self, cmd: str, timeout: int | None = None - ) -> tuple[int, str]: + def execute(self, cmd: str, timeout: int | None = None) -> tuple[int, str]: timeout = timeout if timeout is not None else self.config.timeout process = self.sandbox.process.start(cmd, env_vars=self._env) try: diff --git a/opendevin/runtime/plugins/__init__.py b/openhands/runtime/plugins/__init__.py similarity index 100% rename from opendevin/runtime/plugins/__init__.py rename to openhands/runtime/plugins/__init__.py diff --git a/opendevin/runtime/plugins/agent_skills/README.md b/openhands/runtime/plugins/agent_skills/README.md similarity index 89% rename from opendevin/runtime/plugins/agent_skills/README.md rename to openhands/runtime/plugins/agent_skills/README.md index 312d5ef6d4..2ce9e869ad 100644 --- a/opendevin/runtime/plugins/agent_skills/README.md +++ b/openhands/runtime/plugins/agent_skills/README.md @@ -1,11 +1,11 @@ -# OpenDevin Skill Sets +# OpenHands Skill Sets -This folder implements a skill/tool set `agentskills` for OpenDevin. +This folder implements a skill/tool set `agentskills` for OpenHands. It is intended to be used by the agent **inside sandbox**. The skill set will be exposed as a `pip` package that can be installed as a plugin inside the sandbox. -The skill set can contain a bunch of wrapped tools for agent ([many examples here](https://github.com/OpenDevin/OpenDevin/pull/1914)), for example: +The skill set can contain a bunch of wrapped tools for agent ([many examples here](https://github.com/All-Hands-AI/OpenHands/pull/1914)), for example: - Audio/Video to text (these are a temporary solution, and we should switch to multimodal models when they are sufficiently cheap - PDF to text - etc. diff --git a/opendevin/runtime/plugins/agent_skills/__init__.py b/openhands/runtime/plugins/agent_skills/__init__.py similarity index 81% rename from opendevin/runtime/plugins/agent_skills/__init__.py rename to openhands/runtime/plugins/agent_skills/__init__.py index e5440cf3e6..69dd1e9621 100644 --- a/opendevin/runtime/plugins/agent_skills/__init__.py +++ b/openhands/runtime/plugins/agent_skills/__init__.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from opendevin.runtime.plugins.requirement import Plugin, PluginRequirement +from openhands.runtime.plugins.requirement import Plugin, PluginRequirement from . import agentskills diff --git a/opendevin/runtime/plugins/agent_skills/agentskills.py b/openhands/runtime/plugins/agent_skills/agentskills.py similarity index 100% rename from opendevin/runtime/plugins/agent_skills/agentskills.py rename to openhands/runtime/plugins/agent_skills/agentskills.py diff --git a/opendevin/runtime/plugins/agent_skills/file_ops/__init__.py b/openhands/runtime/plugins/agent_skills/file_ops/__init__.py similarity index 100% rename from opendevin/runtime/plugins/agent_skills/file_ops/__init__.py rename to openhands/runtime/plugins/agent_skills/file_ops/__init__.py diff --git a/opendevin/runtime/plugins/agent_skills/file_ops/file_ops.py b/openhands/runtime/plugins/agent_skills/file_ops/file_ops.py similarity index 99% rename from opendevin/runtime/plugins/agent_skills/file_ops/file_ops.py rename to openhands/runtime/plugins/agent_skills/file_ops/file_ops.py index 8be8cb2d01..9e7a2188ab 100644 --- a/opendevin/runtime/plugins/agent_skills/file_ops/file_ops.py +++ b/openhands/runtime/plugins/agent_skills/file_ops/file_ops.py @@ -1,6 +1,6 @@ """file_ops.py -This module provides various file manipulation skills for the OpenDevin agent. +This module provides various file manipulation skills for the OpenHands agent. Functions: - open_file(path: str, line_number: int | None = 1, context_lines: int = 100): Opens a file and optionally moves to a specific line. diff --git a/opendevin/runtime/plugins/agent_skills/file_reader/__init__.py b/openhands/runtime/plugins/agent_skills/file_reader/__init__.py similarity index 100% rename from opendevin/runtime/plugins/agent_skills/file_reader/__init__.py rename to openhands/runtime/plugins/agent_skills/file_reader/__init__.py diff --git a/opendevin/runtime/plugins/agent_skills/file_reader/file_readers.py b/openhands/runtime/plugins/agent_skills/file_reader/file_readers.py similarity index 98% rename from opendevin/runtime/plugins/agent_skills/file_reader/file_readers.py rename to openhands/runtime/plugins/agent_skills/file_reader/file_readers.py index 235dd17180..ab088ca1e6 100644 --- a/opendevin/runtime/plugins/agent_skills/file_reader/file_readers.py +++ b/openhands/runtime/plugins/agent_skills/file_reader/file_readers.py @@ -1,4 +1,4 @@ -"""File reader skills for the OpenDevin agent. +"""File reader skills for the OpenHands agent. This module provides various functions to parse and extract content from different file types, including PDF, DOCX, LaTeX, audio, image, video, and PowerPoint files. It utilizes different @@ -238,7 +238,7 @@ __all__ = [ 'parse_pptx', ] -# This is called from OpenDevin's side +# This is called from OpenHands's side # If SANDBOX_ENV_OPENAI_API_KEY is set, we will be able to use these tools in the sandbox environment if _get_openai_api_key() and _get_openai_base_url(): __all__ += ['parse_audio', 'parse_video', 'parse_image'] diff --git a/opendevin/runtime/plugins/agent_skills/utils/aider/LICENSE.txt b/openhands/runtime/plugins/agent_skills/utils/aider/LICENSE.txt similarity index 100% rename from opendevin/runtime/plugins/agent_skills/utils/aider/LICENSE.txt rename to openhands/runtime/plugins/agent_skills/utils/aider/LICENSE.txt diff --git a/opendevin/runtime/plugins/agent_skills/utils/aider/README.md b/openhands/runtime/plugins/agent_skills/utils/aider/README.md similarity index 82% rename from opendevin/runtime/plugins/agent_skills/utils/aider/README.md rename to openhands/runtime/plugins/agent_skills/utils/aider/README.md index ffb00c2a34..3572f5f298 100644 --- a/opendevin/runtime/plugins/agent_skills/utils/aider/README.md +++ b/openhands/runtime/plugins/agent_skills/utils/aider/README.md @@ -5,4 +5,4 @@ to edit code in your local git repository. Please see the [original repository](https://github.com/paul-gauthier/aider) for more information. -OpenDevin has adapted and integrated its linter module ([original code](https://github.com/paul-gauthier/aider/blob/main/aider/linter.py)). +OpenHands has adapted and integrated its linter module ([original code](https://github.com/paul-gauthier/aider/blob/main/aider/linter.py)). diff --git a/opendevin/runtime/plugins/agent_skills/utils/aider/__init__.py b/openhands/runtime/plugins/agent_skills/utils/aider/__init__.py similarity index 100% rename from opendevin/runtime/plugins/agent_skills/utils/aider/__init__.py rename to openhands/runtime/plugins/agent_skills/utils/aider/__init__.py diff --git a/opendevin/runtime/plugins/agent_skills/utils/aider/linter.py b/openhands/runtime/plugins/agent_skills/utils/aider/linter.py similarity index 99% rename from opendevin/runtime/plugins/agent_skills/utils/aider/linter.py rename to openhands/runtime/plugins/agent_skills/utils/aider/linter.py index 419b5e3c5a..8cb340c486 100644 --- a/opendevin/runtime/plugins/agent_skills/utils/aider/linter.py +++ b/openhands/runtime/plugins/agent_skills/utils/aider/linter.py @@ -155,7 +155,7 @@ def basic_lint(fname, code): def extract_error_line_from(lint_error): - # moved from opendevin.agentskills#_lint_file + # moved from openhands.agentskills#_lint_file for line in lint_error.splitlines(True): if line.strip(): # The format of the error message is: ::: diff --git a/opendevin/runtime/plugins/agent_skills/utils/config.py b/openhands/runtime/plugins/agent_skills/utils/config.py similarity index 100% rename from opendevin/runtime/plugins/agent_skills/utils/config.py rename to openhands/runtime/plugins/agent_skills/utils/config.py diff --git a/opendevin/runtime/plugins/agent_skills/utils/dependency.py b/openhands/runtime/plugins/agent_skills/utils/dependency.py similarity index 100% rename from opendevin/runtime/plugins/agent_skills/utils/dependency.py rename to openhands/runtime/plugins/agent_skills/utils/dependency.py diff --git a/opendevin/runtime/plugins/jupyter/__init__.py b/openhands/runtime/plugins/jupyter/__init__.py similarity index 80% rename from opendevin/runtime/plugins/jupyter/__init__.py rename to openhands/runtime/plugins/jupyter/__init__.py index 815156064e..7245e25482 100644 --- a/opendevin/runtime/plugins/jupyter/__init__.py +++ b/openhands/runtime/plugins/jupyter/__init__.py @@ -2,11 +2,11 @@ import subprocess import time from dataclasses import dataclass -from opendevin.core.logger import opendevin_logger as logger -from opendevin.events.action import Action, IPythonRunCellAction -from opendevin.events.observation import IPythonRunCellObservation -from opendevin.runtime.plugins.requirement import Plugin, PluginRequirement -from opendevin.runtime.utils import find_available_tcp_port +from openhands.core.logger import openhands_logger as logger +from openhands.events.action import Action, IPythonRunCellAction +from openhands.events.observation import IPythonRunCellObservation +from openhands.runtime.plugins.requirement import Plugin, PluginRequirement +from openhands.runtime.utils import find_available_tcp_port from .execute_server import JupyterKernel @@ -19,16 +19,16 @@ class JupyterRequirement(PluginRequirement): class JupyterPlugin(Plugin): name: str = 'jupyter' - async def initialize(self, username: str, kernel_id: str = 'opendevin-default'): + async def initialize(self, username: str, kernel_id: str = 'openhands-default'): self.kernel_gateway_port = find_available_tcp_port() self.kernel_id = kernel_id self.gateway_process = subprocess.Popen( ( f"su - {username} -s /bin/bash << 'EOF'\n" - 'cd /opendevin/code\n' - 'export POETRY_VIRTUALENVS_PATH=/opendevin/poetry;\n' - 'export PYTHONPATH=/opendevin/code:$PYTHONPATH;\n' - '/opendevin/miniforge3/bin/mamba run -n base ' + 'cd /openhands/code\n' + 'export POETRY_VIRTUALENVS_PATH=/openhands/poetry;\n' + 'export PYTHONPATH=/openhands/code:$PYTHONPATH;\n' + '/openhands/miniforge3/bin/mamba run -n base ' 'poetry run jupyter kernelgateway ' '--KernelGatewayApp.ip=0.0.0.0 ' f'--KernelGatewayApp.port={self.kernel_gateway_port}\n' diff --git a/opendevin/runtime/plugins/jupyter/execute_server.py b/openhands/runtime/plugins/jupyter/execute_server.py similarity index 100% rename from opendevin/runtime/plugins/jupyter/execute_server.py rename to openhands/runtime/plugins/jupyter/execute_server.py diff --git a/opendevin/runtime/plugins/requirement.py b/openhands/runtime/plugins/requirement.py similarity index 85% rename from opendevin/runtime/plugins/requirement.py rename to openhands/runtime/plugins/requirement.py index b6713fe2a3..d927bc46e9 100644 --- a/opendevin/runtime/plugins/requirement.py +++ b/openhands/runtime/plugins/requirement.py @@ -1,8 +1,8 @@ from abc import abstractmethod from dataclasses import dataclass -from opendevin.events.action import Action -from opendevin.events.observation import Observation +from openhands.events.action import Action +from openhands.events.observation import Observation class Plugin: diff --git a/opendevin/runtime/runtime.py b/openhands/runtime/runtime.py similarity index 94% rename from opendevin/runtime/runtime.py rename to openhands/runtime/runtime.py index 688227cb1b..aca73d22f0 100644 --- a/opendevin/runtime/runtime.py +++ b/openhands/runtime/runtime.py @@ -5,10 +5,10 @@ import json import os from abc import abstractmethod -from opendevin.core.config import AppConfig, SandboxConfig -from opendevin.core.logger import opendevin_logger as logger -from opendevin.events import EventSource, EventStream, EventStreamSubscriber -from opendevin.events.action import ( +from openhands.core.config import AppConfig, SandboxConfig +from openhands.core.logger import openhands_logger as logger +from openhands.events import EventSource, EventStream, EventStreamSubscriber +from openhands.events.action import ( Action, ActionConfirmationStatus, BrowseInteractiveAction, @@ -18,16 +18,16 @@ from opendevin.events.action import ( FileWriteAction, IPythonRunCellAction, ) -from opendevin.events.event import Event -from opendevin.events.observation import ( +from openhands.events.event import Event +from openhands.events.observation import ( CmdOutputObservation, ErrorObservation, NullObservation, Observation, UserRejectObservation, ) -from opendevin.events.serialization.action import ACTION_TYPE_TO_CLASS -from opendevin.runtime.plugins import JupyterRequirement, PluginRequirement +from openhands.events.serialization.action import ACTION_TYPE_TO_CLASS +from openhands.runtime.plugins import JupyterRequirement, PluginRequirement def _default_env_vars(sandbox_config: SandboxConfig) -> dict[str, str]: diff --git a/opendevin/runtime/utils/__init__.py b/openhands/runtime/utils/__init__.py similarity index 100% rename from opendevin/runtime/utils/__init__.py rename to openhands/runtime/utils/__init__.py diff --git a/opendevin/runtime/utils/bash.py b/openhands/runtime/utils/bash.py similarity index 96% rename from opendevin/runtime/utils/bash.py rename to openhands/runtime/utils/bash.py index 6de80c3884..613858ff12 100644 --- a/opendevin/runtime/utils/bash.py +++ b/openhands/runtime/utils/bash.py @@ -1,6 +1,6 @@ import bashlex -from opendevin.core.logger import opendevin_logger as logger +from openhands.core.logger import openhands_logger as logger def split_bash_commands(commands): diff --git a/opendevin/runtime/utils/files.py b/openhands/runtime/utils/files.py similarity index 99% rename from opendevin/runtime/utils/files.py rename to openhands/runtime/utils/files.py index 1dd9266276..b9664cafc4 100644 --- a/opendevin/runtime/utils/files.py +++ b/openhands/runtime/utils/files.py @@ -1,7 +1,7 @@ import os from pathlib import Path -from opendevin.events.observation import ( +from openhands.events.observation import ( ErrorObservation, FileReadObservation, FileWriteObservation, diff --git a/opendevin/runtime/utils/runtime_build.py b/openhands/runtime/utils/runtime_build.py similarity index 97% rename from opendevin/runtime/utils/runtime_build.py rename to openhands/runtime/utils/runtime_build.py index d8e0296d78..ea38ec0ac1 100644 --- a/opendevin/runtime/utils/runtime_build.py +++ b/openhands/runtime/utils/runtime_build.py @@ -9,12 +9,12 @@ import toml from dirhash import dirhash from jinja2 import Environment, FileSystemLoader -import opendevin -from opendevin.core.logger import opendevin_logger as logger -from opendevin.runtime.builder import DockerRuntimeBuilder, RuntimeBuilder +import openhands +from openhands.core.logger import openhands_logger as logger +from openhands.runtime.builder import DockerRuntimeBuilder, RuntimeBuilder RUNTIME_IMAGE_REPO = os.getenv( - 'OD_RUNTIME_RUNTIME_IMAGE_REPO', 'ghcr.io/opendevin/od_runtime' + 'OD_RUNTIME_RUNTIME_IMAGE_REPO', 'ghcr.io/openhands/od_runtime' ) @@ -24,7 +24,7 @@ def _get_package_version(): Returns: - The version specified in pyproject.toml under [tool.poetry] """ - project_root = os.path.dirname(os.path.dirname(os.path.abspath(opendevin.__file__))) + project_root = os.path.dirname(os.path.dirname(os.path.abspath(openhands.__file__))) pyproject_path = os.path.join(project_root, 'pyproject.toml') with open(pyproject_path, 'r') as f: pyproject_data = toml.load(f) @@ -37,7 +37,7 @@ def _create_project_source_dist(): Returns: - str: The path to the project tarball """ - project_root = os.path.dirname(os.path.dirname(os.path.abspath(opendevin.__file__))) + project_root = os.path.dirname(os.path.dirname(os.path.abspath(openhands.__file__))) logger.info(f'Using project root: {project_root}') # run "python -m build -s" on project_root to create project tarball @@ -49,7 +49,7 @@ def _create_project_source_dist(): # Fetch the correct version from pyproject.toml package_version = _get_package_version() tarball_path = os.path.join( - project_root, 'dist', f'opendevin-{package_version}.tar.gz' + project_root, 'dist', f'openhands-{package_version}.tar.gz' ) if not os.path.exists(tarball_path): logger.error(f'Source distribution not found at {tarball_path}') @@ -61,7 +61,7 @@ def _create_project_source_dist(): def _put_source_code_to_dir(temp_dir: str): """Builds the project source tarball. Copies it to temp_dir and unpacks it. - The OpenDevin source code ends up in the temp_dir/code directory + The OpenHands source code ends up in the temp_dir/code directory Parameters: - temp_dir (str): The directory to put the source code in @@ -203,7 +203,7 @@ def build_runtime_image( force_rebuild: bool = False, ) -> str: """Prepares the final docker build folder. - If dry_run is False, it will also build the OpenDevin runtime Docker image using the docker build folder. + If dry_run is False, it will also build the OpenHands runtime Docker image using the docker build folder. Parameters: - base_image (str): The name of the base Docker image to use diff --git a/opendevin/runtime/utils/runtime_templates/Dockerfile.j2 b/openhands/runtime/utils/runtime_templates/Dockerfile.j2 similarity index 67% rename from opendevin/runtime/utils/runtime_templates/Dockerfile.j2 rename to openhands/runtime/utils/runtime_templates/Dockerfile.j2 index b7d04d2465..519760a2ef 100644 --- a/opendevin/runtime/utils/runtime_templates/Dockerfile.j2 +++ b/openhands/runtime/utils/runtime_templates/Dockerfile.j2 @@ -19,22 +19,22 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* # Create necessary directories -RUN mkdir -p /opendevin && \ - mkdir -p /opendevin/logs && \ - mkdir -p /opendevin/poetry +RUN mkdir -p /openhands && \ + mkdir -p /openhands/logs && \ + mkdir -p /openhands/poetry -ENV POETRY_VIRTUALENVS_PATH=/opendevin/poetry +ENV POETRY_VIRTUALENVS_PATH=/openhands/poetry -RUN if [ ! -d /opendevin/miniforge3 ]; then \ +RUN if [ ! -d /openhands/miniforge3 ]; then \ wget --progress=bar:force -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" && \ - bash Miniforge3.sh -b -p /opendevin/miniforge3 && \ + bash Miniforge3.sh -b -p /openhands/miniforge3 && \ rm Miniforge3.sh && \ - chmod -R g+w /opendevin/miniforge3 && \ - bash -c ". /opendevin/miniforge3/etc/profile.d/conda.sh && conda config --set changeps1 False && conda config --append channels conda-forge"; \ + chmod -R g+w /openhands/miniforge3 && \ + bash -c ". /openhands/miniforge3/etc/profile.d/conda.sh && conda config --set changeps1 False && conda config --append channels conda-forge"; \ fi # Install Python and Poetry -RUN /opendevin/miniforge3/bin/mamba install conda-forge::poetry python=3.11 -y +RUN /openhands/miniforge3/bin/mamba install conda-forge::poetry python=3.11 -y # ================================================================ # END: Build Runtime Image from Scratch # ================================================================ @@ -43,25 +43,25 @@ RUN /opendevin/miniforge3/bin/mamba install conda-forge::poetry python=3.11 -y # ================================================================ # START: Copy Project and Install/Update Dependencies # ================================================================ -RUN if [ -d /opendevin/code ]; then rm -rf /opendevin/code; fi -COPY ./code /opendevin/code +RUN if [ -d /openhands/code ]; then rm -rf /openhands/code; fi +COPY ./code /openhands/code # Install/Update Dependencies # 1. Install pyproject.toml via poetry # 2. Install playwright and chromium # 3. Clear poetry, apt, mamba caches -RUN cd /opendevin/code && \ - /opendevin/miniforge3/bin/mamba run -n base poetry env use python3.11 && \ - /opendevin/miniforge3/bin/mamba run -n base poetry install --only main,runtime --no-interaction --no-root && \ +RUN cd /openhands/code && \ + /openhands/miniforge3/bin/mamba run -n base poetry env use python3.11 && \ + /openhands/miniforge3/bin/mamba run -n base poetry install --only main,runtime --no-interaction --no-root && \ apt-get update && \ - /opendevin/miniforge3/bin/mamba run -n base poetry run pip install playwright && \ - /opendevin/miniforge3/bin/mamba run -n base poetry run playwright install --with-deps chromium && \ - export OD_INTERPRETER_PATH=$(/opendevin/miniforge3/bin/mamba run -n base poetry run python -c "import sys; print(sys.executable)") && \ + /openhands/miniforge3/bin/mamba run -n base poetry run pip install playwright && \ + /openhands/miniforge3/bin/mamba run -n base poetry run playwright install --with-deps chromium && \ + export OD_INTERPRETER_PATH=$(/openhands/miniforge3/bin/mamba run -n base poetry run python -c "import sys; print(sys.executable)") && \ {{ extra_deps }} {% if extra_deps %} && {% endif %} \ - /opendevin/miniforge3/bin/mamba run -n base poetry cache clear --all . && \ - {% if not skip_init %}chmod -R g+rws /opendevin/poetry && {% endif %} \ + /openhands/miniforge3/bin/mamba run -n base poetry cache clear --all . && \ + {% if not skip_init %}chmod -R g+rws /openhands/poetry && {% endif %} \ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ - /opendevin/miniforge3/bin/mamba clean --all + /openhands/miniforge3/bin/mamba clean --all # ================================================================ # END: Copy Project and Install/Update Dependencies diff --git a/opendevin/runtime/utils/singleton.py b/openhands/runtime/utils/singleton.py similarity index 100% rename from opendevin/runtime/utils/singleton.py rename to openhands/runtime/utils/singleton.py diff --git a/opendevin/runtime/utils/system.py b/openhands/runtime/utils/system.py similarity index 100% rename from opendevin/runtime/utils/system.py rename to openhands/runtime/utils/system.py diff --git a/opendevin/security/README.md b/openhands/security/README.md similarity index 89% rename from opendevin/security/README.md rename to openhands/security/README.md index 0549a966c3..644348f577 100644 --- a/opendevin/security/README.md +++ b/openhands/security/README.md @@ -1,6 +1,6 @@ # Security -Given the impressive capabilities of OpenDevin and similar coding agents, ensuring robust security measures is essential to prevent unintended actions or security breaches. The SecurityAnalyzer framework provides a structured approach to monitor and analyze agent actions for potential security risks. +Given the impressive capabilities of OpenHands and similar coding agents, ensuring robust security measures is essential to prevent unintended actions or security breaches. The SecurityAnalyzer framework provides a structured approach to monitor and analyze agent actions for potential security risks. To enable this feature: * From the web interface @@ -40,22 +40,22 @@ The `SecurityAnalyzer` class (analyzer.py) is an abstract base class designed to In conclusion, a concrete security analyzer should evaluate the risk of each event and act accordingly (e.g. auto-confirm, send Slack message, etc). -For customization and decoupling from the OpenDevin core logic, the security analyzer can define its own API endpoints that can then be accessed from the frontend. These API endpoints need to be secured (do not allow more capabilities than the core logic +For customization and decoupling from the OpenHands core logic, the security analyzer can define its own API endpoints that can then be accessed from the frontend. These API endpoints need to be secured (do not allow more capabilities than the core logic provides). ## How to implement your own Security Analyzer -1. Create a submodule in [security](/opendevin/security/) with your analyzer's desired name - * Have your main class inherit from [SecurityAnalyzer](/opendevin/security/analyzer.py) +1. Create a submodule in [security](/openhands/security/) with your analyzer's desired name + * Have your main class inherit from [SecurityAnalyzer](/openhands/security/analyzer.py) * Optional: define API endpoints for `/api/security/{path:path}` to manage settings, -2. Add your analyzer class to the [options](/opendevin/security/options.py) to have it be visible from the frontend combobox +2. Add your analyzer class to the [options](/openhands/security/options.py) to have it be visible from the frontend combobox 3. Optional: implement your modal frontend (for when you click on the lock) in [security](/frontend/src/components/modals/security/) and add your component to [Security.tsx](/frontend/src/components/modals/security/Security.tsx) ## Implemented Security Analyzers ### Invariant -It uses the [Invariant Analyzer](https://github.com/invariantlabs-ai/invariant) to analyze traces and detect potential issues with OpenDevin's workflow. It uses confirmation mode to ask for user confirmation on potentially risky actions. +It uses the [Invariant Analyzer](https://github.com/invariantlabs-ai/invariant) to analyze traces and detect potential issues with OpenHands's workflow. It uses confirmation mode to ask for user confirmation on potentially risky actions. This allows the agent to run autonomously without fear that it will inadvertently compromise security or perform unintended actions that could be harmful. @@ -67,7 +67,7 @@ Features: * malicious bash commands * Logs: * actions and their associated risk - * OpenDevin traces in JSON format + * OpenHands traces in JSON format * Run-time settings: * the [invariant policy](https://github.com/invariantlabs-ai/invariant?tab=readme-ov-file#policy-language) * acceptable risk threshold diff --git a/opendevin/security/__init__.py b/openhands/security/__init__.py similarity index 100% rename from opendevin/security/__init__.py rename to openhands/security/__init__.py diff --git a/opendevin/security/analyzer.py b/openhands/security/analyzer.py similarity index 89% rename from opendevin/security/analyzer.py rename to openhands/security/analyzer.py index ad8521b7a1..f8a97cc477 100644 --- a/opendevin/security/analyzer.py +++ b/openhands/security/analyzer.py @@ -2,10 +2,10 @@ from typing import Any from fastapi import Request -from opendevin.core.logger import opendevin_logger as logger -from opendevin.events.action.action import Action, ActionSecurityRisk -from opendevin.events.event import Event -from opendevin.events.stream import EventStream, EventStreamSubscriber +from openhands.core.logger import openhands_logger as logger +from openhands.events.action.action import Action, ActionSecurityRisk +from openhands.events.event import Event +from openhands.events.stream import EventStream, EventStreamSubscriber class SecurityAnalyzer: diff --git a/opendevin/security/invariant/__init__.py b/openhands/security/invariant/__init__.py similarity index 100% rename from opendevin/security/invariant/__init__.py rename to openhands/security/invariant/__init__.py diff --git a/opendevin/security/invariant/analyzer.py b/openhands/security/invariant/analyzer.py similarity index 91% rename from opendevin/security/invariant/analyzer.py rename to openhands/security/invariant/analyzer.py index b28990a1d3..0d92f1b327 100644 --- a/opendevin/security/invariant/analyzer.py +++ b/openhands/security/invariant/analyzer.py @@ -6,19 +6,19 @@ import docker from fastapi import HTTPException, Request from fastapi.responses import JSONResponse -from opendevin.core.logger import opendevin_logger as logger -from opendevin.events.action.action import ( +from openhands.core.logger import openhands_logger as logger +from openhands.events.action.action import ( Action, ActionSecurityRisk, ) -from opendevin.events.event import Event, EventSource -from opendevin.events.observation import Observation -from opendevin.events.serialization.action import action_from_dict -from opendevin.events.stream import EventStream -from opendevin.runtime.utils import find_available_tcp_port -from opendevin.security.analyzer import SecurityAnalyzer -from opendevin.security.invariant.client import InvariantClient -from opendevin.security.invariant.parser import TraceElement, parse_element +from openhands.events.event import Event, EventSource +from openhands.events.observation import Observation +from openhands.events.serialization.action import action_from_dict +from openhands.events.stream import EventStream +from openhands.runtime.utils import find_available_tcp_port +from openhands.security.analyzer import SecurityAnalyzer +from openhands.security.invariant.client import InvariantClient +from openhands.security.invariant.parser import TraceElement, parse_element class InvariantAnalyzer(SecurityAnalyzer): @@ -26,8 +26,8 @@ class InvariantAnalyzer(SecurityAnalyzer): trace: list[TraceElement] input: list[dict] - container_name: str = 'opendevin-invariant-server' - image_name: str = 'ghcr.io/invariantlabs-ai/server:opendevin' + container_name: str = 'openhands-invariant-server' + image_name: str = 'ghcr.io/invariantlabs-ai/server:openhands' api_host: str = 'http://localhost' timeout: int = 180 settings: dict = {} diff --git a/opendevin/security/invariant/client.py b/openhands/security/invariant/client.py similarity index 100% rename from opendevin/security/invariant/client.py rename to openhands/security/invariant/client.py diff --git a/opendevin/security/invariant/nodes.py b/openhands/security/invariant/nodes.py similarity index 100% rename from opendevin/security/invariant/nodes.py rename to openhands/security/invariant/nodes.py diff --git a/opendevin/security/invariant/parser.py b/openhands/security/invariant/parser.py similarity index 90% rename from opendevin/security/invariant/parser.py rename to openhands/security/invariant/parser.py index 5e3b6d76da..dea1286924 100644 --- a/opendevin/security/invariant/parser.py +++ b/openhands/security/invariant/parser.py @@ -2,21 +2,21 @@ from typing import Union from pydantic import BaseModel, Field -from opendevin.core.logger import opendevin_logger as logger -from opendevin.events.action import ( +from openhands.core.logger import openhands_logger as logger +from openhands.events.action import ( Action, ChangeAgentStateAction, MessageAction, NullAction, ) -from opendevin.events.event import EventSource -from opendevin.events.observation import ( +from openhands.events.event import EventSource +from openhands.events.observation import ( AgentStateChangedObservation, NullObservation, Observation, ) -from opendevin.events.serialization.event import event_to_dict -from opendevin.security.invariant.nodes import Function, Message, ToolCall, ToolOutput +from openhands.events.serialization.event import event_to_dict +from openhands.security.invariant.nodes import Function, Message, ToolCall, ToolOutput TraceElement = Union[Message, ToolCall, ToolOutput, Function] diff --git a/opendevin/security/invariant/policies.py b/openhands/security/invariant/policies.py similarity index 99% rename from opendevin/security/invariant/policies.py rename to openhands/security/invariant/policies.py index 815f733178..113d2f9265 100644 --- a/opendevin/security/invariant/policies.py +++ b/openhands/security/invariant/policies.py @@ -16,4 +16,4 @@ raise "Vulnerability in bash command [risk=medium]" if: call is tool:cmd_run semgrep_res := semgrep(call.function.arguments.command, lang="bash") any(semgrep_res) -""" \ No newline at end of file +""" diff --git a/opendevin/security/options.py b/openhands/security/options.py similarity index 50% rename from opendevin/security/options.py rename to openhands/security/options.py index 370f2e8e1b..d02a9efc2a 100644 --- a/opendevin/security/options.py +++ b/openhands/security/options.py @@ -1,4 +1,4 @@ -from opendevin.security.invariant.analyzer import InvariantAnalyzer +from openhands.security.invariant.analyzer import InvariantAnalyzer SecurityAnalyzers = { 'invariant': InvariantAnalyzer, diff --git a/opendevin/server/README.md b/openhands/server/README.md similarity index 97% rename from opendevin/server/README.md rename to openhands/server/README.md index 991f0fe7c0..d580d331b2 100644 --- a/opendevin/server/README.md +++ b/openhands/server/README.md @@ -1,4 +1,4 @@ -# OpenDevin Server +# OpenHands Server This is a WebSocket server that executes tasks using an agent. @@ -23,7 +23,7 @@ Next run `poetry shell` (So you don't have to repeat `poetry run`) ## Start the Server ```sh -uvicorn opendevin.server.listen:app --reload --port 3000 +uvicorn openhands.server.listen:app --reload --port 3000 ``` ## Test the Server diff --git a/opendevin/server/__init__.py b/openhands/server/__init__.py similarity index 100% rename from opendevin/server/__init__.py rename to openhands/server/__init__.py diff --git a/opendevin/server/auth/__init__.py b/openhands/server/auth/__init__.py similarity index 100% rename from opendevin/server/auth/__init__.py rename to openhands/server/auth/__init__.py diff --git a/opendevin/server/auth/auth.py b/openhands/server/auth/auth.py similarity index 95% rename from opendevin/server/auth/auth.py rename to openhands/server/auth/auth.py index 20d08286f1..d668650f58 100644 --- a/opendevin/server/auth/auth.py +++ b/openhands/server/auth/auth.py @@ -1,7 +1,7 @@ import jwt from jwt.exceptions import InvalidTokenError -from opendevin.core.logger import opendevin_logger as logger +from openhands.core.logger import openhands_logger as logger def get_sid_from_token(token: str, jwt_secret: str) -> str: diff --git a/opendevin/server/data_models/feedback.py b/openhands/server/data_models/feedback.py similarity index 95% rename from opendevin/server/data_models/feedback.py rename to openhands/server/data_models/feedback.py index 6232277be4..d5728a5e04 100644 --- a/opendevin/server/data_models/feedback.py +++ b/openhands/server/data_models/feedback.py @@ -4,7 +4,7 @@ from typing import Any, Literal import requests from pydantic import BaseModel -from opendevin.core.logger import opendevin_logger as logger +from openhands.core.logger import openhands_logger as logger class FeedbackDataModel(BaseModel): diff --git a/opendevin/server/listen.py b/openhands/server/listen.py similarity index 96% rename from opendevin/server/listen.py rename to openhands/server/listen.py index 836213bf26..f2e0a4c11f 100644 --- a/opendevin/server/listen.py +++ b/openhands/server/listen.py @@ -6,9 +6,9 @@ import warnings import requests -from opendevin.security.options import SecurityAnalyzers -from opendevin.server.data_models.feedback import FeedbackDataModel, store_feedback -from opendevin.storage import get_file_store +from openhands.security.options import SecurityAnalyzers +from openhands.server.data_models.feedback import FeedbackDataModel, store_feedback +from openhands.storage import get_file_store with warnings.catch_warnings(): warnings.simplefilter('ignore') @@ -29,28 +29,28 @@ from fastapi.security import HTTPBearer from fastapi.staticfiles import StaticFiles import agenthub # noqa F401 (we import this to get the agents registered) -from opendevin.controller.agent import Agent -from opendevin.core.config import LLMConfig, load_app_config -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.schema import AgentState # Add this import -from opendevin.events.action import ( +from openhands.controller.agent import Agent +from openhands.core.config import LLMConfig, load_app_config +from openhands.core.logger import openhands_logger as logger +from openhands.core.schema import AgentState # Add this import +from openhands.events.action import ( ChangeAgentStateAction, FileReadAction, FileWriteAction, NullAction, ) -from opendevin.events.observation import ( +from openhands.events.observation import ( AgentStateChangedObservation, ErrorObservation, FileReadObservation, FileWriteObservation, NullObservation, ) -from opendevin.events.serialization import event_to_dict -from opendevin.llm import bedrock -from opendevin.runtime.runtime import Runtime -from opendevin.server.auth import get_sid_from_token, sign_token -from opendevin.server.session import SessionManager +from openhands.events.serialization import event_to_dict +from openhands.llm import bedrock +from openhands.runtime.runtime import Runtime +from openhands.server.auth import get_sid_from_token, sign_token +from openhands.server.session import SessionManager config = load_app_config() file_store = get_file_store(config.file_store, config.file_store_path) @@ -220,7 +220,7 @@ async def websocket_endpoint(websocket: WebSocket): ``` - Write contents to a file: ```json - {"action": "write", "args": {"path": "./greetings.txt", "content": "Hello, OpenDevin?"}} + {"action": "write", "args": {"path": "./greetings.txt", "content": "Hello, OpenHands?"}} ``` - Read the contents of a file: ```json diff --git a/opendevin/server/mock/README.md b/openhands/server/mock/README.md similarity index 92% rename from opendevin/server/mock/README.md rename to openhands/server/mock/README.md index f9e62943b0..dcd2f23a61 100644 --- a/opendevin/server/mock/README.md +++ b/openhands/server/mock/README.md @@ -1,4 +1,4 @@ -# OpenDevin mock server +# OpenHands mock server This is a simple mock server to facilitate development in the frontend. ## Start the Server diff --git a/opendevin/server/mock/listen.py b/openhands/server/mock/listen.py similarity index 96% rename from opendevin/server/mock/listen.py rename to openhands/server/mock/listen.py index 00d84f5feb..e170201de7 100644 --- a/opendevin/server/mock/listen.py +++ b/openhands/server/mock/listen.py @@ -1,7 +1,7 @@ import uvicorn from fastapi import FastAPI, WebSocket -from opendevin.core.schema import ActionType +from openhands.core.schema import ActionType app = FastAPI() diff --git a/opendevin/server/session/__init__.py b/openhands/server/session/__init__.py similarity index 100% rename from opendevin/server/session/__init__.py rename to openhands/server/session/__init__.py diff --git a/opendevin/server/session/agent.py b/openhands/server/session/agent.py similarity index 90% rename from opendevin/server/session/agent.py rename to openhands/server/session/agent.py index 7c0d8b51ce..0dab396dbe 100644 --- a/opendevin/server/session/agent.py +++ b/openhands/server/session/agent.py @@ -1,13 +1,13 @@ -from opendevin.controller import AgentController -from opendevin.controller.agent import Agent -from opendevin.controller.state.state import State -from opendevin.core.config import AgentConfig, AppConfig, LLMConfig -from opendevin.core.logger import opendevin_logger as logger -from opendevin.events.stream import EventStream -from opendevin.runtime import get_runtime_cls -from opendevin.runtime.runtime import Runtime -from opendevin.security import SecurityAnalyzer, options -from opendevin.storage.files import FileStore +from openhands.controller import AgentController +from openhands.controller.agent import Agent +from openhands.controller.state.state import State +from openhands.core.config import AgentConfig, AppConfig, LLMConfig +from openhands.core.logger import openhands_logger as logger +from openhands.events.stream import EventStream +from openhands.runtime import get_runtime_cls +from openhands.runtime.runtime import Runtime +from openhands.security import SecurityAnalyzer, options +from openhands.storage.files import FileStore class AgentSession: diff --git a/opendevin/server/session/manager.py b/openhands/server/session/manager.py similarity index 94% rename from opendevin/server/session/manager.py rename to openhands/server/session/manager.py index 08f02b852e..e795daf221 100644 --- a/opendevin/server/session/manager.py +++ b/openhands/server/session/manager.py @@ -3,9 +3,9 @@ import time from fastapi import WebSocket -from opendevin.core.config import AppConfig -from opendevin.core.logger import opendevin_logger as logger -from opendevin.storage.files import FileStore +from openhands.core.config import AppConfig +from openhands.core.logger import openhands_logger as logger +from openhands.storage.files import FileStore from .session import Session diff --git a/opendevin/server/session/session.py b/openhands/server/session/session.py similarity index 90% rename from opendevin/server/session/session.py rename to openhands/server/session/session.py index c941f82d96..10415b4440 100644 --- a/opendevin/server/session/session.py +++ b/openhands/server/session/session.py @@ -3,24 +3,24 @@ import time from fastapi import WebSocket, WebSocketDisconnect -from opendevin.controller.agent import Agent -from opendevin.core.config import AppConfig -from opendevin.core.const.guide_url import TROUBLESHOOTING_URL -from opendevin.core.logger import opendevin_logger as logger -from opendevin.core.schema import AgentState -from opendevin.core.schema.action import ActionType -from opendevin.core.schema.config import ConfigType -from opendevin.events.action import ChangeAgentStateAction, MessageAction, NullAction -from opendevin.events.event import Event, EventSource -from opendevin.events.observation import ( +from openhands.controller.agent import Agent +from openhands.core.config import AppConfig +from openhands.core.const.guide_url import TROUBLESHOOTING_URL +from openhands.core.logger import openhands_logger as logger +from openhands.core.schema import AgentState +from openhands.core.schema.action import ActionType +from openhands.core.schema.config import ConfigType +from openhands.events.action import ChangeAgentStateAction, MessageAction, NullAction +from openhands.events.event import Event, EventSource +from openhands.events.observation import ( AgentStateChangedObservation, CmdOutputObservation, NullObservation, ) -from opendevin.events.serialization import event_from_dict, event_to_dict -from opendevin.events.stream import EventStreamSubscriber -from opendevin.llm.llm import LLM -from opendevin.storage.files import FileStore +from openhands.events.serialization import event_from_dict, event_to_dict +from openhands.events.stream import EventStreamSubscriber +from openhands.llm.llm import LLM +from openhands.storage.files import FileStore from .agent import AgentSession diff --git a/opendevin/storage/__init__.py b/openhands/storage/__init__.py similarity index 100% rename from opendevin/storage/__init__.py rename to openhands/storage/__init__.py diff --git a/opendevin/storage/files.py b/openhands/storage/files.py similarity index 100% rename from opendevin/storage/files.py rename to openhands/storage/files.py diff --git a/opendevin/storage/local.py b/openhands/storage/local.py similarity index 96% rename from opendevin/storage/local.py rename to openhands/storage/local.py index c91bf75ffc..6e30cdc4ea 100644 --- a/opendevin/storage/local.py +++ b/openhands/storage/local.py @@ -1,7 +1,7 @@ import os import shutil -from opendevin.core.logger import opendevin_logger as logger +from openhands.core.logger import openhands_logger as logger from .files import FileStore diff --git a/opendevin/storage/memory.py b/openhands/storage/memory.py similarity index 95% rename from opendevin/storage/memory.py rename to openhands/storage/memory.py index 8baa1ff69e..1cb40b9099 100644 --- a/opendevin/storage/memory.py +++ b/openhands/storage/memory.py @@ -1,6 +1,6 @@ import os -from opendevin.core.logger import opendevin_logger as logger +from openhands.core.logger import openhands_logger as logger from .files import FileStore diff --git a/opendevin/storage/s3.py b/openhands/storage/s3.py similarity index 100% rename from opendevin/storage/s3.py rename to openhands/storage/s3.py diff --git a/opendevin/utils/prompt.py b/openhands/utils/prompt.py similarity index 100% rename from opendevin/utils/prompt.py rename to openhands/utils/prompt.py diff --git a/poetry.lock b/poetry.lock index 6646d9d93e..20ecd7b360 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "aenum" @@ -7666,7 +7666,7 @@ inference = ["anthropic", "flash_attn", "jedi", "openai", "peft", "protobuf", "s [package.source] type = "git" -url = "https://github.com/OpenDevin/SWE-bench.git" +url = "https://github.com/All-Hands-AI/SWE-bench.git" reference = "HEAD" resolved_reference = "c2b3cefd4a5af0b248966a773650a39046072975" @@ -9212,4 +9212,4 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "c3c227a4550f1c7ed07c67a282958580d83b3ede8f754c519b9830def91c2ffe" +content-hash = "3c0aff71c1d6c27233e86a5da23e308e83432db015f52d507d1297067c0dd0f8" diff --git a/pyproject.toml b/pyproject.toml index e51d8e2da0..26c750272b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,11 @@ [tool.poetry] -name = "opendevin" +name = "openhands" version = "0.8.3" -description = "OpenDevin: Code Less, Make More" -authors = ["OpenDevin"] +description = "OpenHands: Code Less, Make More" +authors = ["OpenHands"] license = "MIT" readme = "README.md" -repository = "https://github.com/OpenDevin/OpenDevin" +repository = "https://github.com/All-Hands-AI/OpenHands" include = ["poetry.lock"] [tool.poetry.dependencies] @@ -117,7 +117,7 @@ streamlit = "*" whatthepatch = "*" retry = "*" evaluate = "*" -swebench = { git = "https://github.com/OpenDevin/SWE-bench.git" } +swebench = { git = "https://github.com/All-Hands-AI/SWE-bench.git" } func_timeout = "*" sympy = "*" gdown = "*" diff --git a/tests/integration/README.md b/tests/integration/README.md index 390192e973..df0ae379f6 100644 --- a/tests/integration/README.md +++ b/tests/integration/README.md @@ -3,8 +3,8 @@ This folder contains backend integration tests that rely on a mock LLM. It serves two purposes: -1. Ensure the quality of development, including OpenDevin framework and agents. -2. Help contributors learn the workflow of OpenDevin, and examples of real interactions +1. Ensure the quality of development, including OpenHands framework and agents. +2. Help contributors learn the workflow of OpenHands, and examples of real interactions with (powerful) LLM, without spending real money. ## Why don't we launch an open-source model, e.g. LLAMA3? @@ -77,7 +77,7 @@ TEST_ONLY=true ONLY_TEST_NAME="test_simple_task_rejection" ONLY_TEST_AGENT="Mana ## Regenerate Integration Tests When you make changes to an agent's prompt, the integration tests will fail. You'll need to regenerate them -by running the following command from OpenDevin's project root directory: +by running the following command from OpenHands's project root directory: ```bash TEST_RUNTIME=server ./tests/integration/regenerate.sh diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 659f1632c2..41d768c540 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -12,7 +12,7 @@ from threading import Thread import pytest from litellm import completion -from opendevin.llm.llm import message_separator +from openhands.llm.llm import message_separator script_dir = os.environ.get('SCRIPT_DIR') project_root = os.environ.get('PROJECT_ROOT') @@ -47,8 +47,8 @@ def pytest_exception_interact(node, call, report): def filter_out_symbols(input): # remove shell hostname patterns (e.g., will change between each run) - # opendevin@379c7fce40b4:/workspace $ - input = re.sub(r'(opendevin|root)@.*(:/.*)', r'\1[DUMMY_HOSTNAME]\2', input) + # openhands@379c7fce40b4:/workspace $ + input = re.sub(r'(openhands|root)@.*(:/.*)', r'\1[DUMMY_HOSTNAME]\2', input) # handle sha256 hashes # sha256=4ecf8be428f55981e2a188f510ba5f9022bed88f5fb404d7d949f44382201e3d @@ -202,13 +202,13 @@ def patch_completion(monkeypatch, request): test_name = request.node.name # Mock LLM completion monkeypatch.setattr( - 'opendevin.llm.llm.litellm_completion', + 'openhands.llm.llm.litellm_completion', partial(mock_completion, test_name=test_name), ) # Mock LLM completion cost (1 USD per conversation) monkeypatch.setattr( - 'opendevin.llm.llm.litellm_completion_cost', + 'openhands.llm.llm.litellm_completion_cost', lambda completion_response, **extra_kwargs: 1, ) diff --git a/tests/integration/mock/eventstream_runtime/BrowsingAgent/test_browse_internet/prompt_003.log b/tests/integration/mock/eventstream_runtime/BrowsingAgent/test_browse_internet/prompt_003.log index f183ccbb59..958c6e5857 100644 --- a/tests/integration/mock/eventstream_runtime/BrowsingAgent/test_browse_internet/prompt_003.log +++ b/tests/integration/mock/eventstream_runtime/BrowsingAgent/test_browse_internet/prompt_003.log @@ -119,7 +119,7 @@ RootWebArea 'The Ultimate Answer', focused [9] paragraph '' StaticText 'Click the button to reveal the answer to life, the universe, and everything.' [10] button 'Click me', clickable, focused - StaticText 'The answer is OpenDevin is all you need!' + StaticText 'The answer is OpenHands is all you need!' # Previous Actions goto('http://localhost:8000') diff --git a/tests/integration/mock/eventstream_runtime/BrowsingAgent/test_browse_internet/response_003.log b/tests/integration/mock/eventstream_runtime/BrowsingAgent/test_browse_internet/response_003.log index 2eeae38382..37cc9fdea9 100644 --- a/tests/integration/mock/eventstream_runtime/BrowsingAgent/test_browse_internet/response_003.log +++ b/tests/integration/mock/eventstream_runtime/BrowsingAgent/test_browse_internet/response_003.log @@ -1,3 +1,3 @@ In order to accomplish my goal, I need to read the static text that reveals the answer to life, the universe, and everything. -```send_msg_to_user('The answer is OpenDevin is all you need!' +```send_msg_to_user('The answer is OpenHands is all you need!' diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_001.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_001.log index 62ee7a52b6..4f5a3af2de 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_001.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_001.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_004.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_004.log index 566df42a71..381f8406d5 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_004.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_004.log @@ -119,7 +119,7 @@ RootWebArea 'The Ultimate Answer', focused [9] paragraph '' StaticText 'Click the button to reveal the answer to life, the universe, and everything.' [10] button 'Click me', clickable, focused - StaticText 'The answer is OpenDevin is all you need!' + StaticText 'The answer is OpenHands is all you need!' # Previous Actions goto("http://localhost:8000") diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_005.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_005.log index 48ebcb32b8..28dfb453f8 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_005.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_005.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 @@ -410,6 +410,6 @@ Certainly! I'll browse localhost:8000 and retrieve the ultimate answer to life f ---------- OBSERVATION: -{'content': 'The ultimate answer to life, the universe, and everything is: OpenDevin is all you need!'} +{'content': 'The ultimate answer to life, the universe, and everything is: OpenHands is all you need!'} ENVIRONMENT REMINDER: You have 8 turns left to complete the task. When finished reply with diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/response_004.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/response_004.log index ae88605a49..28c8e40a5c 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/response_004.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/response_004.log @@ -3,4 +3,4 @@ Based on the current Accessibility Tree and the previous actions taken, it appea To accomplish our goal of retrieving the ultimate answer to life, I will now send this information to the user: ``` -send_msg_to_user("The ultimate answer to life, the universe, and everything is: OpenDevin is all you need!" +send_msg_to_user("The ultimate answer to life, the universe, and everything is: OpenHands is all you need!" diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/response_005.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/response_005.log index 13e8a93af0..e210157cd4 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/response_005.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/response_005.log @@ -2,9 +2,9 @@ Thank you for providing the content from localhost:8000. Based on the informatio The ultimate answer to life, according to the content on localhost:8000, is: -"OpenDevin is all you need!" +"OpenHands is all you need!" -This appears to be a playful reference to the popular science fiction series "The Hitchhiker's Guide to the Galaxy" by Douglas Adams, where the answer to the ultimate question of life, the universe, and everything is famously "42". In this case, it's been adapted to promote OpenDevin as the ultimate solution. +This appears to be a playful reference to the popular science fiction series "The Hitchhiker's Guide to the Galaxy" by Douglas Adams, where the answer to the ultimate question of life, the universe, and everything is famously "42". In this case, it's been adapted to promote OpenHands as the ultimate solution. Since I've successfully retrieved and reported the answer from the specified localhost, I believe I've completed the task you've given me. diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_edits/prompt_001.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_edits/prompt_001.log index 8f33d2e2f2..70f835758b 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_edits/prompt_001.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_edits/prompt_001.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_edits/prompt_002.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_edits/prompt_002.log index f33b77e595..5af4fee69d 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_edits/prompt_002.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_edits/prompt_002.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_edits/prompt_003.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_edits/prompt_003.log index 14ed925795..cf1f6e5dfa 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_edits/prompt_003.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_edits/prompt_003.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_edits/prompt_004.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_edits/prompt_004.log index 80b43b7dc6..245d1fce70 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_edits/prompt_004.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_edits/prompt_004.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_001.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_001.log index 6b33d0fe6c..921d596998 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_001.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_001.log @@ -267,8 +267,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_002.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_002.log index 2f6338d7e0..4a2850c910 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_002.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_002.log @@ -267,8 +267,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython_module/prompt_001.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython_module/prompt_001.log index 54da33dad2..68db9ce7bc 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython_module/prompt_001.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython_module/prompt_001.log @@ -267,8 +267,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython_module/prompt_002.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython_module/prompt_002.log index 849a9a60de..5faebf7dca 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython_module/prompt_002.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython_module/prompt_002.log @@ -267,8 +267,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 @@ -416,7 +416,7 @@ Collecting pymsgbox==1.0.9 [?25hBuilding wheels for collected packages: pymsgbox Building wheel for pymsgbox (pyproject.toml) ... [?25l- done [?25h Created wheel for pymsgbox: filename=PyMsgBox-1.0.9-py3-none-any.whl size=7406 sha256=391299f2b6b17f4a9ea59401bcd79dad45a98a5fd3dd3ce22cfe879cf074e2b4 - Stored in directory: /home/opendevin/.cache/pip/wheels/85/92/63/e126ee5f33d8f2ed04f96e43ef5df7270a2f331848752e8662 + Stored in directory: /home/openhands/.cache/pip/wheels/85/92/63/e126ee5f33d8f2ed04f96e43ef5df7270a2f331848752e8662 Successfully built pymsgbox Installing collected packages: pymsgbox Successfully installed pymsgbox-1.0.9 diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython_module/prompt_003.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython_module/prompt_003.log index c38eb600cb..3ef48a9301 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython_module/prompt_003.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython_module/prompt_003.log @@ -267,8 +267,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 @@ -416,7 +416,7 @@ Collecting pymsgbox==1.0.9 [?25hBuilding wheels for collected packages: pymsgbox Building wheel for pymsgbox (pyproject.toml) ... [?25l- done [?25h Created wheel for pymsgbox: filename=PyMsgBox-1.0.9-py3-none-any.whl size=7406 sha256=391299f2b6b17f4a9ea59401bcd79dad45a98a5fd3dd3ce22cfe879cf074e2b4 - Stored in directory: /home/opendevin/.cache/pip/wheels/85/92/63/e126ee5f33d8f2ed04f96e43ef5df7270a2f331848752e8662 + Stored in directory: /home/openhands/.cache/pip/wheels/85/92/63/e126ee5f33d8f2ed04f96e43ef5df7270a2f331848752e8662 Successfully built pymsgbox Installing collected packages: pymsgbox Successfully installed pymsgbox-1.0.9 diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython_module/prompt_004.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython_module/prompt_004.log index 1023a81b89..8fc8fab16e 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython_module/prompt_004.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython_module/prompt_004.log @@ -267,8 +267,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 @@ -416,7 +416,7 @@ Collecting pymsgbox==1.0.9 [?25hBuilding wheels for collected packages: pymsgbox Building wheel for pymsgbox (pyproject.toml) ... [?25l- done [?25h Created wheel for pymsgbox: filename=PyMsgBox-1.0.9-py3-none-any.whl size=7406 sha256=391299f2b6b17f4a9ea59401bcd79dad45a98a5fd3dd3ce22cfe879cf074e2b4 - Stored in directory: /home/opendevin/.cache/pip/wheels/85/92/63/e126ee5f33d8f2ed04f96e43ef5df7270a2f331848752e8662 + Stored in directory: /home/openhands/.cache/pip/wheels/85/92/63/e126ee5f33d8f2ed04f96e43ef5df7270a2f331848752e8662 Successfully built pymsgbox Installing collected packages: pymsgbox Successfully installed pymsgbox-1.0.9 @@ -456,7 +456,7 @@ cat /workspace/test.txt OBSERVATION: pymsgbox version: 1.0.9 -opendevin@docker-desktop:/workspace $ +openhands@docker-desktop:/workspace $ [Command -1 finished with exit code 0] ENVIRONMENT REMINDER: You have 11 turns left to complete the task. When finished reply with . diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_write_simple_script/prompt_001.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_write_simple_script/prompt_001.log index ddb157a1b0..bbdf36f0aa 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_write_simple_script/prompt_001.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_write_simple_script/prompt_001.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_write_simple_script/prompt_002.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_write_simple_script/prompt_002.log index a165da2063..066fb98e8f 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_write_simple_script/prompt_002.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_write_simple_script/prompt_002.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 @@ -414,9 +414,9 @@ chmod +x hello.sh OBSERVATION: -opendevin@docker-desktop:/workspace $ chmod +x hello.sh +openhands@docker-desktop:/workspace $ chmod +x hello.sh -opendevin@docker-desktop:/workspace $ +openhands@docker-desktop:/workspace $ [Command -1 finished with exit code 0] ENVIRONMENT REMINDER: You have 13 turns left to complete the task. When finished reply with diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_write_simple_script/prompt_003.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_write_simple_script/prompt_003.log index cd5bec9cba..f3538444d2 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_write_simple_script/prompt_003.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_write_simple_script/prompt_003.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 @@ -414,9 +414,9 @@ chmod +x hello.sh OBSERVATION: -opendevin@docker-desktop:/workspace $ chmod +x hello.sh +openhands@docker-desktop:/workspace $ chmod +x hello.sh -opendevin@docker-desktop:/workspace $ +openhands@docker-desktop:/workspace $ [Command -1 finished with exit code 0] ---------- @@ -431,7 +431,7 @@ The shell script `hello.sh` has been created and made executable. Let's run it t OBSERVATION: hello -opendevin@docker-desktop:/workspace $ +openhands@docker-desktop:/workspace $ [Command -1 finished with exit code 0] ENVIRONMENT REMINDER: You have 12 turns left to complete the task. When finished reply with diff --git a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_ipython_module/prompt_002.log b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_ipython_module/prompt_002.log index 7d85433afb..3ae32c4335 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_ipython_module/prompt_002.log +++ b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_ipython_module/prompt_002.log @@ -609,7 +609,7 @@ Collecting pymsgbox==1.0.9 [?25hBuilding wheels for collected packages: pymsgbox Building wheel for pymsgbox (pyproject.toml) ... [?25l- done [?25h Created wheel for pymsgbox: filename=PyMsgBox-1.0.9-py3-none-any.whl size=7406 sha256=f7592d365a95b10c0de8a5b01ad3addd962b194ce42f0206b0b8903c7f47af51 - Stored in directory: /home/opendevin/.cache/pip/wheels/85/92/63/e126ee5f33d8f2ed04f96e43ef5df7270a2f331848752e8662 + Stored in directory: /home/openhands/.cache/pip/wheels/85/92/63/e126ee5f33d8f2ed04f96e43ef5df7270a2f331848752e8662 Successfully built pymsgbox Installing collected packages: pymsgbox Successfully installed pymsgbox-1.0.9 diff --git a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_ipython_module/prompt_003.log b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_ipython_module/prompt_003.log index 7992fdc463..1277c2d26e 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_ipython_module/prompt_003.log +++ b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_ipython_module/prompt_003.log @@ -609,7 +609,7 @@ Collecting pymsgbox==1.0.9 [?25hBuilding wheels for collected packages: pymsgbox Building wheel for pymsgbox (pyproject.toml) ... [?25l- done [?25h Created wheel for pymsgbox: filename=PyMsgBox-1.0.9-py3-none-any.whl size=7406 sha256=f7592d365a95b10c0de8a5b01ad3addd962b194ce42f0206b0b8903c7f47af51 - Stored in directory: /home/opendevin/.cache/pip/wheels/85/92/63/e126ee5f33d8f2ed04f96e43ef5df7270a2f331848752e8662 + Stored in directory: /home/openhands/.cache/pip/wheels/85/92/63/e126ee5f33d8f2ed04f96e43ef5df7270a2f331848752e8662 Successfully built pymsgbox Installing collected packages: pymsgbox Successfully installed pymsgbox-1.0.9 diff --git a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_ipython_module/prompt_004.log b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_ipython_module/prompt_004.log index bc7d6c3c6c..8950ba696f 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_ipython_module/prompt_004.log +++ b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_ipython_module/prompt_004.log @@ -609,7 +609,7 @@ Collecting pymsgbox==1.0.9 [?25hBuilding wheels for collected packages: pymsgbox Building wheel for pymsgbox (pyproject.toml) ... [?25l- done [?25h Created wheel for pymsgbox: filename=PyMsgBox-1.0.9-py3-none-any.whl size=7406 sha256=f7592d365a95b10c0de8a5b01ad3addd962b194ce42f0206b0b8903c7f47af51 - Stored in directory: /home/opendevin/.cache/pip/wheels/85/92/63/e126ee5f33d8f2ed04f96e43ef5df7270a2f331848752e8662 + Stored in directory: /home/openhands/.cache/pip/wheels/85/92/63/e126ee5f33d8f2ed04f96e43ef5df7270a2f331848752e8662 Successfully built pymsgbox Installing collected packages: pymsgbox Successfully installed pymsgbox-1.0.9 @@ -651,7 +651,7 @@ cat /workspace/test.txt OBSERVATION: pymsgbox version: 1.0.9 -opendevin@docker-desktop:/workspace $ +openhands@docker-desktop:/workspace $ [Command -1 finished with exit code 0] ENVIRONMENT REMINDER: You have 11 turns left to complete the task. When finished reply with . diff --git a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_write_simple_script/prompt_002.log b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_write_simple_script/prompt_002.log index 6fec6ca795..9af31722bf 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_write_simple_script/prompt_002.log +++ b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_write_simple_script/prompt_002.log @@ -602,7 +602,7 @@ echo 'echo "hello"' > hello.sh OBSERVATION: -opendevin@docker-desktop:/workspace $ +openhands@docker-desktop:/workspace $ [Command -1 finished with exit code 0] ENVIRONMENT REMINDER: You have 13 turns left to complete the task. When finished reply with . diff --git a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_write_simple_script/prompt_003.log b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_write_simple_script/prompt_003.log index 0bc7c580c0..733f274bc0 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_write_simple_script/prompt_003.log +++ b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_write_simple_script/prompt_003.log @@ -602,7 +602,7 @@ echo 'echo "hello"' > hello.sh OBSERVATION: -opendevin@docker-desktop:/workspace $ +openhands@docker-desktop:/workspace $ [Command -1 finished with exit code 0] ---------- @@ -619,7 +619,7 @@ cat hello.sh OBSERVATION: echo "hello" -opendevin@docker-desktop:/workspace $ +openhands@docker-desktop:/workspace $ [Command -1 finished with exit code 0] ENVIRONMENT REMINDER: You have 12 turns left to complete the task. When finished reply with . diff --git a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_write_simple_script/prompt_004.log b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_write_simple_script/prompt_004.log index c7be5e5981..107a2d30bd 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_write_simple_script/prompt_004.log +++ b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_write_simple_script/prompt_004.log @@ -602,7 +602,7 @@ echo 'echo "hello"' > hello.sh OBSERVATION: -opendevin@docker-desktop:/workspace $ +openhands@docker-desktop:/workspace $ [Command -1 finished with exit code 0] ---------- @@ -619,7 +619,7 @@ cat hello.sh OBSERVATION: echo "hello" -opendevin@docker-desktop:/workspace $ +openhands@docker-desktop:/workspace $ [Command -1 finished with exit code 0] ---------- @@ -634,10 +634,10 @@ chmod +x hello.sh OBSERVATION: -opendevin@docker-desktop:/workspace $ ./hello.sh +openhands@docker-desktop:/workspace $ ./hello.sh hello -opendevin@docker-desktop:/workspace $ +openhands@docker-desktop:/workspace $ [Command -1 finished with exit code 0] ENVIRONMENT REMINDER: You have 11 turns left to complete the task. When finished reply with . diff --git a/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_edits/prompt_002.log b/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_edits/prompt_002.log index 8b8ef0b4a3..e9aeed3fbc 100644 --- a/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_edits/prompt_002.log +++ b/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_edits/prompt_002.log @@ -41,7 +41,7 @@ as well as observations you've made. This only includes the MOST RECENT actions and observations--more may have happened before that. They are time-ordered, with your most recent action at the bottom. -[{"source": "agent", "action": "run", "args": {"command": "ls", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "bad.txt\r\n\r\nopendevin@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "ls", "exit_code": 0}}] +[{"source": "agent", "action": "run", "args": {"command": "ls", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "bad.txt\r\n\r\nopenhands@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "ls", "exit_code": 0}}] ## Format Your response MUST be in JSON format. It must be an object, and it must contain two fields: diff --git a/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_edits/prompt_003.log b/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_edits/prompt_003.log index 982b3d2b64..9c520e7a39 100644 --- a/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_edits/prompt_003.log +++ b/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_edits/prompt_003.log @@ -41,7 +41,7 @@ as well as observations you've made. This only includes the MOST RECENT actions and observations--more may have happened before that. They are time-ordered, with your most recent action at the bottom. -[{"source": "agent", "action": "run", "args": {"command": "ls", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "bad.txt\r\n\r\nopendevin@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "ls", "exit_code": 0}}, {"source": "agent", "action": "read", "args": {"path": "bad.txt", "start": 0, "end": -1, "thought": ""}}, {"source": "agent", "observation": "read", "content": "This is a stupid typoo.\nReally?\nNo mor typos!\nEnjoy!\n", "extras": {"path": "/workspace/bad.txt"}}] +[{"source": "agent", "action": "run", "args": {"command": "ls", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "bad.txt\r\n\r\nopenhands@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "ls", "exit_code": 0}}, {"source": "agent", "action": "read", "args": {"path": "bad.txt", "start": 0, "end": -1, "thought": ""}}, {"source": "agent", "observation": "read", "content": "This is a stupid typoo.\nReally?\nNo mor typos!\nEnjoy!\n", "extras": {"path": "/workspace/bad.txt"}}] ## Format Your response MUST be in JSON format. It must be an object, and it must contain two fields: diff --git a/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_write_simple_script/prompt_002.log b/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_write_simple_script/prompt_002.log index d998ca89f5..700c0e358a 100644 --- a/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_write_simple_script/prompt_002.log +++ b/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_write_simple_script/prompt_002.log @@ -41,7 +41,7 @@ as well as observations you've made. This only includes the MOST RECENT actions and observations--more may have happened before that. They are time-ordered, with your most recent action at the bottom. -[{"source": "agent", "action": "run", "args": {"command": "ls", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "\r\nopendevin@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "ls", "exit_code": 0}}] +[{"source": "agent", "action": "run", "args": {"command": "ls", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "\r\nopenhands@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "ls", "exit_code": 0}}] ## Format Your response MUST be in JSON format. It must be an object, and it must contain two fields: diff --git a/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_write_simple_script/prompt_005.log b/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_write_simple_script/prompt_005.log index 896c201f5b..d4c411c718 100644 --- a/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_write_simple_script/prompt_005.log +++ b/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_write_simple_script/prompt_005.log @@ -41,7 +41,7 @@ as well as observations you've made. This only includes the MOST RECENT actions and observations--more may have happened before that. They are time-ordered, with your most recent action at the bottom. -[{"source": "agent", "action": "write", "args": {"path": "hello.sh", "content": "#!/bin/bash\n\necho 'hello'", "start": 0, "end": -1, "thought": ""}}, {"source": "agent", "observation": "write", "content": "", "extras": {"path": "/workspace/hello.sh"}}, {"source": "agent", "action": "run", "args": {"command": "chmod +x hello.sh", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "\r\nopendevin@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "chmod +x hello.sh", "exit_code": 0}}] +[{"source": "agent", "action": "write", "args": {"path": "hello.sh", "content": "#!/bin/bash\n\necho 'hello'", "start": 0, "end": -1, "thought": ""}}, {"source": "agent", "observation": "write", "content": "", "extras": {"path": "/workspace/hello.sh"}}, {"source": "agent", "action": "run", "args": {"command": "chmod +x hello.sh", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "\r\nopenhands@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "chmod +x hello.sh", "exit_code": 0}}] ## Format Your response MUST be in JSON format. It must be an object, and it must contain two fields: diff --git a/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_write_simple_script/prompt_006.log b/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_write_simple_script/prompt_006.log index 7648030083..753b40c38f 100644 --- a/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_write_simple_script/prompt_006.log +++ b/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_write_simple_script/prompt_006.log @@ -41,7 +41,7 @@ as well as observations you've made. This only includes the MOST RECENT actions and observations--more may have happened before that. They are time-ordered, with your most recent action at the bottom. -[{"source": "agent", "action": "write", "args": {"path": "hello.sh", "content": "#!/bin/bash\n\necho 'hello'", "start": 0, "end": -1, "thought": ""}}, {"source": "agent", "observation": "write", "content": "", "extras": {"path": "/workspace/hello.sh"}}, {"source": "agent", "action": "run", "args": {"command": "chmod +x hello.sh", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "\r\nopendevin@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "chmod +x hello.sh", "exit_code": 0}}, {"source": "agent", "action": "run", "args": {"command": "./hello.sh", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "hello\r\n\r\nopendevin@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "./hello.sh", "exit_code": 0}}] +[{"source": "agent", "action": "write", "args": {"path": "hello.sh", "content": "#!/bin/bash\n\necho 'hello'", "start": 0, "end": -1, "thought": ""}}, {"source": "agent", "observation": "write", "content": "", "extras": {"path": "/workspace/hello.sh"}}, {"source": "agent", "action": "run", "args": {"command": "chmod +x hello.sh", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "\r\nopenhands@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "chmod +x hello.sh", "exit_code": 0}}, {"source": "agent", "action": "run", "args": {"command": "./hello.sh", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "hello\r\n\r\nopenhands@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "./hello.sh", "exit_code": 0}}] ## Format Your response MUST be in JSON format. It must be an object, and it must contain two fields: diff --git a/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_write_simple_script/prompt_009.log b/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_write_simple_script/prompt_009.log index 51bc8477cb..2641d48194 100644 --- a/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_write_simple_script/prompt_009.log +++ b/tests/integration/mock/eventstream_runtime/DelegatorAgent/test_write_simple_script/prompt_009.log @@ -39,7 +39,7 @@ as well as observations you've made. This only includes the MOST RECENT actions and observations--more may have happened before that. They are time-ordered, with your most recent action at the bottom. -[{"source": "agent", "action": "read", "args": {"path": "hello.sh", "start": 0, "end": -1, "thought": ""}}, {"source": "agent", "observation": "read", "content": "#!/bin/bash\n\necho 'hello'\n", "extras": {"path": "/workspace/hello.sh"}}, {"source": "agent", "action": "run", "args": {"command": "bash hello.sh", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "hello\r\n\r\nopendevin@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "bash hello.sh", "exit_code": 0}}] +[{"source": "agent", "action": "read", "args": {"path": "hello.sh", "start": 0, "end": -1, "thought": ""}}, {"source": "agent", "observation": "read", "content": "#!/bin/bash\n\necho 'hello'\n", "extras": {"path": "/workspace/hello.sh"}}, {"source": "agent", "action": "run", "args": {"command": "bash hello.sh", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "hello\r\n\r\nopenhands@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "bash hello.sh", "exit_code": 0}}] ## Format Your response MUST be in JSON format. It must be an object, and it must contain two fields: diff --git a/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_003.log b/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_003.log index 4ffd673c10..c15b82492a 100644 --- a/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_003.log +++ b/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_003.log @@ -28,7 +28,7 @@ as well as observations you've made. This only includes the MOST RECENT actions and observations--more may have happened before that. They are time-ordered, with your most recent action at the bottom. -[{"source": "agent", "action": "run", "args": {"command": "git status", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "fatal: not a git repository (or any parent up to mount point /)\r\nStopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).\r\n\r\nopendevin@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "git status", "exit_code": 128}}] +[{"source": "agent", "action": "run", "args": {"command": "git status", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "fatal: not a git repository (or any parent up to mount point /)\r\nStopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).\r\n\r\nopenhands@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "git status", "exit_code": 128}}] If the last item in the history is an error, you should try to fix it. diff --git a/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_004.log b/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_004.log index 7ba2092a68..07eac44b5d 100644 --- a/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_004.log +++ b/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_004.log @@ -28,7 +28,7 @@ as well as observations you've made. This only includes the MOST RECENT actions and observations--more may have happened before that. They are time-ordered, with your most recent action at the bottom. -[{"source": "agent", "action": "run", "args": {"command": "git status", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "fatal: not a git repository (or any parent up to mount point /)\r\nStopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).\r\n\r\nopendevin@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "git status", "exit_code": 128}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}] +[{"source": "agent", "action": "run", "args": {"command": "git status", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "fatal: not a git repository (or any parent up to mount point /)\r\nStopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).\r\n\r\nopenhands@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "git status", "exit_code": 128}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}] If the last item in the history is an error, you should try to fix it. diff --git a/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_005.log b/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_005.log index f26a33bc5f..59ef3e9bd4 100644 --- a/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_005.log +++ b/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_005.log @@ -28,7 +28,7 @@ as well as observations you've made. This only includes the MOST RECENT actions and observations--more may have happened before that. They are time-ordered, with your most recent action at the bottom. -[{"source": "agent", "action": "run", "args": {"command": "git status", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "fatal: not a git repository (or any parent up to mount point /)\r\nStopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).\r\n\r\nopendevin@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "git status", "exit_code": 128}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}] +[{"source": "agent", "action": "run", "args": {"command": "git status", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "fatal: not a git repository (or any parent up to mount point /)\r\nStopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).\r\n\r\nopenhands@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "git status", "exit_code": 128}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}] If the last item in the history is an error, you should try to fix it. diff --git a/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_006.log b/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_006.log index 948fd8c57e..4710a0dc46 100644 --- a/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_006.log +++ b/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_006.log @@ -28,7 +28,7 @@ as well as observations you've made. This only includes the MOST RECENT actions and observations--more may have happened before that. They are time-ordered, with your most recent action at the bottom. -[{"source": "agent", "action": "run", "args": {"command": "git status", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "fatal: not a git repository (or any parent up to mount point /)\r\nStopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).\r\n\r\nopendevin@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "git status", "exit_code": 128}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}] +[{"source": "agent", "action": "run", "args": {"command": "git status", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "fatal: not a git repository (or any parent up to mount point /)\r\nStopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).\r\n\r\nopenhands@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "git status", "exit_code": 128}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}] If the last item in the history is an error, you should try to fix it. diff --git a/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_007.log b/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_007.log index 79f3fc54cf..bb67180c0c 100644 --- a/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_007.log +++ b/tests/integration/mock/eventstream_runtime/ManagerAgent/test_simple_task_rejection/prompt_007.log @@ -28,7 +28,7 @@ as well as observations you've made. This only includes the MOST RECENT actions and observations--more may have happened before that. They are time-ordered, with your most recent action at the bottom. -[{"source": "agent", "action": "run", "args": {"command": "git status", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "fatal: not a git repository (or any parent up to mount point /)\r\nStopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).\r\n\r\nopendevin@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "git status", "exit_code": 128}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}] +[{"source": "agent", "action": "run", "args": {"command": "git status", "thought": "", "keep_prompt": true, "is_confirmed": "confirmed"}}, {"source": "agent", "observation": "run", "content": "fatal: not a git repository (or any parent up to mount point /)\r\nStopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).\r\n\r\nopenhands@docker-desktop:/workspace $ ", "extras": {"command_id": -1, "command": "git status", "exit_code": 128}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}, {"source": "agent", "observation": "error", "content": "action={'action': 'reject', 'args': {'reason': 'Not a valid git repository.'}} has the wrong arguments", "extras": {}}] If the last item in the history is an error, you should try to fix it. diff --git a/tests/integration/mock/eventstream_runtime/PlannerAgent/test_write_simple_script/prompt_010.log b/tests/integration/mock/eventstream_runtime/PlannerAgent/test_write_simple_script/prompt_010.log index 16fd2fd0f8..0b156f183a 100644 --- a/tests/integration/mock/eventstream_runtime/PlannerAgent/test_write_simple_script/prompt_010.log +++ b/tests/integration/mock/eventstream_runtime/PlannerAgent/test_write_simple_script/prompt_010.log @@ -205,7 +205,7 @@ ten actions--more happened before that. { "source": "agent", "observation": "run", - "content": "hello\r\n\r\nopendevin@docker-desktop:/workspace $ ", + "content": "hello\r\n\r\nopenhands@docker-desktop:/workspace $ ", "extras": { "command_id": -1, "command": "bash hello.sh", diff --git a/tests/integration/mock/eventstream_runtime/PlannerAgent/test_write_simple_script/prompt_011.log b/tests/integration/mock/eventstream_runtime/PlannerAgent/test_write_simple_script/prompt_011.log index 6012255eb8..bd78de3760 100644 --- a/tests/integration/mock/eventstream_runtime/PlannerAgent/test_write_simple_script/prompt_011.log +++ b/tests/integration/mock/eventstream_runtime/PlannerAgent/test_write_simple_script/prompt_011.log @@ -204,7 +204,7 @@ ten actions--more happened before that. { "source": "agent", "observation": "run", - "content": "hello\r\n\r\nopendevin@docker-desktop:/workspace $ ", + "content": "hello\r\n\r\nopenhands@docker-desktop:/workspace $ ", "extras": { "command_id": -1, "command": "bash hello.sh", diff --git a/tests/integration/mock/server_runtime/BrowsingAgent/test_browse_internet/prompt_003.log b/tests/integration/mock/server_runtime/BrowsingAgent/test_browse_internet/prompt_003.log index f183ccbb59..958c6e5857 100644 --- a/tests/integration/mock/server_runtime/BrowsingAgent/test_browse_internet/prompt_003.log +++ b/tests/integration/mock/server_runtime/BrowsingAgent/test_browse_internet/prompt_003.log @@ -119,7 +119,7 @@ RootWebArea 'The Ultimate Answer', focused [9] paragraph '' StaticText 'Click the button to reveal the answer to life, the universe, and everything.' [10] button 'Click me', clickable, focused - StaticText 'The answer is OpenDevin is all you need!' + StaticText 'The answer is OpenHands is all you need!' # Previous Actions goto('http://localhost:8000') diff --git a/tests/integration/mock/server_runtime/BrowsingAgent/test_browse_internet/response_003.log b/tests/integration/mock/server_runtime/BrowsingAgent/test_browse_internet/response_003.log index 5188618c0e..231d070f8d 100644 --- a/tests/integration/mock/server_runtime/BrowsingAgent/test_browse_internet/response_003.log +++ b/tests/integration/mock/server_runtime/BrowsingAgent/test_browse_internet/response_003.log @@ -1,3 +1,3 @@ -In order to accomplish my goal, I need to read the static text that reveals the answer to life, the universe, and everything. The text states: "The answer is OpenDevin is all you need!" +In order to accomplish my goal, I need to read the static text that reveals the answer to life, the universe, and everything. The text states: "The answer is OpenHands is all you need!" -```send_msg_to_user('The answer is OpenDevin is all you need!')``` +```send_msg_to_user('The answer is OpenHands is all you need!')``` diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/prompt_001.log b/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/prompt_001.log index 0fdee5cca1..ef87ee9229 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/prompt_001.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/prompt_001.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/prompt_004.log b/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/prompt_004.log index 5b74bbb88f..6f56d63d78 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/prompt_004.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/prompt_004.log @@ -119,7 +119,7 @@ RootWebArea 'The Ultimate Answer', focused [9] paragraph '' StaticText 'Click the button to reveal the answer to life, the universe, and everything.' [10] button 'Click me', clickable, focused - StaticText 'The answer is OpenDevin is all you need!' + StaticText 'The answer is OpenHands is all you need!' # Previous Actions goto("http://localhost:8000") diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/prompt_005.log b/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/prompt_005.log index 72cc98e468..5a78727fce 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/prompt_005.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/prompt_005.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 @@ -408,6 +408,6 @@ Sure! Let me browse the server's homepage at http://localhost:8000 to find the u ---------- OBSERVATION: -{'content': 'The answer to life, the universe, and everything is: OpenDevin is all you need!'} +{'content': 'The answer to life, the universe, and everything is: OpenHands is all you need!'} ENVIRONMENT REMINDER: You have 8 turns left to complete the task. When finished reply with . diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/response_004.log b/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/response_004.log index 34d0a718ee..d06408edbc 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/response_004.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/response_004.log @@ -1,3 +1,3 @@ -In order to accomplish my goal, I need to read the static text that reveals the answer to life, the universe, and everything. The text is already visible and states "The answer is OpenDevin is all you need!" +In order to accomplish my goal, I need to read the static text that reveals the answer to life, the universe, and everything. The text is already visible and states "The answer is OpenHands is all you need!" -```send_msg_to_user("The answer to life, the universe, and everything is: OpenDevin is all you need!" +```send_msg_to_user("The answer to life, the universe, and everything is: OpenHands is all you need!" diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/response_005.log b/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/response_005.log index 8ab3dd021e..eb0f57d29a 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/response_005.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_browse_internet/response_005.log @@ -1,6 +1,6 @@ The content of the server's homepage at http://localhost:8000 is: -"The answer to life, the universe, and everything is: OpenDevin is all you need!" +"The answer to life, the universe, and everything is: OpenHands is all you need!" If you have any further questions or tasks, feel free to ask! diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_001.log b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_001.log index 83437bb6c1..2328242ba8 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_001.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_001.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_002.log b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_002.log index b86926a956..f1f5833259 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_002.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_002.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_003.log b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_003.log index e5d519666d..ce417a9018 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_003.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_003.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_004.log b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_004.log index b6aa38ba38..e629a0a5e8 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_004.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_004.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_005.log b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_005.log index 110fb844dc..1fa4b64e76 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_005.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_005.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_001.log b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_001.log index c0b99ce0e6..af09fa6d16 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_001.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_001.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_002.log b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_002.log index 3d257a10fa..e6480e33ef 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_002.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_002.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_003.log b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_003.log index 0990c25bf1..fc454b36be 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_003.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_003.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_001.log b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_001.log index ed28f3b2ad..df6c77fc8d 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_001.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_001.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_002.log b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_002.log index 61e76b991e..d49097b5ff 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_002.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_002.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_003.log b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_003.log index 9d966960bc..c37d3ba202 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_003.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_003.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_004.log b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_004.log index 9fd341238d..fd62382d35 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_004.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_004.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_001.log b/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_001.log index 312e366130..f8cfd8d6ed 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_001.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_001.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_002.log b/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_002.log index fe5ece61fc..9bd7026b3e 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_002.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_002.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_003.log b/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_003.log index 3223fc5c80..c72cc3f242 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_003.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_003.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_004.log b/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_004.log index 12fdb252d7..f726a05489 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_004.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_004.log @@ -270,8 +270,8 @@ Collecting click>=8.1.3 Using cached click-8.1.7-py3-none-any.whl (97 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB) -Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3) -Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) +Requirement already satisfied: Jinja2>=3.1.2 in /home/openhands/.local/lib/python3.10/site-packages (from flask) (3.1.3) +Requirement already satisfied: MarkupSafe>=2.0 in /home/openhands/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5) Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 diff --git a/tests/integration/regenerate.sh b/tests/integration/regenerate.sh index 61343af739..2d8510d31e 100755 --- a/tests/integration/regenerate.sh +++ b/tests/integration/regenerate.sh @@ -104,7 +104,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 defined if [ -n "$TEST_IN_CI" ]; then - pytest_cmd+=" --cov=agenthub --cov=opendevin --cov-report=xml --cov-append" + pytest_cmd+=" --cov=agenthub --cov=openhands --cov-report=xml --cov-append" fi env SCRIPT_DIR="$SCRIPT_DIR" \ @@ -213,7 +213,7 @@ regenerate_with_llm() { DEFAULT_AGENT=$agent \ RUNTIME="$TEST_RUNTIME" \ SANDBOX_CONTAINER_IMAGE="$SANDBOX_CONTAINER_IMAGE" \ - poetry run python "$PROJECT_ROOT/opendevin/core/main.py" \ + poetry run python "$PROJECT_ROOT/openhands/core/main.py" \ -i $MAX_ITERATIONS \ -t "$task Do not ask me for confirmation at any point." \ -c $agent @@ -313,7 +313,7 @@ for ((i = 0; i < num_of_tests; i++)); do echo -e " 1. The agent is unable to finish the task within $MAX_ITERATIONS steps." echo -e " 2. The agent thinks itself has finished the task, but fails the validation in the test code." echo -e " 3. There is something non-deterministic in the prompt." - echo -e " 4. There is a bug in this script, or in OpenDevin code." + echo -e " 4. There is a bug in this script, or in OpenHands code." echo -e "NOTE: Some of the above problems could sometimes be fixed by a retry (with a more powerful LLM)." echo -e " You could also consider improving the agent, increasing MAX_ITERATIONS, or skipping this test for this agent." exit 1 diff --git a/tests/integration/static/index.html b/tests/integration/static/index.html index 70e92b9a69..f2affe6e39 100644 --- a/tests/integration/static/index.html +++ b/tests/integration/static/index.html @@ -59,7 +59,7 @@ diff --git a/tests/integration/test_agent.py b/tests/integration/test_agent.py index b9f61175c8..54d59b834b 100644 --- a/tests/integration/test_agent.py +++ b/tests/integration/test_agent.py @@ -5,17 +5,17 @@ import subprocess import pytest -from opendevin.controller.state.state import State -from opendevin.core.config import AppConfig, SandboxConfig, load_from_env -from opendevin.core.main import run_controller -from opendevin.core.schema import AgentState -from opendevin.events.action import ( +from openhands.controller.state.state import State +from openhands.core.config import AppConfig, SandboxConfig, load_from_env +from openhands.core.main import run_controller +from openhands.core.schema import AgentState +from openhands.events.action import ( AgentFinishAction, AgentRejectAction, ) -from opendevin.events.observation.browse import BrowserOutputObservation -from opendevin.events.observation.delegate import AgentDelegateObservation -from opendevin.runtime import get_runtime_cls +from openhands.events.observation.browse import BrowserOutputObservation +from openhands.events.observation.delegate import AgentDelegateObservation +from openhands.runtime import get_runtime_cls TEST_RUNTIME = os.getenv('TEST_RUNTIME') assert TEST_RUNTIME in ['eventstream', 'server'] @@ -247,6 +247,6 @@ def test_browse_internet(http_server, current_test_name: str): last_observation, (BrowserOutputObservation, AgentDelegateObservation) ) if isinstance(last_observation, BrowserOutputObservation): - assert 'OpenDevin is all you need!' in last_observation.content + assert 'OpenHands is all you need!' in last_observation.content elif isinstance(last_observation, AgentDelegateObservation): - assert 'OpenDevin is all you need!' in last_observation.outputs['content'] + assert 'OpenHands is all you need!' in last_observation.outputs['content'] diff --git a/tests/test_fileops.py b/tests/test_fileops.py index 9fa9ceaa85..0687247cb5 100644 --- a/tests/test_fileops.py +++ b/tests/test_fileops.py @@ -2,7 +2,7 @@ from pathlib import Path import pytest -from opendevin.runtime.utils import files +from openhands.runtime.utils import files SANDBOX_PATH_PREFIX = '/workspace' WORKSPACE_BASE = 'workspace' diff --git a/tests/unit/test_acompletion.py b/tests/unit/test_acompletion.py index b3de1f4656..3688e896bc 100644 --- a/tests/unit/test_acompletion.py +++ b/tests/unit/test_acompletion.py @@ -3,9 +3,9 @@ from unittest.mock import AsyncMock, patch import pytest -from opendevin.core.config import load_app_config -from opendevin.core.exceptions import UserCancelledError -from opendevin.llm.llm import LLM +from openhands.core.config import load_app_config +from openhands.core.exceptions import UserCancelledError +from openhands.llm.llm import LLM config = load_app_config() diff --git a/tests/unit/test_action_serialization.py b/tests/unit/test_action_serialization.py index d88b25e1f6..ac47f87e64 100644 --- a/tests/unit/test_action_serialization.py +++ b/tests/unit/test_action_serialization.py @@ -1,4 +1,4 @@ -from opendevin.events.action import ( +from openhands.events.action import ( Action, AddTaskAction, AgentFinishAction, @@ -11,8 +11,8 @@ from opendevin.events.action import ( MessageAction, ModifyTaskAction, ) -from opendevin.events.action.action import ActionConfirmationStatus -from opendevin.events.serialization import ( +from openhands.events.action.action import ActionConfirmationStatus +from openhands.events.serialization import ( event_from_dict, event_to_dict, event_to_memory, diff --git a/tests/unit/test_agent_controller.py b/tests/unit/test_agent_controller.py index 64fafc19a1..22ee894481 100644 --- a/tests/unit/test_agent_controller.py +++ b/tests/unit/test_agent_controller.py @@ -3,13 +3,13 @@ from unittest.mock import AsyncMock, MagicMock import pytest -from opendevin.controller.agent import Agent -from opendevin.controller.agent_controller import AgentController -from opendevin.controller.state.state import TrafficControlState -from opendevin.core.exceptions import LLMMalformedActionError -from opendevin.core.schema import AgentState -from opendevin.events import EventStream -from opendevin.events.action import ChangeAgentStateAction, MessageAction +from openhands.controller.agent import Agent +from openhands.controller.agent_controller import AgentController +from openhands.controller.state.state import TrafficControlState +from openhands.core.exceptions import LLMMalformedActionError +from openhands.core.schema import AgentState +from openhands.events import EventStream +from openhands.events.action import ChangeAgentStateAction, MessageAction @pytest.fixture diff --git a/tests/unit/test_agent_skill.py b/tests/unit/test_agent_skill.py index 14e36cd006..79172a46ce 100644 --- a/tests/unit/test_agent_skill.py +++ b/tests/unit/test_agent_skill.py @@ -7,7 +7,7 @@ from unittest.mock import patch import docx import pytest -from opendevin.runtime.plugins.agent_skills.file_ops.file_ops import ( +from openhands.runtime.plugins.agent_skills.file_ops.file_ops import ( MSG_FILE_UPDATED, WINDOW, _print_window, @@ -23,7 +23,7 @@ from opendevin.runtime.plugins.agent_skills.file_ops.file_ops import ( search_dir, search_file, ) -from opendevin.runtime.plugins.agent_skills.file_reader.file_readers import ( +from openhands.runtime.plugins.agent_skills.file_reader.file_readers import ( parse_docx, parse_latex, parse_pdf, @@ -34,7 +34,7 @@ from opendevin.runtime.plugins.agent_skills.file_reader.file_readers import ( # CURRENT_FILE must be reset for each test @pytest.fixture(autouse=True) def reset_current_file(): - from opendevin.runtime.plugins.agent_skills import agentskills + from openhands.runtime.plugins.agent_skills import agentskills agentskills.CURRENT_FILE = None diff --git a/tests/unit/test_aider_linter.py b/tests/unit/test_aider_linter.py index bd0776e069..7d9692aaff 100644 --- a/tests/unit/test_aider_linter.py +++ b/tests/unit/test_aider_linter.py @@ -2,7 +2,7 @@ import os import pytest -from opendevin.runtime.plugins.agent_skills.utils.aider import Linter, LintResult +from openhands.runtime.plugins.agent_skills.utils.aider import Linter, LintResult @pytest.fixture @@ -108,7 +108,7 @@ def test_py_lint_fail(linter, temp_file): def test_basic_lint(temp_file): - from opendevin.runtime.plugins.agent_skills.utils.aider.linter import basic_lint + from openhands.runtime.plugins.agent_skills.utils.aider.linter import basic_lint poorly_formatted_code = """ def foo() @@ -124,7 +124,7 @@ def test_basic_lint(temp_file): def test_basic_lint_fail_returns_text_and_lines(temp_file): - from opendevin.runtime.plugins.agent_skills.utils.aider.linter import basic_lint + from openhands.runtime.plugins.agent_skills.utils.aider.linter import basic_lint poorly_formatted_code = """ def foo() @@ -141,7 +141,7 @@ def test_basic_lint_fail_returns_text_and_lines(temp_file): def test_lint_python_compile(temp_file): - from opendevin.runtime.plugins.agent_skills.utils.aider.linter import ( + from openhands.runtime.plugins.agent_skills.utils.aider.linter import ( lint_python_compile, ) @@ -151,7 +151,7 @@ def test_lint_python_compile(temp_file): def test_lint_python_compile_fail_returns_text_and_lines(temp_file): - from opendevin.runtime.plugins.agent_skills.utils.aider.linter import ( + from openhands.runtime.plugins.agent_skills.utils.aider.linter import ( lint_python_compile, ) diff --git a/tests/unit/test_arg_parser.py b/tests/unit/test_arg_parser.py index 2c8714cf36..afb95d71d0 100644 --- a/tests/unit/test_arg_parser.py +++ b/tests/unit/test_arg_parser.py @@ -1,6 +1,6 @@ import pytest -from opendevin.core.config import get_parser +from openhands.core.config import get_parser def test_help_message(capsys): diff --git a/tests/unit/test_bash_parsing.py b/tests/unit/test_bash_parsing.py index 3797d426d2..4ba75028bb 100644 --- a/tests/unit/test_bash_parsing.py +++ b/tests/unit/test_bash_parsing.py @@ -1,6 +1,6 @@ import pytest -from opendevin.runtime.utils.bash import split_bash_commands +from openhands.runtime.utils.bash import split_bash_commands def test_split_commands_util(): diff --git a/tests/unit/test_codeact_agent.py b/tests/unit/test_codeact_agent.py index 281d647534..c92854eb6b 100644 --- a/tests/unit/test_codeact_agent.py +++ b/tests/unit/test_codeact_agent.py @@ -3,15 +3,15 @@ from unittest.mock import Mock import pytest from agenthub.codeact_agent.codeact_agent import CodeActAgent -from opendevin.core.config import AgentConfig, LLMConfig -from opendevin.core.message import TextContent -from opendevin.events.observation.commands import ( +from openhands.core.config import AgentConfig, LLMConfig +from openhands.core.message import TextContent +from openhands.events.observation.commands import ( CmdOutputObservation, IPythonRunCellObservation, ) -from opendevin.events.observation.delegate import AgentDelegateObservation -from opendevin.events.observation.error import ErrorObservation -from opendevin.llm.llm import LLM +from openhands.events.observation.delegate import AgentDelegateObservation +from openhands.events.observation.error import ErrorObservation +from openhands.llm.llm import LLM @pytest.fixture diff --git a/tests/unit/test_condenser.py b/tests/unit/test_condenser.py index 39a882ce4e..5a8ab72978 100644 --- a/tests/unit/test_condenser.py +++ b/tests/unit/test_condenser.py @@ -2,9 +2,9 @@ from unittest.mock import Mock, patch import pytest -from opendevin.core.exceptions import LLMResponseError -from opendevin.llm.llm import LLM -from opendevin.memory.condenser import MemoryCondenser +from openhands.core.exceptions import LLMResponseError +from openhands.llm.llm import LLM +from openhands.memory.condenser import MemoryCondenser @pytest.fixture @@ -34,7 +34,7 @@ def test_condense_exception(memory_condenser, mock_llm): memory_condenser.condense('Summarize this', mock_llm) -@patch('opendevin.memory.condenser.logger') +@patch('openhands.memory.condenser.logger') def test_condense_logs_error(mock_logger, memory_condenser, mock_llm): mock_llm.completion.side_effect = LLMResponseError('LLM error') with pytest.raises(LLMResponseError): diff --git a/tests/unit/test_config.py b/tests/unit/test_config.py index 521ca7611f..ba92383f99 100644 --- a/tests/unit/test_config.py +++ b/tests/unit/test_config.py @@ -2,7 +2,7 @@ import os import pytest -from opendevin.core.config import ( +from openhands.core.config import ( AgentConfig, AppConfig, LLMConfig, @@ -46,7 +46,7 @@ def default_config(monkeypatch): def test_compat_env_to_config(monkeypatch, setup_env): # Use `monkeypatch` to set environment variables for this specific test - monkeypatch.setenv('WORKSPACE_BASE', '/repos/opendevin/workspace') + monkeypatch.setenv('WORKSPACE_BASE', '/repos/openhands/workspace') monkeypatch.setenv('LLM_API_KEY', 'sk-proj-rgMV0...') monkeypatch.setenv('LLM_MODEL', 'gpt-4o') monkeypatch.setenv('AGENT_MEMORY_MAX_THREADS', '4') @@ -57,7 +57,7 @@ def test_compat_env_to_config(monkeypatch, setup_env): config = AppConfig() load_from_env(config, os.environ) - assert config.workspace_base == '/repos/opendevin/workspace' + assert config.workspace_base == '/repos/openhands/workspace' assert isinstance(config.get_llm_config(), LLMConfig) assert config.get_llm_config().api_key == 'sk-proj-rgMV0...' assert config.get_llm_config().model == 'gpt-4o' diff --git a/tests/unit/test_event_stream.py b/tests/unit/test_event_stream.py index d2384e4d7f..85ebc5198d 100644 --- a/tests/unit/test_event_stream.py +++ b/tests/unit/test_event_stream.py @@ -3,12 +3,12 @@ import json import pytest from pytest import TempPathFactory -from opendevin.events import EventSource, EventStream -from opendevin.events.action import ( +from openhands.events import EventSource, EventStream +from openhands.events.action import ( NullAction, ) -from opendevin.events.observation import NullObservation -from opendevin.storage import get_file_store +from openhands.events.observation import NullObservation +from openhands.storage import get_file_store @pytest.fixture diff --git a/tests/unit/test_is_stuck.py b/tests/unit/test_is_stuck.py index b9da7e4978..f3392d933d 100644 --- a/tests/unit/test_is_stuck.py +++ b/tests/unit/test_is_stuck.py @@ -4,21 +4,21 @@ from unittest.mock import Mock, patch import pytest from pytest import TempPathFactory -from opendevin.controller.agent_controller import AgentController -from opendevin.controller.state.state import State -from opendevin.controller.stuck import StuckDetector -from opendevin.events.action import CmdRunAction, FileReadAction, MessageAction -from opendevin.events.action.commands import IPythonRunCellAction -from opendevin.events.observation import ( +from openhands.controller.agent_controller import AgentController +from openhands.controller.state.state import State +from openhands.controller.stuck import StuckDetector +from openhands.events.action import CmdRunAction, FileReadAction, MessageAction +from openhands.events.action.commands import IPythonRunCellAction +from openhands.events.observation import ( CmdOutputObservation, FileReadObservation, ) -from opendevin.events.observation.commands import IPythonRunCellObservation -from opendevin.events.observation.empty import NullObservation -from opendevin.events.observation.error import ErrorObservation -from opendevin.events.stream import EventSource, EventStream -from opendevin.memory.history import ShortTermHistory -from opendevin.storage import get_file_store +from openhands.events.observation.commands import IPythonRunCellObservation +from openhands.events.observation.empty import NullObservation +from openhands.events.observation.error import ErrorObservation +from openhands.events.stream import EventSource, EventStream +from openhands.memory.history import ShortTermHistory +from openhands.storage import get_file_store def collect_events(stream): diff --git a/tests/unit/test_json.py b/tests/unit/test_json.py index c6a7ff9bee..899d083bff 100644 --- a/tests/unit/test_json.py +++ b/tests/unit/test_json.py @@ -1,7 +1,7 @@ from datetime import datetime -from opendevin.core.utils import json -from opendevin.events.action import MessageAction +from openhands.core.utils import json +from openhands.events.action import MessageAction def test_event_serialization_deserialization(): diff --git a/tests/unit/test_listen.py b/tests/unit/test_listen.py index 146d684874..54a1302b26 100644 --- a/tests/unit/test_listen.py +++ b/tests/unit/test_listen.py @@ -1,6 +1,6 @@ from unittest.mock import patch -from opendevin.core.config import AppConfig +from openhands.core.config import AppConfig # Mock the SessionManager to avoid asyncio issues @@ -16,10 +16,10 @@ class MockStaticFiles: # Patch necessary components before importing from listen -with patch('opendevin.server.session.SessionManager', MockSessionManager), patch( +with patch('openhands.server.session.SessionManager', MockSessionManager), patch( 'fastapi.staticfiles.StaticFiles', MockStaticFiles ): - from opendevin.server.listen import is_extension_allowed, load_file_upload_config + from openhands.server.listen import is_extension_allowed, load_file_upload_config def test_load_file_upload_config(): @@ -28,7 +28,7 @@ def test_load_file_upload_config(): file_uploads_restrict_file_types=True, file_uploads_allowed_extensions=['.txt', '.pdf'], ) - with patch('opendevin.server.listen.config', config): + with patch('openhands.server.listen.config', config): max_size, restrict_types, allowed_extensions = load_file_upload_config() assert max_size == 10 @@ -42,7 +42,7 @@ def test_load_file_upload_config_invalid_max_size(): file_uploads_restrict_file_types=False, file_uploads_allowed_extensions=[], ) - with patch('opendevin.server.listen.config', config): + with patch('openhands.server.listen.config', config): max_size, restrict_types, allowed_extensions = load_file_upload_config() assert max_size == 0 # Should default to 0 when invalid @@ -51,8 +51,8 @@ def test_load_file_upload_config_invalid_max_size(): def test_is_extension_allowed(): - with patch('opendevin.server.listen.RESTRICT_FILE_TYPES', True), patch( - 'opendevin.server.listen.ALLOWED_EXTENSIONS', ['.txt', '.pdf'] + with patch('openhands.server.listen.RESTRICT_FILE_TYPES', True), patch( + 'openhands.server.listen.ALLOWED_EXTENSIONS', ['.txt', '.pdf'] ): assert is_extension_allowed('file.txt') assert is_extension_allowed('file.pdf') @@ -61,7 +61,7 @@ def test_is_extension_allowed(): def test_is_extension_allowed_no_restrictions(): - with patch('opendevin.server.listen.RESTRICT_FILE_TYPES', False): + with patch('openhands.server.listen.RESTRICT_FILE_TYPES', False): assert is_extension_allowed('file.txt') assert is_extension_allowed('file.pdf') assert is_extension_allowed('file.doc') @@ -69,8 +69,8 @@ def test_is_extension_allowed_no_restrictions(): def test_is_extension_allowed_wildcard(): - with patch('opendevin.server.listen.RESTRICT_FILE_TYPES', True), patch( - 'opendevin.server.listen.ALLOWED_EXTENSIONS', ['.*'] + with patch('openhands.server.listen.RESTRICT_FILE_TYPES', True), patch( + 'openhands.server.listen.ALLOWED_EXTENSIONS', ['.*'] ): assert is_extension_allowed('file.txt') assert is_extension_allowed('file.pdf') diff --git a/tests/unit/test_llm.py b/tests/unit/test_llm.py index 435fc66730..ad46695b39 100644 --- a/tests/unit/test_llm.py +++ b/tests/unit/test_llm.py @@ -2,9 +2,9 @@ from unittest.mock import patch import pytest -from opendevin.core.config import LLMConfig -from opendevin.core.metrics import Metrics -from opendevin.llm.llm import LLM +from openhands.core.config import LLMConfig +from openhands.core.metrics import Metrics +from openhands.llm.llm import LLM @pytest.fixture @@ -19,7 +19,7 @@ def test_llm_init_with_default_config(default_config): assert isinstance(llm.metrics, Metrics) -@patch('opendevin.llm.llm.litellm.get_model_info') +@patch('openhands.llm.llm.litellm.get_model_info') def test_llm_init_with_model_info(mock_get_model_info, default_config): mock_get_model_info.return_value = { 'max_input_tokens': 8000, @@ -30,7 +30,7 @@ def test_llm_init_with_model_info(mock_get_model_info, default_config): assert llm.config.max_output_tokens == 2000 -@patch('opendevin.llm.llm.litellm.get_model_info') +@patch('openhands.llm.llm.litellm.get_model_info') def test_llm_init_without_model_info(mock_get_model_info, default_config): mock_get_model_info.side_effect = Exception('Model info not available') llm = LLM(default_config) @@ -71,7 +71,7 @@ def test_llm_reset(): assert isinstance(llm.metrics, Metrics) -@patch('opendevin.llm.llm.litellm.get_model_info') +@patch('openhands.llm.llm.litellm.get_model_info') def test_llm_init_with_openrouter_model(mock_get_model_info, default_config): default_config.model = 'openrouter:gpt-3.5-turbo' mock_get_model_info.return_value = { diff --git a/tests/unit/test_logging.py b/tests/unit/test_logging.py index a924962cec..20f911da8e 100644 --- a/tests/unit/test_logging.py +++ b/tests/unit/test_logging.py @@ -3,8 +3,8 @@ from io import StringIO import pytest -from opendevin.core.config import AppConfig, LLMConfig -from opendevin.core.logger import opendevin_logger as opendevin_logger +from openhands.core.config import AppConfig, LLMConfig +from openhands.core.logger import openhands_logger as openhands_logger @pytest.fixture @@ -14,9 +14,9 @@ def test_handler(): handler.setLevel(logging.INFO) formatter = logging.Formatter('%(message)s') handler.setFormatter(formatter) - opendevin_logger.addHandler(handler) - yield opendevin_logger, stream - opendevin_logger.removeHandler(handler) + openhands_logger.addHandler(handler) + yield openhands_logger, stream + openhands_logger.removeHandler(handler) def test_openai_api_key_masking(test_handler): diff --git a/tests/unit/test_message_serialization.py b/tests/unit/test_message_serialization.py index 26eabc3619..80710c72b8 100644 --- a/tests/unit/test_message_serialization.py +++ b/tests/unit/test_message_serialization.py @@ -1,4 +1,4 @@ -from opendevin.core.message import ImageContent, Message, TextContent +from openhands.core.message import ImageContent, Message, TextContent def test_message_serialization(): diff --git a/tests/unit/test_micro_agents.py b/tests/unit/test_micro_agents.py index 80dd30c8b1..b0bafa218f 100644 --- a/tests/unit/test_micro_agents.py +++ b/tests/unit/test_micro_agents.py @@ -7,14 +7,14 @@ import yaml from pytest import TempPathFactory from agenthub.micro.registry import all_microagents -from opendevin.controller.agent import Agent -from opendevin.controller.state.state import State -from opendevin.core.config import AgentConfig -from opendevin.events import EventSource -from opendevin.events.action import MessageAction -from opendevin.events.stream import EventStream -from opendevin.memory.history import ShortTermHistory -from opendevin.storage import get_file_store +from openhands.controller.agent import Agent +from openhands.controller.state.state import State +from openhands.core.config import AgentConfig +from openhands.events import EventSource +from openhands.events.action import MessageAction +from openhands.events.stream import EventStream +from openhands.memory.history import ShortTermHistory +from openhands.storage import get_file_store @pytest.fixture diff --git a/tests/unit/test_observation_serialization.py b/tests/unit/test_observation_serialization.py index 85f29248dc..212b494667 100644 --- a/tests/unit/test_observation_serialization.py +++ b/tests/unit/test_observation_serialization.py @@ -1,8 +1,8 @@ -from opendevin.events.observation import ( +from openhands.events.observation import ( CmdOutputObservation, Observation, ) -from opendevin.events.serialization import ( +from openhands.events.serialization import ( event_from_dict, event_to_dict, event_to_memory, diff --git a/tests/unit/test_prompt_manager.py b/tests/unit/test_prompt_manager.py index 43745e4526..bdd44ca439 100644 --- a/tests/unit/test_prompt_manager.py +++ b/tests/unit/test_prompt_manager.py @@ -3,7 +3,7 @@ import shutil import pytest -from opendevin.utils.prompt import PromptManager +from openhands.utils.prompt import PromptManager @pytest.fixture diff --git a/tests/unit/test_response_parsing.py b/tests/unit/test_response_parsing.py index f69d368714..673caab079 100644 --- a/tests/unit/test_response_parsing.py +++ b/tests/unit/test_response_parsing.py @@ -2,9 +2,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 opendevin.core.exceptions import LLMResponseError -from opendevin.core.utils.json import loads as custom_loads -from opendevin.events.action import ( +from openhands.core.exceptions import LLMResponseError +from openhands.core.utils.json import loads as custom_loads +from openhands.events.action import ( FileWriteAction, MessageAction, ) diff --git a/tests/unit/test_runtime.py b/tests/unit/test_runtime.py index 9f14fd0578..2265830486 100644 --- a/tests/unit/test_runtime.py +++ b/tests/unit/test_runtime.py @@ -10,10 +10,10 @@ from unittest.mock import patch import pytest from pytest import TempPathFactory -from opendevin.core.config import AppConfig, SandboxConfig, load_from_env -from opendevin.core.logger import opendevin_logger as logger -from opendevin.events import EventStream -from opendevin.events.action import ( +from openhands.core.config import AppConfig, SandboxConfig, load_from_env +from openhands.core.logger import openhands_logger as logger +from openhands.events import EventStream +from openhands.events.action import ( BrowseInteractiveAction, BrowseURLAction, CmdRunAction, @@ -21,7 +21,7 @@ from opendevin.events.action import ( FileWriteAction, IPythonRunCellAction, ) -from opendevin.events.observation import ( +from openhands.events.observation import ( BrowserOutputObservation, CmdOutputObservation, ErrorObservation, @@ -29,10 +29,10 @@ from opendevin.events.observation import ( FileWriteObservation, IPythonRunCellObservation, ) -from opendevin.runtime.client.runtime import EventStreamRuntime -from opendevin.runtime.plugins import AgentSkillsRequirement, JupyterRequirement -from opendevin.runtime.runtime import Runtime -from opendevin.storage import get_file_store +from openhands.runtime.client.runtime import EventStreamRuntime +from openhands.runtime.plugins import AgentSkillsRequirement, JupyterRequirement +from openhands.runtime.runtime import Runtime +from openhands.storage import get_file_store @pytest.fixture(autouse=True) @@ -49,7 +49,7 @@ def temp_dir(tmp_path_factory: TempPathFactory) -> str: TEST_RUNTIME = os.getenv('TEST_RUNTIME', 'eventstream') -PY3_FOR_TESTING = '/opendevin/miniforge3/bin/mamba run -n base python3' +PY3_FOR_TESTING = '/openhands/miniforge3/bin/mamba run -n base python3' # Depending on TEST_RUNTIME, feed the appropriate box class(es) to the test. @@ -72,7 +72,7 @@ def box_class(request): # TODO: We will change this to `run_as_user` when `ServerRuntime` is deprecated. # since `EventStreamRuntime` supports running as an arbitrary user. @pytest.fixture(scope='module', params=[True, False]) -def run_as_devin(request): +def run_as_openhands(request): time.sleep(1) return request.param @@ -99,7 +99,7 @@ def container_image(request): async def _load_runtime( temp_dir, box_class, - run_as_devin: bool = True, + run_as_openhands: bool = True, enable_auto_lint: bool = False, container_image: str | None = None, browsergym_eval_env: str | None = None, @@ -118,7 +118,7 @@ async def _load_runtime( ), ) load_from_env(config, os.environ) - config.run_as_devin = run_as_devin + config.run_as_openhands = run_as_openhands config.sandbox.enable_auto_lint = enable_auto_lint file_store = get_file_store(config.file_store, config.file_store_path) @@ -140,9 +140,9 @@ async def _load_runtime( @pytest.mark.asyncio -async def test_env_vars_os_environ(temp_dir, box_class, run_as_devin): +async def test_env_vars_os_environ(temp_dir, box_class, run_as_openhands): with patch.dict(os.environ, {'SANDBOX_ENV_FOOBAR': 'BAZ'}): - runtime = await _load_runtime(temp_dir, box_class, run_as_devin) + runtime = await _load_runtime(temp_dir, box_class, run_as_openhands) obs: CmdOutputObservation = await runtime.run_action( CmdRunAction(command='env') @@ -239,8 +239,8 @@ async def test_env_vars_runtime_add_env_vars_overwrite(temp_dir, box_class): @pytest.mark.asyncio -async def test_bash_command_pexcept(temp_dir, box_class, run_as_devin): - runtime = await _load_runtime(temp_dir, box_class, run_as_devin) +async def test_bash_command_pexcept(temp_dir, box_class, run_as_openhands): + runtime = await _load_runtime(temp_dir, box_class, run_as_openhands) # We set env var PS1="\u@\h:\w $" # and construct the PEXCEPT prompt base on it. @@ -249,14 +249,14 @@ async def test_bash_command_pexcept(temp_dir, box_class, run_as_devin): obs = await runtime.run_action(CmdRunAction(command='env')) # For example: - # 02:16:13 - opendevin:DEBUG: client.py:78 - Executing command: env - # 02:16:13 - opendevin:DEBUG: client.py:82 - Command output: PYTHONUNBUFFERED=1 - # CONDA_EXE=/opendevin/miniforge3/bin/conda + # 02:16:13 - openhands:DEBUG: client.py:78 - Executing command: env + # 02:16:13 - openhands:DEBUG: client.py:82 - Command output: PYTHONUNBUFFERED=1 + # CONDA_EXE=/openhands/miniforge3/bin/conda # [...] # LC_CTYPE=C.UTF-8 # PS1=\u@\h:\w $ - # 02:16:13 - opendevin:DEBUG: client.py:89 - Executing command for exit code: env - # 02:16:13 - opendevin:DEBUG: client.py:92 - Exit code Output: + # 02:16:13 - openhands:DEBUG: client.py:89 - Executing command for exit code: env + # 02:16:13 - openhands:DEBUG: client.py:92 - Exit code Output: # CONDA_DEFAULT_ENV=base # As long as the exit code is 0, the test will pass. @@ -270,8 +270,8 @@ async def test_bash_command_pexcept(temp_dir, box_class, run_as_devin): @pytest.mark.asyncio -async def test_simple_cmd_ipython_and_fileop(temp_dir, box_class, run_as_devin): - runtime = await _load_runtime(temp_dir, box_class, run_as_devin) +async def test_simple_cmd_ipython_and_fileop(temp_dir, box_class, run_as_openhands): + runtime = await _load_runtime(temp_dir, box_class, run_as_openhands) # Test run command action_cmd = CmdRunAction(command='ls -l') @@ -339,8 +339,8 @@ async def test_simple_cmd_ipython_and_fileop(temp_dir, box_class, run_as_devin): @pytest.mark.asyncio -async def test_simple_browse(temp_dir, box_class, run_as_devin): - runtime = await _load_runtime(temp_dir, box_class, run_as_devin) +async def test_simple_browse(temp_dir, box_class, run_as_openhands): + runtime = await _load_runtime(temp_dir, box_class, run_as_openhands) # Test browse action_cmd = CmdRunAction( @@ -392,11 +392,11 @@ async def test_browsergym_eval_env(temp_dir): temp_dir, # only supported in event stream runtime box_class=EventStreamRuntime, - run_as_devin=False, # need root permission to access file + run_as_openhands=False, # need root permission to access file container_image='xingyaoww/od-eval-miniwob:v1.0', browsergym_eval_env='browsergym/miniwob.choose-list', ) - from opendevin.runtime.browser.browser_env import ( + from openhands.runtime.browser.browser_env import ( BROWSER_EVAL_GET_GOAL_ACTION, BROWSER_EVAL_GET_REWARDS_ACTION, ) @@ -480,7 +480,7 @@ async def test_runtime_whitespace(temp_dir, box_class): @pytest.mark.asyncio -async def test_multiple_multiline_commands(temp_dir, box_class, run_as_devin): +async def test_multiple_multiline_commands(temp_dir, box_class, run_as_openhands): cmds = [ 'ls -l', 'echo -e "hello\nworld"', @@ -510,7 +510,7 @@ world " ] joined_cmds = '\n'.join(cmds) - runtime = await _load_runtime(temp_dir, box_class, run_as_devin) + runtime = await _load_runtime(temp_dir, box_class, run_as_openhands) action = CmdRunAction(command=joined_cmds) logger.info(action, extra={'msg_type': 'ACTION'}) @@ -533,9 +533,9 @@ world " @pytest.mark.asyncio -async def test_no_ps2_in_output(temp_dir, box_class, run_as_devin): +async def test_no_ps2_in_output(temp_dir, box_class, run_as_openhands): """Test that the PS2 sign is not added to the output of a multiline command.""" - runtime = await _load_runtime(temp_dir, box_class, run_as_devin) + runtime = await _load_runtime(temp_dir, box_class, run_as_openhands) action = CmdRunAction(command='echo -e "hello\nworld"') logger.info(action, extra={'msg_type': 'ACTION'}) @@ -551,7 +551,7 @@ async def test_no_ps2_in_output(temp_dir, box_class, run_as_devin): @pytest.mark.asyncio async def test_multiline_command_loop(temp_dir, box_class): - # https://github.com/OpenDevin/OpenDevin/issues/3143 + # https://github.com/All-Hands-AI/OpenHands/issues/3143 runtime = await _load_runtime(temp_dir, box_class) @@ -594,8 +594,8 @@ echo "success" @pytest.mark.asyncio -async def test_cmd_run(temp_dir, box_class, run_as_devin): - runtime = await _load_runtime(temp_dir, box_class, run_as_devin) +async def test_cmd_run(temp_dir, box_class, run_as_openhands): + runtime = await _load_runtime(temp_dir, box_class, run_as_openhands) action = CmdRunAction(command='ls -l') logger.info(action, extra={'msg_type': 'ACTION'}) @@ -618,8 +618,8 @@ async def test_cmd_run(temp_dir, box_class, run_as_devin): logger.info(obs, extra={'msg_type': 'OBSERVATION'}) assert isinstance(obs, CmdOutputObservation) assert obs.exit_code == 0 - if run_as_devin: - assert 'opendevin' in obs.content + if run_as_openhands: + assert 'openhands' in obs.content else: assert 'root' in obs.content assert 'test' in obs.content @@ -654,8 +654,8 @@ async def test_cmd_run(temp_dir, box_class, run_as_devin): @pytest.mark.asyncio -async def test_run_as_user_correct_home_dir(temp_dir, box_class, run_as_devin): - runtime = await _load_runtime(temp_dir, box_class, run_as_devin) +async def test_run_as_user_correct_home_dir(temp_dir, box_class, run_as_openhands): + runtime = await _load_runtime(temp_dir, box_class, run_as_openhands) action = CmdRunAction(command='cd ~ && pwd') logger.info(action, extra={'msg_type': 'ACTION'}) @@ -663,8 +663,8 @@ async def test_run_as_user_correct_home_dir(temp_dir, box_class, run_as_devin): logger.info(obs, extra={'msg_type': 'OBSERVATION'}) assert isinstance(obs, CmdOutputObservation) assert obs.exit_code == 0 - if run_as_devin: - assert '/home/opendevin' in obs.content + if run_as_openhands: + assert '/home/openhands' in obs.content else: assert '/root' in obs.content @@ -735,8 +735,8 @@ async def test_failed_cmd(temp_dir, box_class): @pytest.mark.asyncio -async def test_ipython_multi_user(temp_dir, box_class, run_as_devin): - runtime = await _load_runtime(temp_dir, box_class, run_as_devin) +async def test_ipython_multi_user(temp_dir, box_class, run_as_openhands): + runtime = await _load_runtime(temp_dir, box_class, run_as_openhands) # Test run ipython # get username @@ -747,8 +747,8 @@ async def test_ipython_multi_user(temp_dir, box_class, run_as_devin): assert isinstance(obs, IPythonRunCellObservation) logger.info(obs, extra={'msg_type': 'OBSERVATION'}) - if run_as_devin: - assert 'opendevin' in obs.content + if run_as_openhands: + assert 'openhands' in obs.content else: assert 'root' in obs.content @@ -782,9 +782,9 @@ async def test_ipython_multi_user(temp_dir, box_class, run_as_devin): obs = await runtime.run_action(action) logger.info(obs, extra={'msg_type': 'OBSERVATION'}) assert obs.exit_code == 0 - if run_as_devin: - # -rw-r--r-- 1 opendevin root 13 Jul 28 03:53 test.txt - assert 'opendevin' in obs.content.split('\r\n')[0] + if run_as_openhands: + # -rw-r--r-- 1 openhands root 13 Jul 28 03:53 test.txt + assert 'openhands' in obs.content.split('\r\n')[0] assert 'root' in obs.content.split('\r\n')[0] else: # -rw-r--r-- 1 root root 13 Jul 28 03:53 test.txt @@ -938,12 +938,12 @@ DO NOT re-run the same failed edit command. Running it again will lead to the sa @pytest.mark.asyncio async def test_ipython_agentskills_fileop_pwd( - temp_dir, box_class, run_as_devin, enable_auto_lint + temp_dir, box_class, run_as_openhands, enable_auto_lint ): """Make sure that cd in bash also update the current working directory in ipython.""" runtime = await _load_runtime( - temp_dir, box_class, run_as_devin, enable_auto_lint=enable_auto_lint + temp_dir, box_class, run_as_openhands, enable_auto_lint=enable_auto_lint ) await _test_ipython_agentskills_fileop_pwd_impl(runtime, enable_auto_lint) @@ -962,7 +962,7 @@ async def test_ipython_agentskills_fileop_pwd_with_userdir(temp_dir, box_class): runtime = await _load_runtime( temp_dir, box_class, - run_as_devin=False, + run_as_openhands=False, ) action = CmdRunAction(command='cd ~') @@ -1020,9 +1020,9 @@ async def test_ipython_agentskills_fileop_pwd_with_userdir(temp_dir, box_class): @pytest.mark.asyncio -async def test_ipython_package_install(temp_dir, box_class, run_as_devin): +async def test_ipython_package_install(temp_dir, box_class, run_as_openhands): """Make sure that cd in bash also update the current working directory in ipython.""" - runtime = await _load_runtime(temp_dir, box_class, run_as_devin) + runtime = await _load_runtime(temp_dir, box_class, run_as_openhands) # It should error out since pymsgbox is not installed action = IPythonRunCellAction(code='import pymsgbox') @@ -1226,7 +1226,7 @@ async def test_copy_non_existent_file(temp_dir, box_class): async def test_keep_prompt(temp_dir): # only EventStreamRuntime supports keep_prompt runtime = await _load_runtime( - temp_dir, box_class=EventStreamRuntime, run_as_devin=False + temp_dir, box_class=EventStreamRuntime, run_as_openhands=False ) action = CmdRunAction(command='touch /workspace/test_file.txt') @@ -1258,7 +1258,7 @@ async def test_git_operation(box_class): temp_dir=None, box_class=box_class, # Need to use non-root user to expose issues - run_as_devin=True, + run_as_openhands=True, ) # this will happen if permission of runtime is not properly configured @@ -1271,17 +1271,17 @@ async def test_git_operation(box_class): logger.info(obs, extra={'msg_type': 'OBSERVATION'}) assert isinstance(obs, CmdOutputObservation) assert obs.exit_code == 0 - # drwx--S--- 2 opendevin root 64 Aug 7 23:32 . + # drwx--S--- 2 openhands root 64 Aug 7 23:32 . # drwxr-xr-x 1 root root 4.0K Aug 7 23:33 .. for line in obs.content.split('\r\n'): if ' ..' in line: # parent directory should be owned by root assert 'root' in line - assert 'opendevin' not in line + assert 'openhands' not in line elif ' .' in line: - # current directory should be owned by opendevin + # current directory should be owned by openhands # and its group should be root - assert 'opendevin' in line + assert 'openhands' in line assert 'root' in line # make sure all git operations are allowed diff --git a/tests/unit/test_runtime_build.py b/tests/unit/test_runtime_build.py index 911cd8dcf7..5ef0489925 100644 --- a/tests/unit/test_runtime_build.py +++ b/tests/unit/test_runtime_build.py @@ -7,7 +7,7 @@ import pytest import toml from pytest import TempPathFactory -from opendevin.runtime.utils.runtime_build import ( +from openhands.runtime.utils.runtime_build import ( RUNTIME_IMAGE_REPO, _generate_dockerfile, _get_package_version, @@ -34,24 +34,24 @@ def _check_source_code_in_dir(temp_dir): # check the source file is the same as the current code base assert os.path.exists(os.path.join(code_dir, 'pyproject.toml')) - # The source code should only include the `opendevin` folder, but not the other folders + # The source code should only include the `openhands` folder, but not the other folders assert set(os.listdir(code_dir)) == { - 'opendevin', + 'openhands', 'pyproject.toml', 'poetry.lock', 'LICENSE', 'README.md', 'PKG-INFO', } - assert os.path.exists(os.path.join(code_dir, 'opendevin')) - assert os.path.isdir(os.path.join(code_dir, 'opendevin')) + assert os.path.exists(os.path.join(code_dir, 'openhands')) + assert os.path.isdir(os.path.join(code_dir, 'openhands')) # make sure the version from the pyproject.toml is the same as the current version with open(os.path.join(code_dir, 'pyproject.toml'), 'r') as f: pyproject = toml.load(f) _pyproject_version = pyproject['tool']['poetry']['version'] - assert _pyproject_version == version('opendevin') + assert _pyproject_version == version('openhands') def test_put_source_code_to_dir(temp_dir): @@ -136,14 +136,14 @@ def test_generate_dockerfile_scratch(): assert 'apt-get update' in dockerfile_content assert 'apt-get install -y wget sudo apt-utils' in dockerfile_content assert ( - 'RUN /opendevin/miniforge3/bin/mamba install conda-forge::poetry python=3.11 -y' + 'RUN /openhands/miniforge3/bin/mamba install conda-forge::poetry python=3.11 -y' in dockerfile_content ) # Check the update command - assert 'COPY ./code /opendevin/code' in dockerfile_content + assert 'COPY ./code /openhands/code' in dockerfile_content assert ( - '/opendevin/miniforge3/bin/mamba run -n base poetry install' + '/openhands/miniforge3/bin/mamba run -n base poetry install' in dockerfile_content ) @@ -158,14 +158,14 @@ def test_generate_dockerfile_skip_init(): # These commands SHOULD NOT include in the dockerfile if skip_init is True assert 'RUN apt update && apt install -y wget sudo' not in dockerfile_content assert ( - 'RUN /opendevin/miniforge3/bin/mamba install conda-forge::poetry python=3.11 -y' + 'RUN /openhands/miniforge3/bin/mamba install conda-forge::poetry python=3.11 -y' not in dockerfile_content ) # These update commands SHOULD still in the dockerfile - assert 'COPY ./code /opendevin/code' in dockerfile_content + assert 'COPY ./code /openhands/code' in dockerfile_content assert ( - '/opendevin/miniforge3/bin/mamba run -n base poetry install' + '/openhands/miniforge3/bin/mamba run -n base poetry install' in dockerfile_content ) @@ -240,7 +240,7 @@ def test_build_runtime_image_exact_hash_exist(temp_dir): mock_runtime_builder.build.assert_not_called() -@patch('opendevin.runtime.utils.runtime_build._build_sandbox_image') +@patch('openhands.runtime.utils.runtime_build._build_sandbox_image') def test_build_runtime_image_exact_hash_not_exist(mock_build_sandbox_image, temp_dir): base_image = 'debian:11' repo, latest_image_tag = get_runtime_image_repo_and_tag(base_image) @@ -263,7 +263,7 @@ def test_build_runtime_image_exact_hash_not_exist(mock_build_sandbox_image, temp mock_runtime_builder.image_exists.side_effect = [False, True] with patch( - 'opendevin.runtime.utils.runtime_build.prep_docker_build_folder' + 'openhands.runtime.utils.runtime_build.prep_docker_build_folder' ) as mock_prep_docker_build_folder: mock_prep_docker_build_folder.side_effect = [ from_scratch_hash, diff --git a/tests/unit/test_security.py b/tests/unit/test_security.py index 5f141a7bda..1bab24ca03 100644 --- a/tests/unit/test_security.py +++ b/tests/unit/test_security.py @@ -4,9 +4,9 @@ import tempfile import pytest -from opendevin.core.schema.action import ActionType -from opendevin.core.schema.agent import AgentState -from opendevin.events.action import ( +from openhands.core.schema.action import ActionType +from openhands.core.schema.agent import AgentState +from openhands.events.action import ( AgentDelegateAction, AgentFinishAction, BrowseInteractiveAction, @@ -17,9 +17,9 @@ from opendevin.events.action import ( MessageAction, NullAction, ) -from opendevin.events.action.action import ActionConfirmationStatus, ActionSecurityRisk -from opendevin.events.event import Event -from opendevin.events.observation import ( +from openhands.events.action.action import ActionConfirmationStatus, ActionSecurityRisk +from openhands.events.event import Event +from openhands.events.observation import ( AgentDelegateObservation, AgentStateChangedObservation, BrowserOutputObservation, @@ -27,11 +27,11 @@ from opendevin.events.observation import ( IPythonRunCellObservation, NullObservation, ) -from opendevin.events.stream import EventSource, EventStream -from opendevin.security.invariant import InvariantAnalyzer -from opendevin.security.invariant.nodes import Function, Message, ToolCall, ToolOutput -from opendevin.security.invariant.parser import parse_action, parse_observation -from opendevin.storage import get_file_store +from openhands.events.stream import EventSource, EventStream +from openhands.security.invariant import InvariantAnalyzer +from openhands.security.invariant.nodes import Function, Message, ToolCall, ToolOutput +from openhands.security.invariant.parser import parse_action, parse_observation +from openhands.storage import get_file_store @pytest.fixture diff --git a/tests/unit/test_storage.py b/tests/unit/test_storage.py index dc173ff8fe..e11d3f0b95 100644 --- a/tests/unit/test_storage.py +++ b/tests/unit/test_storage.py @@ -3,8 +3,8 @@ import shutil import pytest -from opendevin.storage.local import LocalFileStore -from opendevin.storage.memory import InMemoryFileStore +from openhands.storage.local import LocalFileStore +from openhands.storage.memory import InMemoryFileStore @pytest.fixture