diff --git a/.github/ISSUE_TEMPLATE/bug_template.yml b/.github/ISSUE_TEMPLATE/bug_template.yml index 7a6a0ba244f6..a5011583a658 100644 --- a/.github/ISSUE_TEMPLATE/bug_template.yml +++ b/.github/ISSUE_TEMPLATE/bug_template.yml @@ -30,6 +30,7 @@ body: description: How are you running OpenHands? options: - Docker command in README + - GitHub resolver - Development workflow - app.all-hands.dev - Other diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b4ce891d672f..7f5d59b91d4b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -70,3 +70,8 @@ updates: applies-to: "version-updates" patterns: - "*" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/scripts/check_version_consistency.py b/.github/scripts/check_version_consistency.py new file mode 100755 index 000000000000..daf78a8d2c1a --- /dev/null +++ b/.github/scripts/check_version_consistency.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python3 +import os +import re +import sys +from typing import Set, Tuple + + +def find_version_references(directory: str) -> Tuple[Set[str], Set[str]]: + openhands_versions = set() + runtime_versions = set() + + version_pattern_openhands = re.compile(r'openhands:(\d{1})\.(\d{2})') + version_pattern_runtime = re.compile(r'runtime:(\d{1})\.(\d{2})') + + for root, _, files in os.walk(directory): + # Skip .git directory + if '.git' in root: + continue + + for file in files: + if file.endswith( + ('.md', '.yml', '.yaml', '.txt', '.html', '.py', '.js', '.ts') + ): + file_path = os.path.join(root, file) + try: + with open(file_path, 'r', encoding='utf-8') as f: + content = f.read() + + # Find all openhands version references + matches = version_pattern_openhands.findall(content) + openhands_versions.update(matches) + + # Find all runtime version references + matches = version_pattern_runtime.findall(content) + runtime_versions.update(matches) + except Exception as e: + print(f'Error reading {file_path}: {e}', file=sys.stderr) + + return openhands_versions, runtime_versions + + +def main(): + repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) + openhands_versions, runtime_versions = find_version_references(repo_root) + + exit_code = 0 + + if len(openhands_versions) > 1: + print('Error: Multiple openhands versions found:', file=sys.stderr) + print('Found versions:', sorted(openhands_versions), file=sys.stderr) + exit_code = 1 + elif len(openhands_versions) == 0: + print('Warning: No openhands version references found', file=sys.stderr) + + if len(runtime_versions) > 1: + print('Error: Multiple runtime versions found:', file=sys.stderr) + print('Found versions:', sorted(runtime_versions), file=sys.stderr) + exit_code = 1 + elif len(runtime_versions) == 0: + print('Warning: No runtime version references found', file=sys.stderr) + + sys.exit(exit_code) + + +if __name__ == '__main__': + main() diff --git a/.github/workflows/dummy-agent-test.yml b/.github/workflows/dummy-agent-test.yml index bac3fd8bb8da..6f98f10c95da 100644 --- a/.github/workflows/dummy-agent-test.yml +++ b/.github/workflows/dummy-agent-test.yml @@ -19,23 +19,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB - tool-cache: true - # all of these default to true, but feel free to set to - # "false" if necessary for your workflow - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: false - swap-storage: true - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3 + - name: Install tmux + run: sudo apt-get update && sudo apt-get install -y tmux + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22.x' - name: Install poetry via pipx run: pipx install poetry - name: Set up Python diff --git a/.github/workflows/eval-runner.yml b/.github/workflows/eval-runner.yml index b1ace09b35de..6efc51acbfa7 100644 --- a/.github/workflows/eval-runner.yml +++ b/.github/workflows/eval-runner.yml @@ -29,6 +29,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Install tmux + run: sudo apt-get update && sudo apt-get install -y tmux - name: Install poetry via pipx run: pipx install poetry @@ -129,7 +131,7 @@ jobs: - name: Post to a Slack channel id: slack - uses: slackapi/slack-github-action@v1.27.0 + uses: slackapi/slack-github-action@v2.0.0 with: channel-id: 'C07SVQSCR6F' slack-message: "*Evaluation Trigger:* ${{ github.event_name == 'pull_request' && format('Pull Request (eval-this label on PR #{0})', github.event.pull_request.number) || github.event_name == 'schedule' && 'Daily Schedule' || format('Manual Trigger: {0}', github.event.inputs.reason) }}\n\nLink to summary: [here](https://github.com/${{ github.repository }}/issues/${{ github.event_name == 'pull_request' && github.event.pull_request.number || 4504 }}#issuecomment-${{ steps.create_comment.outputs.comment-id }})" diff --git a/.github/workflows/fe-unit-tests.yml b/.github/workflows/fe-unit-tests.yml index dd577b4b43c5..0b19a5e837f6 100644 --- a/.github/workflows/fe-unit-tests.yml +++ b/.github/workflows/fe-unit-tests.yml @@ -43,6 +43,6 @@ jobs: working-directory: ./frontend run: npm run test:coverage - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/ghcr-build.yml b/.github/workflows/ghcr-build.yml index 7948291d6ec3..53439e0e7ea7 100644 --- a/.github/workflows/ghcr-build.yml +++ b/.github/workflows/ghcr-build.yml @@ -41,22 +41,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB - tool-cache: true - # all of these default to true, but feel free to set to - # "false" if necessary for your workflow - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: false - swap-storage: true - name: Set up QEMU - uses: docker/setup-qemu-action@v3.0.0 + uses: docker/setup-qemu-action@v3.4.0 with: image: tonistiigi/binfmt:latest - name: Login to GHCR @@ -104,22 +90,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB - tool-cache: true - # all of these default to true, but feel free to set to - # "false" if necessary for your workflow - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: false - swap-storage: true - name: Set up QEMU - uses: docker/setup-qemu-action@v3.0.0 + uses: docker/setup-qemu-action@v3.4.0 with: image: tonistiigi/binfmt:latest - name: Login to GHCR @@ -219,7 +191,7 @@ jobs: exit 1 fi - # Run unit tests with the EventStream runtime Docker images as root + # Run unit tests with the Docker runtime Docker images as root test_runtime_root: name: RT Unit Tests (Root) needs: [ghcr_build_runtime] @@ -230,20 +202,6 @@ jobs: base_image: ['nikolaik'] steps: - uses: actions/checkout@v4 - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB - tool-cache: true - # all of these default to true, but feel free to set to - # "false" if necessary for your workflow - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: false - swap-storage: true - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3 @@ -275,7 +233,7 @@ jobs: run: pipx install poetry - name: Install Python dependencies using Poetry run: make install-python-dependencies - - name: Run runtime tests + - name: Run docker runtime tests run: | # We install pytest-xdist in order to run tests across CPUs poetry run pip install pytest-xdist @@ -286,18 +244,18 @@ jobs: image_name=ghcr.io/${{ github.repository_owner }}/runtime:${{ env.RELEVANT_SHA }}-${{ matrix.base_image }} image_name=$(echo $image_name | tr '[:upper:]' '[:lower:]') - TEST_RUNTIME=eventstream \ + TEST_RUNTIME=docker \ SANDBOX_USER_ID=$(id -u) \ SANDBOX_RUNTIME_CONTAINER_IMAGE=$image_name \ TEST_IN_CI=true \ RUN_AS_OPENHANDS=false \ poetry run pytest -n 3 -raRs --reruns 2 --reruns-delay 5 --cov=openhands --cov-report=xml -s ./tests/runtime --ignore=tests/runtime/test_browsergym_envs.py - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - # Run unit tests with the EventStream runtime Docker images as openhands user + # Run unit tests with the Docker runtime Docker images as openhands user test_runtime_oh: name: RT Unit Tests (openhands) runs-on: ubuntu-latest @@ -307,20 +265,6 @@ jobs: base_image: ['nikolaik'] steps: - uses: actions/checkout@v4 - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB - tool-cache: true - # all of these default to true, but feel free to set to - # "false" if necessary for your workflow - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: false - swap-storage: true - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3 @@ -363,14 +307,14 @@ jobs: image_name=ghcr.io/${{ github.repository_owner }}/runtime:${{ env.RELEVANT_SHA }}-${{ matrix.base_image }} image_name=$(echo $image_name | tr '[:upper:]' '[:lower:]') - TEST_RUNTIME=eventstream \ + TEST_RUNTIME=docker \ SANDBOX_USER_ID=$(id -u) \ SANDBOX_RUNTIME_CONTAINER_IMAGE=$image_name \ TEST_IN_CI=true \ RUN_AS_OPENHANDS=true \ poetry run pytest -n 3 -raRs --reruns 2 --reruns-delay 5 --cov=openhands --cov-report=xml -s ./tests/runtime --ignore=tests/runtime/test_browsergym_envs.py - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/integration-runner.yml b/.github/workflows/integration-runner.yml index 120572aa0cdd..00d7c45957ef 100644 --- a/.github/workflows/integration-runner.yml +++ b/.github/workflows/integration-runner.yml @@ -56,6 +56,7 @@ jobs: LLM_MODEL: "litellm_proxy/claude-3-5-haiku-20241022" LLM_API_KEY: ${{ secrets.LLM_API_KEY }} LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }} + MAX_ITERATIONS: 10 run: | echo "[llm.eval]" > config.toml echo "model = \"$LLM_MODEL\"" >> config.toml @@ -70,7 +71,7 @@ jobs: env: SANDBOX_FORCE_REBUILD_RUNTIME: True run: | - poetry run ./evaluation/integration_tests/scripts/run_infer.sh llm.eval HEAD CodeActAgent '' $N_PROCESSES '' 'haiku_run' + poetry run ./evaluation/integration_tests/scripts/run_infer.sh llm.eval HEAD CodeActAgent '' 10 $N_PROCESSES '' 'haiku_run' # get integration tests report REPORT_FILE_HAIKU=$(find evaluation/evaluation_outputs/outputs/integration_tests/CodeActAgent/*haiku*_maxiter_10_N* -name "report.md" -type f | head -n 1) @@ -88,6 +89,7 @@ jobs: LLM_MODEL: "litellm_proxy/deepseek-chat" LLM_API_KEY: ${{ secrets.LLM_API_KEY }} LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }} + MAX_ITERATIONS: 10 run: | echo "[llm.eval]" > config.toml echo "model = \"$LLM_MODEL\"" >> config.toml @@ -99,7 +101,7 @@ jobs: env: SANDBOX_FORCE_REBUILD_RUNTIME: True run: | - poetry run ./evaluation/integration_tests/scripts/run_infer.sh llm.eval HEAD CodeActAgent '' $N_PROCESSES '' 'deepseek_run' + poetry run ./evaluation/integration_tests/scripts/run_infer.sh llm.eval HEAD CodeActAgent '' 10 $N_PROCESSES '' 'deepseek_run' # get integration tests report REPORT_FILE_DEEPSEEK=$(find evaluation/evaluation_outputs/outputs/integration_tests/CodeActAgent/deepseek*_maxiter_10_N* -name "report.md" -type f | head -n 1) @@ -109,11 +111,104 @@ jobs: echo >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV + # ------------------------------------------------------------- + # Run DelegatorAgent tests for Haiku, limited to t01 and t02 + - name: Wait a little bit (again) + run: sleep 5 + + - name: Configure config.toml for testing DelegatorAgent (Haiku) + env: + LLM_MODEL: "litellm_proxy/claude-3-5-haiku-20241022" + LLM_API_KEY: ${{ secrets.LLM_API_KEY }} + LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }} + MAX_ITERATIONS: 30 + run: | + echo "[llm.eval]" > config.toml + echo "model = \"$LLM_MODEL\"" >> config.toml + echo "api_key = \"$LLM_API_KEY\"" >> config.toml + echo "base_url = \"$LLM_BASE_URL\"" >> config.toml + echo "temperature = 0.0" >> config.toml + + - name: Run integration test evaluation for DelegatorAgent (Haiku) + env: + SANDBOX_FORCE_REBUILD_RUNTIME: True + run: | + poetry run ./evaluation/integration_tests/scripts/run_infer.sh llm.eval HEAD DelegatorAgent '' 30 $N_PROCESSES "t01_fix_simple_typo,t02_add_bash_hello" 'delegator_haiku_run' + + # Find and export the delegator test results + REPORT_FILE_DELEGATOR_HAIKU=$(find evaluation/evaluation_outputs/outputs/integration_tests/DelegatorAgent/*haiku*_maxiter_30_N* -name "report.md" -type f | head -n 1) + echo "REPORT_FILE_DELEGATOR_HAIKU: $REPORT_FILE_DELEGATOR_HAIKU" + echo "INTEGRATION_TEST_REPORT_DELEGATOR_HAIKU<> $GITHUB_ENV + cat $REPORT_FILE_DELEGATOR_HAIKU >> $GITHUB_ENV + echo >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + # ------------------------------------------------------------- + # Run DelegatorAgent tests for DeepSeek, limited to t01 and t02 + - name: Wait a little bit (again) + run: sleep 5 + + - name: Configure config.toml for testing DelegatorAgent (DeepSeek) + env: + LLM_MODEL: "litellm_proxy/deepseek-chat" + LLM_API_KEY: ${{ secrets.LLM_API_KEY }} + LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }} + MAX_ITERATIONS: 30 + run: | + echo "[llm.eval]" > config.toml + echo "model = \"$LLM_MODEL\"" >> config.toml + echo "api_key = \"$LLM_API_KEY\"" >> config.toml + echo "base_url = \"$LLM_BASE_URL\"" >> config.toml + echo "temperature = 0.0" >> config.toml + - name: Run integration test evaluation for DelegatorAgent (DeepSeek) + env: + SANDBOX_FORCE_REBUILD_RUNTIME: True + run: | + poetry run ./evaluation/integration_tests/scripts/run_infer.sh llm.eval HEAD DelegatorAgent '' 30 $N_PROCESSES "t01_fix_simple_typo,t02_add_bash_hello" 'delegator_deepseek_run' + + # Find and export the delegator test results + REPORT_FILE_DELEGATOR_DEEPSEEK=$(find evaluation/evaluation_outputs/outputs/integration_tests/DelegatorAgent/deepseek*_maxiter_30_N* -name "report.md" -type f | head -n 1) + echo "REPORT_FILE_DELEGATOR_DEEPSEEK: $REPORT_FILE_DELEGATOR_DEEPSEEK" + echo "INTEGRATION_TEST_REPORT_DELEGATOR_DEEPSEEK<> $GITHUB_ENV + cat $REPORT_FILE_DELEGATOR_DEEPSEEK >> $GITHUB_ENV + echo >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + # ------------------------------------------------------------- + # Run VisualBrowsingAgent tests for DeepSeek, limited to t05 and t06 + - name: Wait a little bit (again) + run: sleep 5 + + - name: Configure config.toml for testing VisualBrowsingAgent (DeepSeek) + env: + LLM_MODEL: "litellm_proxy/deepseek-chat" + LLM_API_KEY: ${{ secrets.LLM_API_KEY }} + LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }} + MAX_ITERATIONS: 15 + run: | + echo "[llm.eval]" > config.toml + echo "model = \"$LLM_MODEL\"" >> config.toml + echo "api_key = \"$LLM_API_KEY\"" >> config.toml + echo "base_url = \"$LLM_BASE_URL\"" >> config.toml + echo "temperature = 0.0" >> config.toml + - name: Run integration test evaluation for VisualBrowsingAgent (DeepSeek) + env: + SANDBOX_FORCE_REBUILD_RUNTIME: True + run: | + poetry run ./evaluation/integration_tests/scripts/run_infer.sh llm.eval HEAD VisualBrowsingAgent '' 15 $N_PROCESSES "t05_simple_browsing,t06_github_pr_browsing.py" 'visualbrowsing_deepseek_run' + + # Find and export the visual browsing agent test results + REPORT_FILE_VISUALBROWSING_DEEPSEEK=$(find evaluation/evaluation_outputs/outputs/integration_tests/VisualBrowsingAgent/deepseek*_maxiter_15_N* -name "report.md" -type f | head -n 1) + echo "REPORT_FILE_VISUALBROWSING_DEEPSEEK: $REPORT_FILE_VISUALBROWSING_DEEPSEEK" + echo "INTEGRATION_TEST_REPORT_VISUALBROWSING_DEEPSEEK<> $GITHUB_ENV + cat $REPORT_FILE_VISUALBROWSING_DEEPSEEK >> $GITHUB_ENV + echo >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + - name: Create archive of evaluation outputs run: | TIMESTAMP=$(date +'%y-%m-%d-%H-%M') cd evaluation/evaluation_outputs/outputs # Change to the outputs directory - tar -czvf ../../../integration_tests_${TIMESTAMP}.tar.gz integration_tests/CodeActAgent/* # Only include the actual result directories + tar -czvf ../../../integration_tests_${TIMESTAMP}.tar.gz integration_tests/CodeActAgent/* integration_tests/DelegatorAgent/* integration_tests/VisualBrowsingAgent/* # Only include the actual result directories - name: Upload evaluation results as artifact uses: actions/upload-artifact@v4 @@ -154,5 +249,14 @@ jobs: **Integration Tests Report (DeepSeek)** DeepSeek LLM Test Results: ${{ env.INTEGRATION_TEST_REPORT_DEEPSEEK }} + --- + **Integration Tests Report Delegator (Haiku)** + ${{ env.INTEGRATION_TEST_REPORT_DELEGATOR_HAIKU }} + --- + **Integration Tests Report Delegator (DeepSeek)** + ${{ env.INTEGRATION_TEST_REPORT_DELEGATOR_DEEPSEEK }} + --- + **Integration Tests Report VisualBrowsing (DeepSeek)** + ${{ env.INTEGRATION_TEST_REPORT_VISUALBROWSING_DEEPSEEK }} --- Download testing outputs (includes both Haiku and DeepSeek results): [Download](${{ steps.upload_results_artifact.outputs.artifact-url }}) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1bfc8c91c6a4..789a938e1d7e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -53,3 +53,16 @@ jobs: run: pip install pre-commit==3.7.0 - name: Run pre-commit hooks run: pre-commit run --files openhands/**/* evaluation/**/* tests/**/* --show-diff-on-failure --config ./dev_config/python/.pre-commit-config.yaml + + # Check version consistency across documentation + check-version-consistency: + name: Check version consistency + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Run version consistency check + run: .github/scripts/check_version_consistency.py diff --git a/.github/workflows/openhands-resolver.yml b/.github/workflows/openhands-resolver.yml index cb613d65c52a..9820458ec31e 100644 --- a/.github/workflows/openhands-resolver.yml +++ b/.github/workflows/openhands-resolver.yml @@ -20,6 +20,10 @@ on: required: false type: string default: "anthropic/claude-3-5-sonnet-20241022" + LLM_API_VERSION: + required: false + type: string + default: "" base_container_image: required: false type: string @@ -84,8 +88,10 @@ jobs: run: | python -m pip index versions openhands-ai > openhands_versions.txt OPENHANDS_VERSION=$(head -n 1 openhands_versions.txt | awk '{print $2}' | tr -d '()') - echo "openhands-ai==${OPENHANDS_VERSION}" >> requirements.txt - cat requirements.txt + + # Create a new requirements.txt locally within the workflow, ensuring no reference to the repo's file + echo "openhands-ai==${OPENHANDS_VERSION}" > /tmp/requirements.txt + cat /tmp/requirements.txt - name: Cache pip dependencies if: | @@ -100,18 +106,19 @@ jobs: contains(github.event.review.body, '@openhands-agent-exp') ) ) - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.pythonLocation }}/lib/python3.12/site-packages/* - key: ${{ runner.os }}-pip-openhands-resolver-${{ hashFiles('requirements.txt') }} + key: ${{ runner.os }}-pip-openhands-resolver-${{ hashFiles('/tmp/requirements.txt') }} restore-keys: | - ${{ runner.os }}-pip-openhands-resolver-${{ hashFiles('requirements.txt') }} + ${{ runner.os }}-pip-openhands-resolver-${{ hashFiles('/tmp/requirements.txt') }} - name: Check required environment variables env: LLM_MODEL: ${{ secrets.LLM_MODEL || inputs.LLM_MODEL }} LLM_API_KEY: ${{ secrets.LLM_API_KEY }} LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }} + LLM_API_VERSION: ${{ inputs.LLM_API_VERSION }} PAT_TOKEN: ${{ secrets.PAT_TOKEN }} PAT_USERNAME: ${{ secrets.PAT_USERNAME }} GITHUB_TOKEN: ${{ github.token }} @@ -168,7 +175,7 @@ jobs: echo "SANDBOX_ENV_BASE_CONTAINER_IMAGE=${{ inputs.base_container_image }}" >> $GITHUB_ENV # Set branch variables - echo "TARGET_BRANCH=${{ inputs.target_branch }}" >> $GITHUB_ENV + echo "TARGET_BRANCH=${{ inputs.target_branch || 'main' }}" >> $GITHUB_ENV - name: Comment on issue with start message uses: actions/github-script@v7 @@ -184,14 +191,19 @@ jobs: }); - name: Install OpenHands + id: install_openhands uses: actions/github-script@v7 + env: + COMMENT_BODY: ${{ github.event.comment.body || '' }} + REVIEW_BODY: ${{ github.event.review.body || '' }} + LABEL_NAME: ${{ github.event.label.name || '' }} + EVENT_NAME: ${{ github.event_name }} with: script: | - const commentBody = `${{ github.event.comment.body || '' }}`.trim(); - const reviewBody = `${{ github.event.review.body || '' }}`.trim(); - const labelName = `${{ github.event.label.name || '' }}`.trim(); - const eventName = `${{ github.event_name }}`.trim(); - + const commentBody = process.env.COMMENT_BODY.trim(); + const reviewBody = process.env.REVIEW_BODY.trim(); + const labelName = process.env.LABEL_NAME.trim(); + const eventName = process.env.EVENT_NAME.trim(); // Check conditions const isExperimentalLabel = labelName === "fix-me-experimental"; const isIssueCommentExperimental = @@ -200,6 +212,9 @@ jobs: const isReviewCommentExperimental = eventName === "pull_request_review" && reviewBody.includes("@openhands-agent-exp"); + // Set output variable + core.setOutput('isExperimental', isExperimentalLabel || isIssueCommentExperimental || isReviewCommentExperimental); + // Perform package installation if (isExperimentalLabel || isIssueCommentExperimental || isReviewCommentExperimental) { console.log("Installing experimental OpenHands..."); @@ -208,16 +223,18 @@ jobs: } else { console.log("Installing from requirements.txt..."); await exec.exec("python -m pip install --upgrade pip"); - await exec.exec("pip install -r requirements.txt"); + await exec.exec("pip install -r /tmp/requirements.txt"); } - name: Attempt to resolve issue env: GITHUB_TOKEN: ${{ secrets.PAT_TOKEN || github.token }} GITHUB_USERNAME: ${{ secrets.PAT_USERNAME || 'openhands-agent' }} + GIT_USERNAME: ${{ secrets.PAT_USERNAME || 'openhands-agent' }} LLM_MODEL: ${{ secrets.LLM_MODEL || inputs.LLM_MODEL }} LLM_API_KEY: ${{ secrets.LLM_API_KEY }} LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }} + LLM_API_VERSION: ${{ inputs.LLM_API_VERSION }} PYTHONPATH: "" run: | cd /tmp && python -m openhands.resolver.resolve_issue \ @@ -225,7 +242,8 @@ jobs: --issue-number ${{ env.ISSUE_NUMBER }} \ --issue-type ${{ env.ISSUE_TYPE }} \ --max-iterations ${{ env.MAX_ITERATIONS }} \ - --comment-id ${{ env.COMMENT_ID }} + --comment-id ${{ env.COMMENT_ID }} \ + --is-experimental ${{ steps.install_openhands.outputs.isExperimental }} - name: Check resolution result id: check_result @@ -249,14 +267,17 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.PAT_TOKEN || github.token }} GITHUB_USERNAME: ${{ secrets.PAT_USERNAME || 'openhands-agent' }} + GIT_USERNAME: ${{ secrets.PAT_USERNAME || 'openhands-agent' }} LLM_MODEL: ${{ secrets.LLM_MODEL || inputs.LLM_MODEL }} LLM_API_KEY: ${{ secrets.LLM_API_KEY }} LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }} + LLM_API_VERSION: ${{ inputs.LLM_API_VERSION }} PYTHONPATH: "" run: | if [ "${{ steps.check_result.outputs.RESOLUTION_SUCCESS }}" == "true" ]; then cd /tmp && python -m openhands.resolver.send_pull_request \ --issue-number ${{ env.ISSUE_NUMBER }} \ + --target-branch ${{ env.TARGET_BRANCH }} \ --pr-type draft \ --reviewer ${{ github.actor }} | tee pr_result.txt && \ grep "draft created" pr_result.txt | sed 's/.*\///g' > pr_number.txt diff --git a/.github/workflows/py-unit-tests-mac.yml b/.github/workflows/py-unit-tests-mac.yml deleted file mode 100644 index d750eb172114..000000000000 --- a/.github/workflows/py-unit-tests-mac.yml +++ /dev/null @@ -1,96 +0,0 @@ -# Workflow that runs python unit tests on mac -name: Run Python Unit Tests Mac - -# This job is flaky so only run it nightly -on: - schedule: - - cron: '0 0 * * *' - -jobs: - # Run python unit tests on macOS - test-on-macos: - name: Python Unit Tests on macOS - runs-on: macos-14 - env: - INSTALL_DOCKER: '1' # Set to '0' to skip Docker installation - strategy: - matrix: - python-version: ['3.12'] - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Cache Poetry dependencies - uses: actions/cache@v4 - with: - path: | - ~/.cache/pypoetry - ~/.virtualenvs - key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} - restore-keys: | - ${{ runner.os }}-poetry- - - name: Install poetry via pipx - run: pipx install poetry - - name: Install Python dependencies using Poetry - run: poetry install --without evaluation,llama-index - - name: Install & Start Docker - if: env.INSTALL_DOCKER == '1' - run: | - INSTANCE_NAME="colima-${GITHUB_RUN_ID}" - - # Uninstall colima to upgrade to the latest version - if brew list colima &>/dev/null; then - brew uninstall colima - # unlinking colima dependency: go - brew uninstall go@1.21 - fi - rm -rf ~/.colima ~/.lima - brew install --HEAD colima - brew install docker - - start_colima() { - # Find a free port in the range 10000-20000 - RANDOM_PORT=$((RANDOM % 10001 + 10000)) - - # Original line: - if ! colima start --network-address --arch x86_64 --cpu=1 --memory=1 --verbose --ssh-port $RANDOM_PORT; then - echo "Failed to start Colima." - return 1 - fi - return 0 - } - - # Attempt to start Colima for 5 total attempts: - ATTEMPT_LIMIT=5 - for ((i=1; i<=ATTEMPT_LIMIT; i++)); do - - if start_colima; then - echo "Colima started successfully." - break - else - colima stop -f - sleep 10 - colima delete -f - if [ $i -eq $ATTEMPT_LIMIT ]; then - exit 1 - fi - sleep 10 - fi - done - - # For testcontainers to find the Colima socket - # https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running - sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock - - name: Build Environment - run: make build - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - name: Run Tests - run: poetry run pytest --forked --cov=openhands --cov-report=xml ./tests/unit --ignore=tests/unit/test_memory.py - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/py-unit-tests.yml b/.github/workflows/py-unit-tests.yml index 28a14095d7c1..a7dcfb84acd9 100644 --- a/.github/workflows/py-unit-tests.yml +++ b/.github/workflows/py-unit-tests.yml @@ -30,6 +30,12 @@ jobs: - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3 + - name: Install tmux + run: sudo apt-get update && sudo apt-get install -y tmux + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22.x' - name: Install poetry via pipx run: pipx install poetry - name: Set up Python @@ -42,8 +48,8 @@ jobs: - name: Build Environment run: make build - name: Run Tests - run: poetry run pytest --forked -n auto --cov=openhands --cov-report=xml -svv ./tests/unit --ignore=tests/unit/test_memory.py + run: poetry run pytest --forked -n auto --cov=openhands --cov-report=xml -svv ./tests/unit --ignore=tests/unit/test_long_term_memory.py - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml new file mode 100644 index 000000000000..f3586044ab80 --- /dev/null +++ b/.github/workflows/python-package-conda.yml @@ -0,0 +1,34 @@ +name: Python Package using Conda + +on: [push] + +jobs: + build-linux: + runs-on: ubuntu-latest + strategy: + max-parallel: 5 + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: '3.10' + - name: Add conda to system path + run: | + # $CONDA is an environment variable pointing to the root of the miniconda directory + echo $CONDA/bin >> $GITHUB_PATH + - name: Install dependencies + run: | + conda env update --file environment.yml --name base + - name: Lint with flake8 + run: | + conda install flake8 + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + conda install pytest + pytest diff --git a/.github/workflows/run-eval.yml b/.github/workflows/run-eval.yml index df79872aec26..460e9405d58e 100644 --- a/.github/workflows/run-eval.yml +++ b/.github/workflows/run-eval.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout PR branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 4cccbce15e27..0d9e879efd91 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -19,3 +19,4 @@ jobs: close-issue-message: 'This issue was closed because it has been stalled for over 30 days with no activity.' close-pr-message: 'This PR was closed because it has been stalled for over 30 days with no activity.' days-before-close: 7 + operations-per-run: 150 diff --git a/.openhands/microagents/glossary.md b/.openhands/microagents/glossary.md new file mode 100644 index 000000000000..718ce01ab350 --- /dev/null +++ b/.openhands/microagents/glossary.md @@ -0,0 +1,172 @@ +# OpenHands Glossary + +### Agent +The core AI entity in OpenHands that can perform software development tasks by interacting with tools, browsing the web, and modifying code. + +#### Agent Controller +A component that manages the agent's lifecycle, handles its state, and coordinates interactions between the agent and various tools. + +#### Agent Delegation +The ability of an agent to hand off specific tasks to other specialized agents for better task completion. + +#### Agent Hub +A central registry of different agent types and their capabilities, allowing for easy agent selection and instantiation. + +#### Agent Skill +A specific capability or function that an agent can perform, such as file manipulation, web browsing, or code editing. + +#### Agent State +The current context and status of an agent, including its memory, active tools, and ongoing tasks. + +#### CodeAct Agent +[A generalist agent in OpenHands](https://arxiv.org/abs/2407.16741) designed to perform tasks by editing and executing code. + +### Browser +A system for web-based interactions and tasks. + +#### Browser Gym +A testing and evaluation environment for browser-based agent interactions and tasks. + +#### Web Browser Tool +A tool that enables agents to interact with web pages and perform web-based tasks. + +### Commands +Terminal and execution related functionality. + +#### Bash Session +A persistent terminal session that maintains state and history for bash command execution. +This uses tmux under the hood. + +### Configuration +System-wide settings and options. + +#### Agent Configuration +Settings that define an agent's behavior, capabilities, and limitations, including available tools and runtime settings. + +#### Configuration Options +Settings that control various aspects of OpenHands behavior, including runtime, security, and agent settings. + +#### LLM Config +Configuration settings for language models used by agents, including model selection and parameters. + +#### LLM Draft Config +Settings for draft mode operations with language models, typically used for faster, lower-quality responses. + +#### Runtime Configuration +Settings that define how the runtime environment should be set up and operated. + +#### Security Options +Configuration settings that control security features and restrictions. + +### Conversation +A sequence of interactions between a user and an agent, including messages, actions, and their results. + +#### Conversation Info +Metadata about a conversation, including its status, participants, and timeline. + +#### Conversation Manager +A component that handles the creation, storage, and retrieval of conversations. + +#### Conversation Metadata +Additional information about conversations, such as tags, timestamps, and related resources. + +#### Conversation Status +The current state of a conversation, including whether it's active, completed, or failed. + +#### Conversation Store +A storage system for maintaining conversation history and related data. + +### Events + +#### Event +Every Conversation comprises a series of Events. Each Event is either an Action or an Observation. + +#### Event Stream +A continuous flow of events that represents the ongoing activities and interactions in the system. + +#### Action +A specific operation or command that an agent executes through available tools, such as running a command or editing a file. + +#### Observation +The response or result returned by a tool after an agent's action, providing feedback about the action's outcome. + +### Interface +Different ways to interact with OpenHands. + +#### CLI Mode +A command-line interface mode for interacting with OpenHands agents without a graphical interface. + +#### GUI Mode +A graphical user interface mode for interacting with OpenHands agents through a web interface. + +#### Headless Mode +A mode of operation where OpenHands runs without a user interface, suitable for automation and scripting. + +### Agent Memory +The system that decides which parts of the Event Stream (i.e. the conversation history) should be passed into each LLM prompt. + +#### Memory Store +A storage system for maintaining agent memory and context across sessions. + +#### Condenser +A component that processes and summarizes conversation history to maintain context while staying within token limits. + +#### Truncation +A very simple Condenser strategy. Reduces conversation history or content to stay within token limits. + +### Microagent +A specialized prompt that enhances OpenHands with domain-specific knowledge, repository-specific context, and task-specific workflows. + +#### Microagent Registry +A central repository of available microagents and their configurations. + +#### Public Microagent +A general-purpose microagent available to all OpenHands users, triggered by specific keywords. + +#### Repository Microagent +A type of microagent that provides repository-specific context and guidelines, stored in the `.openhands/microagents/` directory. + +### Prompt +Components for managing and processing prompts. + +#### Prompt Caching +A system for caching and reusing common prompts to improve performance. + +#### Prompt Manager +A component that handles the loading, processing, and management of prompts used by agents, including microagents. + +#### Response Parsing +The process of interpreting and structuring responses from language models and tools. + +### Runtime +The execution environment where agents perform their tasks, which can be local, remote, or containerized. + +#### Action Execution Server +A REST API that receives agent actions (e.g. bash commands, python code, browsing actions), executes them in the runtime environment, and returns the results. + +#### Action Execution Client +A component that handles the execution of actions in the runtime environment, managing the communication between the agent and the runtime. + +#### Docker Runtime +A containerized runtime environment that provides isolation and reproducibility for agent operations. + +#### E2B Runtime +A specialized runtime environment built on E2B for secure and isolated code execution. + +#### Local Runtime +A runtime environment that executes on the local machine, suitable for development and testing. + +#### Modal Runtime +A runtime environment built on Modal for scalable and distributed agent operations. + +#### Remote Runtime +A sandboxed environment that executes code and commands remotely, providing isolation and security for agent operations. + +#### Runtime Builder +A component that builds a Docker image for the Action Execution Server based on a user-specified base image. + +### Security +Security-related components and features. + +#### Security Analyzer +A component that checks agent actions for potential security risks. diff --git a/.openhands/microagents/repo.md b/.openhands/microagents/repo.md new file mode 100644 index 000000000000..9b6c76d3dea4 --- /dev/null +++ b/.openhands/microagents/repo.md @@ -0,0 +1,42 @@ +--- +name: repo +type: repo +agent: CodeActAgent +--- +This repository contains the code for OpenHands, an automated AI software engineer. It has a Python backend +(in the `openhands` directory) and React frontend (in the `frontend` directory). + +## General Setup: +To set up the entire repo, including frontend and backend, run `make build`. +You don't need to do this unless the user asks you to, or if you're trying to run the entire application. + +Before pushing any changes, you should ensure that any lint errors or simple test errors have been fixed. + +* If you've made changes to the backend, you should run `pre-commit run --all-files --config ./dev_config/python/.pre-commit-config.yaml` +* If you've made changes to the frontend, you should run `cd frontend && npm run lint:fix && npm run build ; cd ..` + +If either command fails, it may have automatically fixed some issues. You should fix any issues that weren't automatically fixed, +then re-run the command to ensure it passes. + +## Repository Structure +Backend: +- Located in the `openhands` directory +- Testing: + - All tests are in `tests/unit/test_*.py` + - To test new code, run `poetry run pytest tests/unit/test_xxx.py` where `xxx` is the appropriate file for the current functionality + - Write all tests with pytest + +Frontend: +- Located in the `frontend` directory +- Prerequisites: A recent version of NodeJS / NPM +- Setup: Run `npm install` in the frontend directory +- Testing: + - Run tests: `npm run test` + - To run specific tests: `npm run test -- -t "TestName"` +- Building: + - Build for production: `npm run build` +- Environment Variables: + - Set in `frontend/.env` or as environment variables + - Available variables: VITE_BACKEND_HOST, VITE_USE_TLS, VITE_INSECURE_SKIP_VERIFY, VITE_FRONTEND_PORT +- Internationalization: + - Generate i18n declaration file: `npm run make-i18n` diff --git a/.openhands_instructions b/.openhands_instructions deleted file mode 100644 index d3a4f9d6c8a1..000000000000 --- a/.openhands_instructions +++ /dev/null @@ -1,28 +0,0 @@ -OpenHands is an automated AI software engineer. It is a repo with a Python backend -(in the `openhands` directory) and TypeScript frontend (in the `frontend` directory). - -General Setup: -- To set up the entire repo, including frontend and backend, run `make build` -- To run linting and type-checking before finishing the job, run `poetry run pre-commit run --all-files --config ./dev_config/python/.pre-commit-config.yaml` - -Backend: -- Located in the `openhands` directory -- Testing: - - All tests are in `tests/unit/test_*.py` - - To test new code, run `poetry run pytest tests/unit/test_xxx.py` where `xxx` is the appropriate file for the current functionality - - Write all tests with pytest - -Frontend: -- Located in the `frontend` directory -- Prerequisites: A recent version of NodeJS / NPM -- Setup: Run `npm install` in the frontend directory -- Testing: - - Run tests: `npm run test` - - To run specific tests: `npm run test -- -t "TestName"` -- Building: - - Build for production: `npm run build` -- Environment Variables: - - Set in `frontend/.env` or as environment variables - - Available variables: VITE_BACKEND_HOST, VITE_USE_TLS, VITE_INSECURE_SKIP_VERIFY, VITE_FRONTEND_PORT -- Internationalization: - - Generate i18n declaration file: `npm run make-i18n` diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 8c66075aef23..e033bde194d2 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -18,24 +18,24 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback +* Demonstrating empathy and kindness toward other people. +* Being respectful of differing opinions, viewpoints, and experiences. +* Giving and gracefully accepting constructive feedback. * Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience + and learning from the experience. * Focusing on what is best not just for us as individuals, but for the overall - community + community. Examples of unacceptable behavior include: * The use of sexualized language or imagery, and sexual attention or advances of - any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment + any kind. +* Trolling, insulting or derogatory comments, and personal or political attacks. +* Public or private harassment. * Publishing others' private information, such as a physical or email address, - without their explicit permission + without their explicit permission. * Other conduct which could reasonably be considered inappropriate in a - professional setting + professional setting. ## Enforcement Responsibilities @@ -61,7 +61,7 @@ representative at an online or offline event. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -contact@all-hands.dev +contact@all-hands.dev. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the @@ -113,6 +113,20 @@ individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within the community. +### Slack and Discord Etiquettes + +These Slack and Discord etiquette guidelines are designed to foster an inclusive, respectful, and productive environment for all community members. By following these best practices, we ensure effective communication and collaboration while minimizing disruptions. Let’s work together to build a supportive and welcoming community! + +- Communicate respectfully and professionally, avoiding sarcasm or harsh language, and remember that tone can be difficult to interpret in text. +- Use threads for specific discussions to keep channels organized and easier to follow. +- Tag others only when their input is critical or urgent, and use @here, @channel or @everyone sparingly to minimize disruptions. +- Be patient, as open-source contributors and maintainers often have other commitments and may need time to respond. +- Post questions or discussions in the most relevant channel (e.g., for [slack - #general](https://app.slack.com/client/T06P212QSEA/C06P5NCGSFP) for general topics, [slack - #questions](https://openhands-ai.slack.com/archives/C06U8UTKSAD) for queries/questions, [discord - #general](https://discord.com/channels/1222935860639563850/1222935861386018885)). +- When asking for help or raising issues, include necessary details like links, screenshots, or clear explanations to provide context. +- Keep discussions in public channels whenever possible to allow others to benefit from the conversation, unless the matter is sensitive or private. +- Always adhere to [our standards](https://github.com/All-Hands-AI/OpenHands/blob/main/CODE_OF_CONDUCT.md#our-standards) to ensure a welcoming and collaborative environment. +- If you choose to mute a channel, consider setting up alerts for topics that still interest you to stay engaged. For Slack, Go to Settings → Notifications → My Keywords to add specific keywords that will notify you when mentioned. For example, if you're here for discussions about LLMs, mute the channel if it’s too busy, but set notifications to alert you only when “LLMs” appears in messages. Also for Discord, go to the channel notifications and choose the option that best describes your need. + ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b1914cbd5b29..2ffc73c9c65b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,11 +11,11 @@ To understand the codebase, please refer to the README in each module: - [agenthub](./openhands/agenthub/README.md) - [server](./openhands/server/README.md) -## Setting up your development environment +## Setting up Your Development Environment 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. -## How can I contribute? +## How Can I Contribute? There are many ways that you can contribute: @@ -23,7 +23,7 @@ There are many ways that you can contribute: 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](#sending-pull-requests-to-openhands) (see details below). In particular, we have some [good first issues](https://github.com/All-Hands-AI/OpenHands/labels/good%20first%20issue) that may be ones to start on. -## What can I build? +## What Can I Build? Here are a few ways you can help improve the codebase. #### UI/UX @@ -35,7 +35,7 @@ of the application, please open an issue first, or better, join the #frontend ch to gather consensus from our design team first. #### Improving the agent -Our main agent is the CodeAct agent. You can [see its prompts here](https://github.com/All-Hands-AI/OpenHands/tree/main/openhands/agenthub/codeact_agent) +Our main agent is the CodeAct agent. You can [see its prompts here](https://github.com/All-Hands-AI/OpenHands/tree/main/openhands/agenthub/codeact_agent). Changes to these prompts, and to the underlying behavior in Python, can have a huge impact on user experience. You can try modifying the prompts to see how they change the behavior of the agent as you use the app @@ -63,7 +63,7 @@ At the moment, we have two kinds of tests: [`unit`](./tests/unit) and [`integrat ## Sending Pull Requests to OpenHands You'll need to fork our repository to send us a Pull Request. You can learn more -about how to fork a GitHub repo and open a PR with your changes in [this article](https://medium.com/swlh/forks-and-pull-requests-how-to-contribute-to-github-repos-8843fac34ce8) +about how to fork a GitHub repo and open a PR with your changes in [this article](https://medium.com/swlh/forks-and-pull-requests-how-to-contribute-to-github-repos-8843fac34ce8). ### Pull Request title As described [here](https://github.com/commitizen/conventional-commit-types/blob/master/index.json), a valid PR title should begin with one of the following prefixes: @@ -103,7 +103,7 @@ Further, if you see an issue you like, please leave a "thumbs-up" or a comment, ### Making Pull Requests -We're generally happy to consider all [PRs](https://github.com/All-Hands-AI/OpenHands/pulls), with the evaluation process varying based on the type of change: +We're generally happy to consider all pull requests with the evaluation process varying based on the type of change: #### For Small Improvements diff --git a/Development.md b/Development.md index bcb48ece3a02..06bf415a7921 100644 --- a/Development.md +++ b/Development.md @@ -3,12 +3,12 @@ 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 +## Start the Server for Development ### 1. Requirements -* Linux, Mac OS, or [WSL on Windows](https://learn.microsoft.com/en-us/windows/wsl/install) [Ubuntu <= 22.04] +* Linux, Mac OS, or [WSL on Windows](https://learn.microsoft.com/en-us/windows/wsl/install) [Ubuntu >= 22.04] * [Docker](https://docs.docker.com/engine/install/) (For those on MacOS, make sure to allow the default Docker socket to be used from advanced settings!) * [Python](https://www.python.org/downloads/) = 3.12 -* [NodeJS](https://nodejs.org/en/download/package-manager) >= 18.17.1 +* [NodeJS](https://nodejs.org/en/download/package-manager) >= 20.x * [Poetry](https://python-poetry.org/docs/#installing-with-the-official-installer) >= 1.8 * OS-specific dependencies: - Ubuntu: build-essential => `sudo apt-get install build-essential` @@ -58,7 +58,7 @@ See [our documentation](https://docs.all-hands.dev/modules/usage/llms) for recom ### 4. Running the application #### Option A: Run the Full Application -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: +Once the setup is complete, this command starts both the backend and frontend servers, allowing you to interact with OpenHands: ```bash make run ``` @@ -75,11 +75,11 @@ 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. -OpenHands will then log the prompts and responses in the logs/llm/CURRENT_DATE directory, allowing you to identify the causes. +If you encounter any issues with the Language Model (LM) or you're simply curious, export DEBUG=1 in the environment and restart the backend. +OpenHands will 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 OpenHands. +Need help or info on available targets and commands? Use the help command for all the guidance you need with OpenHands. ```bash make help ``` @@ -93,14 +93,14 @@ poetry run pytest ./tests/unit/test_*.py ``` ### 9. Add or update dependency -1. Add your dependency in `pyproject.toml` or use `poetry add xxx` -2. Update the poetry.lock file via `poetry lock --no-update` +1. Add your dependency in `pyproject.toml` or use `poetry add xxx`. +2. Update the poetry.lock file via `poetry lock --no-update`. ### 9. Use existing Docker image To reduce build time (e.g., if no changes were made to the client-runtime component), you can use an existing Docker container image by setting the SANDBOX_RUNTIME_CONTAINER_IMAGE environment variable to the desired Docker image. -Example: `export SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.16-nikolaik` +Example: `export SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.25-nikolaik` ## Develop inside Docker container @@ -110,7 +110,7 @@ TL;DR make docker-dev ``` -See more details [here](./containers/dev/README.md) +See more details [here](./containers/dev/README.md). If you are just interested in running `OpenHands` without installing all the required tools on your host. diff --git a/ISSUE_TRIAGE.md b/ISSUE_TRIAGE.md index 1cb12cc9ea6e..0bec6484825a 100644 --- a/ISSUE_TRIAGE.md +++ b/ISSUE_TRIAGE.md @@ -2,8 +2,8 @@ These are the procedures and guidelines on how issues are triaged in this repo by the maintainers. ## General -* Most issues must be tagged with **enhancement** or **bug** -* Issues may be tagged with what it relates to (**backend**, **frontend**, **agent quality**, etc.) +* Most issues must be tagged with **enhancement** or **bug**. +* Issues may be tagged with what it relates to (**backend**, **frontend**, **agent quality**, etc.). ## Severity * **Low**: Minor issues or affecting single user. @@ -11,10 +11,10 @@ These are the procedures and guidelines on how issues are triaged in this repo b * **Critical**: Affecting all users or potential security issues. ## Effort -* Issues may be estimated with effort required (**small effort**, **medium effort**, **large effort**) +* Issues may be estimated with effort required (**small effort**, **medium effort**, **large effort**). ## Difficulty -* Issues with low implementation difficulty may be tagged with **good first issue** +* Issues with low implementation difficulty may be tagged with **good first issue**. ## Not Enough Information * User is asked to provide more information (logs, how to reproduce, etc.) when the issue is not clear. diff --git a/Makefile b/Makefile index c4e1949b9621..08ada5d64c29 100644 --- a/Makefile +++ b/Makefile @@ -81,10 +81,10 @@ check-nodejs: @if command -v node > /dev/null; then \ NODE_VERSION=$(shell node --version | sed -E 's/v//g'); \ IFS='.' read -r -a NODE_VERSION_ARRAY <<< "$$NODE_VERSION"; \ - if [ "$${NODE_VERSION_ARRAY[0]}" -gt 18 ] || ([ "$${NODE_VERSION_ARRAY[0]}" -eq 18 ] && [ "$${NODE_VERSION_ARRAY[1]}" -gt 17 ]) || ([ "$${NODE_VERSION_ARRAY[0]}" -eq 18 ] && [ "$${NODE_VERSION_ARRAY[1]}" -eq 17 ] && [ "$${NODE_VERSION_ARRAY[2]}" -ge 1 ]); then \ + if [ "$${NODE_VERSION_ARRAY[0]}" -ge 22 ]; then \ echo "$(BLUE)Node.js $$NODE_VERSION is already installed.$(RESET)"; \ else \ - echo "$(RED)Node.js 18.17.1 or later is required. Please install Node.js 18.17.1 or later to continue.$(RESET)"; \ + echo "$(RED)Node.js 22.x or later is required. Please install Node.js 22.x or later to continue.$(RESET)"; \ exit 1; \ fi; \ else \ @@ -106,7 +106,7 @@ check-poetry: @if command -v poetry > /dev/null; then \ POETRY_VERSION=$(shell poetry --version 2>&1 | sed -E 's/Poetry \(version ([0-9]+\.[0-9]+\.[0-9]+)\)/\1/'); \ IFS='.' read -r -a POETRY_VERSION_ARRAY <<< "$$POETRY_VERSION"; \ - if [ $${POETRY_VERSION_ARRAY[0]} -ge 1 ] && [ $${POETRY_VERSION_ARRAY[1]} -ge 8 ]; then \ + if [ $${POETRY_VERSION_ARRAY[0]} -gt 1 ] || ([ $${POETRY_VERSION_ARRAY[0]} -eq 1 ] && [ $${POETRY_VERSION_ARRAY[1]} -ge 8 ]); then \ echo "$(BLUE)$(shell poetry --version) is already installed.$(RESET)"; \ else \ echo "$(RED)Poetry 1.8 or later is required. You can install poetry by running the following command, then adding Poetry to your PATH:"; \ @@ -190,7 +190,7 @@ build-frontend: # Start backend start-backend: @echo "$(YELLOW)Starting backend...$(RESET)" - @poetry run uvicorn openhands.server.listen:app --host $(BACKEND_HOST) --port $(BACKEND_PORT) --reload --reload-exclude "$(shell pwd)/workspace" + @poetry run uvicorn openhands.server.listen:app --host $(BACKEND_HOST) --port $(BACKEND_PORT) --reload --reload-exclude "./workspace" # Start frontend start-frontend: diff --git a/README.md b/README.md index d17325e6f22e..51cf52943e94 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ CodeCov MIT License
- Join our Slack community + Join our Slack community Join our Discord community Credits
@@ -39,21 +39,21 @@ Learn more at [docs.all-hands.dev](https://docs.all-hands.dev), or jump to the [ ## ⚡ Quick Start The easiest way to run OpenHands is in Docker. -See the [Installation](https://docs.all-hands.dev/modules/usage/installation) guide for +See the [Running OpenHands](https://docs.all-hands.dev/modules/usage/installation) guide for system requirements and more information. ```bash -docker pull docker.all-hands.dev/all-hands-ai/runtime:0.16-nikolaik +docker pull docker.all-hands.dev/all-hands-ai/runtime:0.25-nikolaik docker run -it --rm --pull=always \ - -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.16-nikolaik \ + -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.25-nikolaik \ -e LOG_ALL_EVENTS=true \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v ~/.openhands:/home/openhands/.openhands \ + -v ~/.openhands-state:/.openhands-state \ -p 3000:3000 \ --add-host host.docker.internal:host-gateway \ --name openhands-app \ - docker.all-hands.dev/all-hands-ai/openhands:0.16 + docker.all-hands.dev/all-hands-ai/openhands:0.25 ``` You'll find OpenHands running at [http://localhost:3000](http://localhost:3000)! @@ -64,16 +64,16 @@ works best, but you have [many options](https://docs.all-hands.dev/modules/usage --- -You can also [connect OpenHands to your local filesystem](https://docs.all-hands.dev/modules/usage/runtimes), +You can also [connect OpenHands to your local filesystem](https://docs.all-hands.dev/modules/usage/runtimes#connecting-to-your-filesystem), run OpenHands in a scriptable [headless mode](https://docs.all-hands.dev/modules/usage/how-to/headless-mode), interact with it via a [friendly CLI](https://docs.all-hands.dev/modules/usage/how-to/cli-mode), -or run it on tagged issues with [a github action](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/resolver/README.md). +or run it on tagged issues with [a github action](https://docs.all-hands.dev/modules/usage/how-to/github-action). -Visit [Installation](https://docs.all-hands.dev/modules/usage/installation) for more information and setup instructions. +Visit [Running OpenHands](https://docs.all-hands.dev/modules/usage/installation) for more information and setup instructions. > [!CAUTION] > OpenHands is meant to be run by a single user on their local workstation. -> It is not appropriate for multi-tenant deployments, where multiple users share the same instance--there is no built-in isolation or scalability. +> It is not appropriate for multi-tenant deployments where multiple users share the same instance. There is no built-in isolation or scalability. > > If you're interested in running OpenHands in a multi-tenant environment, please > [get in touch with us](https://docs.google.com/forms/d/e/1FAIpQLSet3VbGaz8z32gW9Wm-Grl4jpt5WgMXPgJ4EDPVmCETCBpJtQ/viewform) @@ -86,7 +86,7 @@ Having issues? The [Troubleshooting Guide](https://docs.all-hands.dev/modules/us ## 📖 Documentation To learn more about the project, and for tips on using OpenHands, -**check out our [documentation](https://docs.all-hands.dev/modules/usage/getting-started)**. +check out our [documentation](https://docs.all-hands.dev/modules/usage/getting-started). There you'll find resources on how to use different LLM providers, troubleshooting resources, and advanced configuration options. @@ -96,7 +96,7 @@ troubleshooting resources, and advanced configuration options. OpenHands is a community-driven project, and we welcome contributions from everyone. We do most of our communication through Slack, so this is the best place to start, but we also are happy to have you contact us on Discord or Github: -- [Join our Slack workspace](https://join.slack.com/t/openhands-ai/shared_invite/zt-2vbfigwev-G03twSpXaErwzYVD4CFiBg) - Here we talk about research, architecture, and future development. +- [Join our Slack workspace](https://join.slack.com/t/openhands-ai/shared_invite/zt-2ypg5jweb-d~6hObZDbXi_HEL8PDrbHg) - Here we talk about research, architecture, and future development. - [Join our Discord server](https://discord.gg/ESHStjSjD4) - This is a community-run server for general discussion, questions, and feedback. - [Read or post Github Issues](https://github.com/All-Hands-AI/OpenHands/issues) - Check out the issues we're working on, or add your own ideas. diff --git a/build.sh b/build.sh index 5bbad4bdfc93..b0c667b35f41 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,4 @@ #!/bin/bash set -e -cp pyproject.toml poetry.lock openhands poetry build -v diff --git a/config.template.toml b/config.template.toml index 26291976fd7e..331663c619f4 100644 --- a/config.template.toml +++ b/config.template.toml @@ -17,12 +17,21 @@ #modal_api_token_id = "" #modal_api_token_secret = "" +# API key for Daytona +#daytona_api_key = "" + +# Daytona Target +#daytona_target = "" + # Base path for the workspace workspace_base = "./workspace" # Cache directory path #cache_dir = "/tmp/cache" +# Reasoning effort for o1 models (low, medium, high, or not set) +#reasoning_effort = "medium" + # Debugging enabled #debug = false @@ -34,7 +43,12 @@ workspace_base = "./workspace" # Path to store trajectories, can be a folder or a file # If it's a folder, the session id will be used as the file name -#trajectories_path="./trajectories" +#save_trajectory_path="./trajectories" + +# Path to replay a trajectory, must be a file path +# If provided, trajectory will be loaded and replayed before the +# agent responds to any user instruction +#replay_trajectory_path = "" # File store path #file_store_path = "/tmp/file_store" @@ -67,7 +81,7 @@ workspace_base = "./workspace" #run_as_openhands = true # Runtime environment -#runtime = "eventstream" +#runtime = "docker" # Name of the default agent #default_agent = "CodeActAgent" @@ -96,7 +110,7 @@ workspace_base = "./workspace" #aws_secret_access_key = "" # API key to use (For Headless / CLI only - In Web this is overridden by Session Init) -api_key = "your-api-key" +api_key = "" # API base URL (For Headless / CLI only - In Web this is overridden by Session Init) #base_url = "" @@ -180,8 +194,14 @@ model = "gpt-4o" # https://docs.litellm.ai/docs/completion/token_usage #custom_tokenizer = "" +# Whether to use native tool calling if supported by the model. Can be true, false, or None by default, which chooses the model's default behavior based on the evaluation. +# ATTENTION: Based on evaluation, enabling native function calling may lead to worse results +# in some scenarios. Use with caution and consider testing with your specific use case. +# https://github.com/All-Hands-AI/OpenHands/pull/4711 +#native_tool_calling = None + [llm.gpt4o-mini] -api_key = "your-api-key" +api_key = "" model = "gpt-4o" @@ -192,6 +212,16 @@ model = "gpt-4o" # agent.CodeActAgent ############################################################################## [agent] + +# whether the browsing tool is enabled +codeact_enable_browsing = true + +# whether the LLM draft editor is enabled +codeact_enable_llm_editor = false + +# whether the IPython tool is enabled +codeact_enable_jupyter = true + # Name of the micro agent to use for this agent #micro_agent_name = "" @@ -204,6 +234,16 @@ model = "gpt-4o" # LLM config group to use #llm_config = 'your-llm-config-group' +# Whether to use prompt extension (e.g., microagent, repo/runtime info) at all +#enable_prompt_extensions = true + +# List of microagents to disable +#disabled_microagents = [] + +# Whether history should be truncated to continue the session when hitting LLM context +# length limit +enable_history_truncation = true + [agent.RepoExplorerAgent] # Example: use a cheaper model for RepoExplorerAgent to reduce cost, especially # useful when an agent doesn't demand high quality but uses a lot of tokens diff --git a/containers/app/Dockerfile b/containers/app/Dockerfile index 67753cbe2c2d..adcda79f338e 100644 --- a/containers/app/Dockerfile +++ b/containers/app/Dockerfile @@ -43,7 +43,8 @@ ENV WORKSPACE_BASE=/opt/workspace_base ENV OPENHANDS_BUILD_VERSION=$OPENHANDS_BUILD_VERSION ENV SANDBOX_USER_ID=0 ENV FILE_STORE=local -ENV FILE_STORE_PATH=~/.openhands +ENV FILE_STORE_PATH=/.openhands-state +RUN mkdir -p $FILE_STORE_PATH RUN mkdir -p $WORKSPACE_BASE RUN apt-get update -y \ @@ -70,6 +71,7 @@ ENV VIRTUAL_ENV=/app/.venv \ COPY --chown=openhands:app --chmod=770 --from=backend-builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} RUN playwright install --with-deps chromium +COPY --chown=openhands:app --chmod=770 ./microagents ./microagents 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 ./openhands/agenthub ./openhands/agenthub diff --git a/containers/dev/compose.yml b/containers/dev/compose.yml index 492ab2422d46..34245f04efaf 100644 --- a/containers/dev/compose.yml +++ b/containers/dev/compose.yml @@ -11,7 +11,7 @@ services: - BACKEND_HOST=${BACKEND_HOST:-"0.0.0.0"} - SANDBOX_API_HOSTNAME=host.docker.internal # - - SANDBOX_RUNTIME_CONTAINER_IMAGE=${SANDBOX_RUNTIME_CONTAINER_IMAGE:-ghcr.io/all-hands-ai/runtime:0.16-nikolaik} + - SANDBOX_RUNTIME_CONTAINER_IMAGE=${SANDBOX_RUNTIME_CONTAINER_IMAGE:-ghcr.io/all-hands-ai/runtime:0.25-nikolaik} - SANDBOX_USER_ID=${SANDBOX_USER_ID:-1234} - WORKSPACE_MOUNT_PATH=${WORKSPACE_BASE:-$PWD/workspace} ports: diff --git a/dev_config/python/ruff.toml b/dev_config/python/ruff.toml index af56e7e9d342..2ffc222fd980 100644 --- a/dev_config/python/ruff.toml +++ b/dev_config/python/ruff.toml @@ -24,3 +24,6 @@ inline-quotes = "single" [format] quote-style = "single" + +[lint.flake8-bugbear] +extend-immutable-calls = ["Depends", "fastapi.Depends", "fastapi.params.Depends"] diff --git a/compose.yml b/docker-compose.yml similarity index 65% rename from compose.yml rename to docker-compose.yml index 40e05b79a0b8..6407f78b4030 100644 --- a/compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -# + services: openhands: build: @@ -7,8 +7,8 @@ services: image: openhands:latest container_name: openhands-app-${DATE:-} environment: - - SANDBOX_RUNTIME_CONTAINER_IMAGE=${SANDBOX_RUNTIME_CONTAINER_IMAGE:-ghcr.io/all-hands-ai/runtime:0.16-nikolaik} - - SANDBOX_USER_ID=${SANDBOX_USER_ID:-1234} + - SANDBOX_RUNTIME_CONTAINER_IMAGE=${SANDBOX_RUNTIME_CONTAINER_IMAGE:-docker.all-hands.dev/all-hands-ai/runtime:0.25-nikolaik} + #- SANDBOX_USER_ID=${SANDBOX_USER_ID:-1234} # enable this only if you want a specific non-root sandbox user but you will have to manually adjust permissions of openhands-state for this user - WORKSPACE_MOUNT_PATH=${WORKSPACE_BASE:-$PWD/workspace} ports: - "3000:3000" @@ -16,6 +16,7 @@ services: - "host.docker.internal:host-gateway" volumes: - /var/run/docker.sock:/var/run/docker.sock + - ~/.openhands-state:/.openhands-state - ${WORKSPACE_BASE:-$PWD/workspace}:/opt/workspace_base pull_policy: build stdin_open: true diff --git a/docs/DOC_STYLE_GUIDE.md b/docs/DOC_STYLE_GUIDE.md new file mode 100644 index 000000000000..93b916b0e85a --- /dev/null +++ b/docs/DOC_STYLE_GUIDE.md @@ -0,0 +1,56 @@ +# Documentation Style Guide + +## General Writing Principles + +- **Clarity & Conciseness**: Always prioritize clarity and brevity. Avoid unnecessary jargon or overly complex explanations. +Keep sentences short and to the point. +- **Gradual Complexity**: Start with the simplest, most basic setup, and then gradually introduce more advanced +concepts and configurations. + +## Formatting Guidelines + +### Headers + +Use **Title Case** for the first and second level headers. + +Example: + - **Basic Usage** + - **Advanced Configuration Options** + +### Lists + +When listing items or options, use bullet points to enhance readability. + +Example: + - Option A + - Option B + - Option C + +### Procedures + +For instructions or processes that need to be followed in a specific order, use numbered steps. + +Example: + 1. Step one: Do this. + 2. Step two: Complete this action. + 3. Step three: Verify the result. + +### Code Blocks + +* Use code blocks for multi-line inputs, outputs, commands and code samples. + +Example: +```bash +docker run -it \ + -e THIS=this \ + -e THAT=that + ... +``` + +### Referring to UI Elements + +When referencing UI elements, use ``. + +Example: +1. Toggle the `Advanced` option +2. Enter your model in the `Custom Model` textbox. 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 7ff97147c32c..a38679543382 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 @@ -1,42 +1,21 @@ -# 📚 Divers -## ⭐️ Stratégie de recherche + +# À propos d'OpenHands + +## Stratégie de recherche La réplication complète d'applications de niveau production avec des LLM est une entreprise complexe. Notre stratégie implique : -1. **Recherche technique fondamentale :** Se concentrer sur la recherche fondamentale pour comprendre et améliorer les aspects techniques de la génération et de la gestion de code -2. **Capacités spécialisées :** Améliorer l'efficacité des composants de base grâce à la curation de données, aux méthodes d'entraînement, etc. -3. **Planification des tâches :** Développer des capacités de détection de bugs, de gestion de base de code et d'optimisation +1. **Recherche technique fondamentale :** Se concentrer sur la recherche fondamentale pour comprendre et améliorer les aspects techniques de la génération et de la gestion du code +2. **Capacités spécialisées :** Améliorer l'efficacité des composants de base grâce à la curation des données, aux méthodes d'entraînement, et plus encore +3. **Planification des tâches :** Développer des capacités pour la détection des bugs, la gestion des bases de code et l'optimisation 4. **Évaluation :** Établir des métriques d'évaluation complètes pour mieux comprendre et améliorer nos modèles -## 🚧 Agent par défaut +## Agent par défaut Notre Agent par défaut est actuellement le [CodeActAgent](agents), qui est capable de générer du code et de gérer des fichiers. -## 🤝 Comment contribuer - -OpenHands est un projet communautaire et nous accueillons les contributions de tous. 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 s'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 dans l'ingénierie logicielle, participez à l'évaluation des modèles ou suggérez des améliorations -- **Retours et tests :** Utilisez la boîte à outils OpenHands, signalez des bugs, suggérez des fonctionnalités ou donnez votre avis sur la facilité d'utilisation - -Pour plus de détails, veuillez consulter [ce document](https://github.com/All-Hands-AI/OpenHands/blob/main/CONTRIBUTING.md). - -## 🤖 Rejoignez notre communauté - -Nous avons à 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, LLM, agent, etc. - -- [Espace de travail Slack](https://join.slack.com/t/openhands-ai/shared_invite/zt-2vbfigwev-G03twSpXaErwzYVD4CFiBg) -- [Serveur Discord](https://discord.gg/ESHStjSjD4) - -Si vous souhaitez contribuer, n'hésitez pas à rejoindre notre communauté. Simplifions ensemble l'ingénierie logicielle ! - -🐚 **Codez moins, faites plus avec OpenHands.** - -[![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 +## Construit avec OpenHands est construit en utilisant une combinaison de frameworks et de bibliothèques puissants, fournissant une base solide pour son développement. Voici les principales technologies utilisées dans le projet : @@ -44,6 +23,6 @@ OpenHands est construit en utilisant une combinaison de frameworks et de bibliot Veuillez noter que la sélection de ces technologies est en cours et que des technologies supplémentaires peuvent être ajoutées ou des technologies existantes peuvent être supprimées à mesure que le projet évolue. Nous nous efforçons d'adopter les outils les plus appropriés et les plus efficaces pour améliorer les capacités d'OpenHands. -## 📜 Licence +## Licence -Distribué sous la licence MIT. Voir [notre licence](https://github.com/All-Hands-AI/OpenHands/blob/main/LICENSE) pour plus d'informations. +Distribué sous la [Licence](https://github.com/All-Hands-AI/OpenHands/blob/main/LICENSE) MIT. diff --git a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/architecture/runtime.md b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/architecture/runtime.md index 42e1dae5d824..71e121d45d62 100644 --- a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/architecture/runtime.md +++ b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/architecture/runtime.md @@ -1,8 +1,8 @@ -# 📦 Runtime EventStream +# 📦 Runtime Docker -Le Runtime EventStream d'OpenHands est le composant principal qui permet l'exécution sécurisée et flexible des actions des agents d'IA. +Le Runtime Docker d'OpenHands est le composant principal qui permet l'exécution sécurisée et flexible des actions des agents d'IA. Il crée un environnement en bac à sable (sandbox) en utilisant Docker, où du code arbitraire peut être exécuté en toute sécurité sans risquer le système hôte. ## Pourquoi avons-nous besoin d'un runtime en bac à sable ? diff --git a/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/configuration-options.md b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/configuration-options.md new file mode 100644 index 000000000000..7115c85b1e1f --- /dev/null +++ b/docs/i18n/fr/docusaurus-plugin-content-docs/current/usage/configuration-options.md @@ -0,0 +1,395 @@ +# Options de configuration + +Ce guide détaille toutes les options de configuration disponibles pour OpenHands, vous aidant à personnaliser son comportement et à l'intégrer avec d'autres services. + +:::note +Si vous exécutez en [Mode GUI](https://docs.all-hands.dev/modules/usage/how-to/gui-mode), les paramètres disponibles dans l'interface utilisateur des paramètres auront toujours +la priorité. +::: + +--- + +# Table des matières + +1. [Configuration de base](#configuration-de-base) + - [Clés API](#clés-api) + - [Espace de travail](#espace-de-travail) + - [Débogage et journalisation](#débogage-et-journalisation) + - [Gestion des sessions](#gestion-des-sessions) + - [Trajectoires](#trajectoires) + - [Stockage de fichiers](#stockage-de-fichiers) + - [Gestion des tâches](#gestion-des-tâches) + - [Configuration du bac à sable](#configuration-du-bac-à-sable) + - [Divers](#divers) +2. [Configuration LLM](#configuration-llm) + - [Informations d'identification AWS](#informations-didentification-aws) + - [Configuration de l'API](#configuration-de-lapi) + - [Fournisseur LLM personnalisé](#fournisseur-llm-personnalisé) + - [Embeddings](#embeddings) + - [Gestion des messages](#gestion-des-messages) + - [Sélection du modèle](#sélection-du-modèle) + - [Nouvelles tentatives](#nouvelles-tentatives) + - [Options avancées](#options-avancées) +3. [Configuration de l'agent](#configuration-de-lagent) + - [Configuration du micro-agent](#configuration-du-micro-agent) + - [Configuration de la mémoire](#configuration-de-la-mémoire) + - [Configuration LLM](#configuration-llm-2) + - [Configuration de l'espace d'action](#configuration-de-lespace-daction) + - [Utilisation du micro-agent](#utilisation-du-micro-agent) +4. [Configuration du bac à sable](#configuration-du-bac-à-sable-2) + - [Exécution](#exécution) + - [Image de conteneur](#image-de-conteneur) + - [Mise en réseau](#mise-en-réseau) + - [Linting et plugins](#linting-et-plugins) + - [Dépendances et environnement](#dépendances-et-environnement) + - [Évaluation](#évaluation) +5. [Configuration de sécurité](#configuration-de-sécurité) + - [Mode de confirmation](#mode-de-confirmation) + - [Analyseur de sécurité](#analyseur-de-sécurité) + +--- + +## Configuration de base + +Les options de configuration de base sont définies dans la section `[core]` du fichier `config.toml`. + +**Clés API** +- `e2b_api_key` + - Type : `str` + - Valeur par défaut : `""` + - Description : Clé API pour E2B + +- `modal_api_token_id` + - Type : `str` + - Valeur par défaut : `""` + - Description : ID du jeton API pour Modal + +- `modal_api_token_secret` + - Type : `str` + - Valeur par défaut : `""` + - Description : Secret du jeton API pour Modal + +**Espace de travail** +- `workspace_base` + - Type : `str` + - Valeur par défaut : `"./workspace"` + - Description : Chemin de base pour l'espace de travail + +- `cache_dir` + - Type : `str` + - Valeur par défaut : `"/tmp/cache"` + - Description : Chemin du répertoire de cache + +**Débogage et journalisation** +- `debug` + - Type : `bool` + - Valeur par défaut : `false` + - Description : Activer le débogage + +- `disable_color` + - Type : `bool` + - Valeur par défaut : `false` + - Description : Désactiver la couleur dans la sortie du terminal + +**Trajectoires** +- `save_trajectory_path` + - Type : `str` + - Valeur par défaut : `"./trajectories"` + - Description : Chemin pour stocker les trajectoires (peut être un dossier ou un fichier). Si c'est un dossier, les trajectoires seront enregistrées dans un fichier nommé avec l'ID de session et l'extension .json, dans ce dossier. + +**Stockage de fichiers** +- `file_store_path` + - Type : `str` + - Valeur par défaut : `"/tmp/file_store"` + - Description : Chemin de stockage des fichiers + +- `file_store` + - Type : `str` + - Valeur par défaut : `"memory"` + - Description : Type de stockage de fichiers + +- `file_uploads_allowed_extensions` + - Type : `list of str` + - Valeur par défaut : `[".*"]` + - Description : Liste des extensions de fichiers autorisées pour les téléchargements + +- `file_uploads_max_file_size_mb` + - Type : `int` + - Valeur par défaut : `0` + - Description : Taille maximale des fichiers pour les téléchargements, en mégaoctets + +- `file_uploads_restrict_file_types` + - Type : `bool` + - Valeur par défaut : `false` + - Description : Restreindre les types de fichiers pour les téléchargements de fichiers + +- `file_uploads_allowed_extensions` + - Type : `list of str` + - Valeur par défaut : `[".*"]` + - Description : Liste des extensions de fichiers autorisées pour les téléchargements + +**Gestion des tâches** +- `max_budget_per_task` + - Type : `float` + - Valeur par défaut : `0.0` + - Description : Budget maximal par tâche (0.0 signifie aucune limite) + +- `max_iterations` + - Type : `int` + - Valeur par défaut : `100` + - Description : Nombre maximal d'itérations + +**Configuration du bac à sable** +- `workspace_mount_path_in_sandbox` + - Type : `str` + - Valeur par défaut : `"/workspace"` + - Description : Chemin de montage de l'espace de travail dans le bac à sable + +- `workspace_mount_path` + - Type : `str` + - Valeur par défaut : `""` + - Description : Chemin de montage de l'espace de travail + +- `workspace_mount_rewrite` + - Type : `str` + - Valeur par défaut : `""` + - Description : Chemin pour réécrire le chemin de montage de l'espace de travail. Vous pouvez généralement ignorer cela, cela fait référence à des cas spéciaux d'exécution à l'intérieur d'un autre conteneur. + +**Divers** +- `run_as_openhands` + - Type : `bool` + - Valeur par défaut : `true` + - Description : Exécuter en tant qu'OpenHands + +- `runtime` + - Type : `str` + - Valeur par défaut : `"docker"` + - Description : Environnement d'exécution + +- `default_agent` + - Type : `str` + - Valeur par défaut : `"CodeActAgent"` + - Description : Nom de l'agent par défaut + +- `jwt_secret` + - Type : `str` + - Valeur par défaut : `uuid.uuid4().hex` + - Description : Secret JWT pour l'authentification. Veuillez le définir sur votre propre valeur. + +## Configuration LLM + +Les options de configuration LLM (Large Language Model) sont définies dans la section `[llm]` du fichier `config.toml`. + +Pour les utiliser avec la commande docker, passez `-e LLM_