From 0d65f1ecf98b1b2930d49e7bd28d82193419bfb4 Mon Sep 17 00:00:00 2001 From: Xingyao Wang Date: Mon, 2 Dec 2024 11:48:18 -0500 Subject: [PATCH] Revert "Merge main: Resolve conflicts while preserving analytics tracking" This reverts commit b6aa786163269bc1beb3f09fba3c2acda448a5e6, reversing changes made to 86d856f2bbbfe8471fafdb763d667f9f19876430. --- .github/workflows/eval-runner.yml | 23 +- .github/workflows/fe-unit-tests.yml | 3 - .github/workflows/integration-runner.yml | 158 --- .github/workflows/lint-fix.yml | 39 +- .github/workflows/lint.yml | 3 +- .github/workflows/openhands-resolver.yml | 6 - CONTRIBUTING.md | 12 +- docs/modules/usage/configuration-options.md | 465 --------- docs/modules/usage/how-to/github-action.md | 17 +- docs/sidebars.ts | 5 - .../HomepageHeader/HomepageHeader.tsx | 2 +- evaluation/README.md | 8 +- evaluation/integration_tests/run_infer.py | 65 +- .../tests/t05_simple_browsing.py | 34 +- .../tests/t06_github_pr_browsing.py | 48 +- .../components/chat/chat-interface.test.tsx | 35 +- .../file-explorer/file-explorer.test.tsx | 2 +- frontend/__tests__/routes/_oh.test.tsx | 2 +- frontend/package-lock.json | 4 +- frontend/package.json | 2 +- frontend/src/components/event-handler.tsx | 193 ++++ .../file-explorer/file-explorer.tsx | 307 ++++++ .../components/file-explorer/tree-node.tsx | 10 +- ...gs-form.tsx => account-settings-modal.tsx} | 8 +- frontend/src/context/user-prefs-context.tsx | 7 - frontend/src/context/ws-client-provider.tsx | 2 +- .../hooks/query/use-conversation-config.ts | 32 - frontend/src/hooks/query/use-vscode-url.ts | 43 - .../import-project-suggestion-box.tsx | 30 - frontend/src/routes/_oh._index/route.tsx | 46 +- .../src/routes/_oh.app._index/constants.ts | 11 - .../buttons/open-vscode-button.tsx | 30 - .../buttons/refresh-icon-button.tsx | 22 - .../buttons/toggle-workspace-icon-button.tsx | 33 - .../buttons/upload-icon-button.tsx | 22 - .../_oh.app._index/file-explorer/dropzone.tsx | 27 - .../file-explorer/file-explorer-actions.tsx | 36 - .../file-explorer/file-explorer-header.tsx | 42 - .../file-explorer/file-explorer.tsx | 156 --- frontend/src/routes/_oh.app._index/route.tsx | 15 +- .../routes/{_oh.app/route.tsx => _oh.app.tsx} | 10 +- .../src/routes/_oh.app/action-suggestions.tsx | 90 -- .../src/routes/_oh.app/chat-interface.tsx | 144 --- .../src/routes/_oh.app/chat-suggestions.tsx | 29 - frontend/src/routes/_oh.app/event-handler.tsx | 12 - .../hooks/use-handle-runtime-active.ts | 65 -- .../_oh.app/hooks/use-handle-ws-events.ts | 71 -- .../_oh.app/hooks/use-ws-status-change.ts | 97 -- .../src/routes/_oh.app/loading-spinner.tsx | 7 - frontend/src/routes/_oh.app/messages.tsx | 33 - frontend/src/routes/_oh.tsx | 268 +++++ .../_oh/buttons/all-hands-logo-button.tsx | 13 - .../src/routes/_oh/buttons/docs-button.tsx | 15 - .../_oh/buttons/exit-project-button.tsx | 18 - .../routes/_oh/buttons/settings-button.tsx | 18 - .../_oh/modals/account-settings-modal.tsx | 27 - .../exit-project-confirmation-modal.tsx | 42 - .../src/routes/_oh/modals/settings-modal.tsx | 50 - frontend/src/routes/_oh/route.tsx | 100 -- frontend/src/routes/_oh/sidebar.tsx | 91 -- frontend/src/services/actions.ts | 6 +- frontend/src/sessions.ts | 29 + .../agenthub/codeact_agent/codeact_agent.py | 2 - .../codeact_agent/function_calling.py | 30 +- openhands/agenthub/codeact_agent/micro/npm.md | 9 - openhands/events/action/browse.py | 2 +- openhands/events/observation/browse.py | 70 +- openhands/events/stream.py | 89 -- openhands/llm/llm.py | 9 +- .../resolver/examples/openhands-resolver.yml | 3 +- openhands/resolver/issue_definitions.py | 49 +- openhands/resolver/resolve_all_issues.py | 2 +- openhands/resolver/resolve_issue.py | 10 +- openhands/runtime/browser/utils.py | 2 - openhands/runtime/impl/e2b/sandbox.py | 2 +- .../runtime/impl/runloop/runloop_runtime.py | 50 +- openhands/security/README.md | 14 - openhands/security/invariant/analyzer.py | 151 --- openhands/server/app.py | 56 - openhands/server/auth/__init__.py | 3 + openhands/server/{ => auth}/auth.py | 0 openhands/server/file_config.py | 111 -- openhands/server/listen.py | 972 +++++++++++++++++- openhands/server/middleware.py | 77 +- openhands/server/routes/auth.py | 100 -- openhands/server/routes/conversation.py | 106 -- openhands/server/routes/feedback.py | 74 -- openhands/server/routes/files.py | 341 ------ openhands/server/routes/public.py | 106 -- openhands/server/routes/security.py | 30 - openhands/server/shared.py | 28 - openhands/server/socket.py | 76 -- openhands/server/static.py | 10 - poetry.lock | 11 +- pyproject.toml | 12 +- tests/runtime/conftest.py | 15 +- tests/unit/resolver/test_guess_success.py | 181 +--- tests/unit/resolver/test_issue_handler.py | 157 ++- .../test_issue_handler_error_handling.py | 178 +--- tests/unit/resolver/test_issue_references.py | 4 +- .../resolver/test_pr_handler_guess_success.py | 74 +- tests/unit/resolver/test_resolve_issues.py | 67 +- tests/unit/test_event_stream.py | 104 -- tests/unit/test_listen.py | 26 +- tests/unit/test_security.py | 93 -- 105 files changed, 2281 insertions(+), 4465 deletions(-) delete mode 100644 .github/workflows/integration-runner.yml delete mode 100644 docs/modules/usage/configuration-options.md create mode 100644 frontend/src/components/event-handler.tsx create mode 100644 frontend/src/components/file-explorer/file-explorer.tsx rename frontend/src/components/modals/{account-settings-form.tsx => account-settings-modal.tsx} (96%) delete mode 100644 frontend/src/hooks/query/use-conversation-config.ts delete mode 100644 frontend/src/hooks/query/use-vscode-url.ts delete mode 100644 frontend/src/routes/_oh._index/import-project-suggestion-box.tsx delete mode 100644 frontend/src/routes/_oh.app._index/constants.ts delete mode 100644 frontend/src/routes/_oh.app._index/file-explorer/buttons/open-vscode-button.tsx delete mode 100644 frontend/src/routes/_oh.app._index/file-explorer/buttons/refresh-icon-button.tsx delete mode 100644 frontend/src/routes/_oh.app._index/file-explorer/buttons/toggle-workspace-icon-button.tsx delete mode 100644 frontend/src/routes/_oh.app._index/file-explorer/buttons/upload-icon-button.tsx delete mode 100644 frontend/src/routes/_oh.app._index/file-explorer/dropzone.tsx delete mode 100644 frontend/src/routes/_oh.app._index/file-explorer/file-explorer-actions.tsx delete mode 100644 frontend/src/routes/_oh.app._index/file-explorer/file-explorer-header.tsx delete mode 100644 frontend/src/routes/_oh.app._index/file-explorer/file-explorer.tsx rename frontend/src/routes/{_oh.app/route.tsx => _oh.app.tsx} (91%) delete mode 100644 frontend/src/routes/_oh.app/action-suggestions.tsx delete mode 100644 frontend/src/routes/_oh.app/chat-interface.tsx delete mode 100644 frontend/src/routes/_oh.app/chat-suggestions.tsx delete mode 100644 frontend/src/routes/_oh.app/event-handler.tsx delete mode 100644 frontend/src/routes/_oh.app/hooks/use-handle-runtime-active.ts delete mode 100644 frontend/src/routes/_oh.app/hooks/use-handle-ws-events.ts delete mode 100644 frontend/src/routes/_oh.app/hooks/use-ws-status-change.ts delete mode 100644 frontend/src/routes/_oh.app/loading-spinner.tsx delete mode 100644 frontend/src/routes/_oh.app/messages.tsx create mode 100644 frontend/src/routes/_oh.tsx delete mode 100644 frontend/src/routes/_oh/buttons/all-hands-logo-button.tsx delete mode 100644 frontend/src/routes/_oh/buttons/docs-button.tsx delete mode 100644 frontend/src/routes/_oh/buttons/exit-project-button.tsx delete mode 100644 frontend/src/routes/_oh/buttons/settings-button.tsx delete mode 100644 frontend/src/routes/_oh/modals/account-settings-modal.tsx delete mode 100644 frontend/src/routes/_oh/modals/exit-project-confirmation-modal.tsx delete mode 100644 frontend/src/routes/_oh/modals/settings-modal.tsx delete mode 100644 frontend/src/routes/_oh/route.tsx delete mode 100644 frontend/src/routes/_oh/sidebar.tsx create mode 100644 frontend/src/sessions.ts delete mode 100644 openhands/agenthub/codeact_agent/micro/npm.md delete mode 100644 openhands/server/app.py create mode 100644 openhands/server/auth/__init__.py rename openhands/server/{ => auth}/auth.py (100%) delete mode 100644 openhands/server/file_config.py delete mode 100644 openhands/server/routes/auth.py delete mode 100644 openhands/server/routes/conversation.py delete mode 100644 openhands/server/routes/feedback.py delete mode 100644 openhands/server/routes/files.py delete mode 100644 openhands/server/routes/public.py delete mode 100644 openhands/server/routes/security.py delete mode 100644 openhands/server/shared.py delete mode 100644 openhands/server/socket.py delete mode 100644 openhands/server/static.py diff --git a/.github/workflows/eval-runner.yml b/.github/workflows/eval-runner.yml index b1ace09b35de..9b2576a2644e 100644 --- a/.github/workflows/eval-runner.yml +++ b/.github/workflows/eval-runner.yml @@ -1,4 +1,4 @@ -name: Run SWE-Bench Evaluation +name: Run Evaluation on: pull_request: @@ -58,6 +58,24 @@ jobs: echo "api_key = \"$DEEPSEEK_API_KEY\"" >> config.toml echo "temperature = 0.0" >> config.toml + - name: Run integration test evaluation + env: + ALLHANDS_API_KEY: ${{ secrets.ALLHANDS_EVAL_RUNTIME_API_KEY }} + RUNTIME: remote + SANDBOX_REMOTE_RUNTIME_API_URL: https://runtime.eval.all-hands.dev + EVAL_DOCKER_IMAGE_PREFIX: us-central1-docker.pkg.dev/evaluation-092424/swe-bench-images + + run: | + poetry run ./evaluation/integration_tests/scripts/run_infer.sh llm.eval HEAD CodeActAgent '' $N_PROCESSES + + # get evaluation report + REPORT_FILE=$(find evaluation/evaluation_outputs/outputs/integration_tests/CodeActAgent/deepseek-chat_maxiter_10_N* -name "report.md" -type f | head -n 1) + echo "REPORT_FILE: $REPORT_FILE" + echo "INTEGRATION_TEST_REPORT<> $GITHUB_ENV + cat $REPORT_FILE >> $GITHUB_ENV + echo >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + - name: Run SWE-Bench evaluation env: ALLHANDS_API_KEY: ${{ secrets.ALLHANDS_EVAL_RUNTIME_API_KEY }} @@ -125,6 +143,9 @@ jobs: **SWE-Bench Evaluation Report** ${{ env.SWEBENCH_REPORT }} --- + **Integration Tests Evaluation Report** + ${{ env.INTEGRATION_TEST_REPORT }} + --- You can download the full evaluation outputs [here](${{ env.ARTIFACT_URL }}). - name: Post to a Slack channel diff --git a/.github/workflows/fe-unit-tests.yml b/.github/workflows/fe-unit-tests.yml index b720bfe34c28..2bced7406e6c 100644 --- a/.github/workflows/fe-unit-tests.yml +++ b/.github/workflows/fe-unit-tests.yml @@ -35,9 +35,6 @@ jobs: - name: Install dependencies working-directory: ./frontend run: npm ci - - name: Run TypeScript compilation - working-directory: ./frontend - run: npm run make-i18n && tsc - name: Run tests and collect coverage working-directory: ./frontend run: npm run test:coverage diff --git a/.github/workflows/integration-runner.yml b/.github/workflows/integration-runner.yml deleted file mode 100644 index 120572aa0cdd..000000000000 --- a/.github/workflows/integration-runner.yml +++ /dev/null @@ -1,158 +0,0 @@ -name: Run Integration Tests - -on: - pull_request: - types: [labeled] - workflow_dispatch: - inputs: - reason: - description: 'Reason for manual trigger' - required: true - default: '' - schedule: - - cron: '30 22 * * *' # Runs at 10:30pm UTC every day - -env: - N_PROCESSES: 10 # Global configuration for number of parallel processes for evaluation - -jobs: - run-integration-tests: - if: github.event.label.name == 'integration-test' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' - runs-on: ubuntu-latest - permissions: - contents: "read" - id-token: "write" - pull-requests: "write" - issues: "write" - strategy: - matrix: - python-version: ["3.12"] - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install poetry via pipx - run: pipx install poetry - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: "poetry" - - - name: Comment on PR if 'integration-test' label is present - if: github.event_name == 'pull_request' && github.event.label.name == 'integration-test' - uses: KeisukeYamashita/create-comment@v1 - with: - unique: false - comment: | - Hi! I started running the integration tests on your PR. You will receive a comment with the results shortly. - - - name: Install Python dependencies using Poetry - run: poetry install --without evaluation,llama-index - - - name: Configure config.toml for testing with 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 }} - 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: Build environment - run: make build - - - name: Run integration test evaluation for Haiku - env: - SANDBOX_FORCE_REBUILD_RUNTIME: True - run: | - poetry run ./evaluation/integration_tests/scripts/run_infer.sh llm.eval HEAD CodeActAgent '' $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) - echo "REPORT_FILE: $REPORT_FILE_HAIKU" - echo "INTEGRATION_TEST_REPORT_HAIKU<> $GITHUB_ENV - cat $REPORT_FILE_HAIKU >> $GITHUB_ENV - echo >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - - name: Wait a little bit - run: sleep 10 - - - name: Configure config.toml for testing with DeepSeek - env: - LLM_MODEL: "litellm_proxy/deepseek-chat" - LLM_API_KEY: ${{ secrets.LLM_API_KEY }} - LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }} - 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 DeepSeek - env: - SANDBOX_FORCE_REBUILD_RUNTIME: True - run: | - poetry run ./evaluation/integration_tests/scripts/run_infer.sh llm.eval HEAD CodeActAgent '' $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) - echo "REPORT_FILE: $REPORT_FILE_DEEPSEEK" - echo "INTEGRATION_TEST_REPORT_DEEPSEEK<> $GITHUB_ENV - cat $REPORT_FILE_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 - - - name: Upload evaluation results as artifact - uses: actions/upload-artifact@v4 - id: upload_results_artifact - with: - name: integration-test-outputs-${{ github.run_id }}-${{ github.run_attempt }} - path: integration_tests_*.tar.gz - - - name: Get artifact URLs - run: | - echo "ARTIFACT_URL=${{ steps.upload_results_artifact.outputs.artifact-url }}" >> $GITHUB_ENV - - - name: Set timestamp and trigger reason - run: | - echo "TIMESTAMP=$(date +'%Y-%m-%d-%H-%M')" >> $GITHUB_ENV - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - echo "TRIGGER_REASON=pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then - echo "TRIGGER_REASON=manual-${{ github.event.inputs.reason }}" >> $GITHUB_ENV - else - echo "TRIGGER_REASON=nightly-scheduled" >> $GITHUB_ENV - fi - - - name: Comment with results and artifact link - id: create_comment - uses: KeisukeYamashita/create-comment@v1 - with: - # if triggered by PR, use PR number, otherwise use 5318 as fallback issue number for manual triggers - number: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || 5318 }} - unique: false - comment: | - Trigger by: ${{ github.event_name == 'pull_request' && format('Pull Request (integration-test label on PR #{0})', github.event.pull_request.number) || (github.event_name == 'workflow_dispatch' && format('Manual Trigger: {0}', github.event.inputs.reason)) || 'Nightly Scheduled Run' }} - Commit: ${{ github.sha }} - **Integration Tests Report (Haiku)** - Haiku LLM Test Results: - ${{ env.INTEGRATION_TEST_REPORT_HAIKU }} - --- - **Integration Tests Report (DeepSeek)** - DeepSeek LLM Test Results: - ${{ env.INTEGRATION_TEST_REPORT_DEEPSEEK }} - --- - Download testing outputs (includes both Haiku and DeepSeek results): [Download](${{ steps.upload_results_artifact.outputs.artifact-url }}) diff --git a/.github/workflows/lint-fix.yml b/.github/workflows/lint-fix.yml index dca35010fb80..9fa97eaaf2f1 100644 --- a/.github/workflows/lint-fix.yml +++ b/.github/workflows/lint-fix.yml @@ -5,10 +5,9 @@ on: types: [labeled] jobs: - # Frontend lint fixes - lint-fix-frontend: + lint-fix: if: github.event.label.name == 'lint-fix' - name: Fix frontend linting issues + name: Fix linting issues runs-on: ubuntu-latest permissions: contents: write @@ -21,6 +20,7 @@ jobs: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} + # Frontend lint fixes - name: Install Node.js 20 uses: actions/setup-node@v4 with: @@ -34,36 +34,7 @@ jobs: cd frontend npm run lint:fix - # Commit and push changes if any - - name: Check for changes - id: git-check - run: | - git diff --quiet || echo "changes=true" >> $GITHUB_OUTPUT - - name: Commit and push if there are changes - if: steps.git-check.outputs.changes == 'true' - run: | - git config --local user.email "openhands@all-hands.dev" - git config --local user.name "OpenHands Bot" - git add -A - git commit -m "🤖 Auto-fix frontend linting issues" - git push - - # Python lint fixes - lint-fix-python: - if: github.event.label.name == 'lint-fix' - name: Fix Python linting issues - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} - + # Python lint fixes - name: Set up python uses: actions/setup-python@v5 with: @@ -87,5 +58,5 @@ jobs: git config --local user.email "openhands@all-hands.dev" git config --local user.name "OpenHands Bot" git add -A - git commit -m "🤖 Auto-fix Python linting issues" + git commit -m "🤖 Auto-fix linting issues" git push diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1bfc8c91c6a4..b6a9d327d860 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -30,11 +30,10 @@ jobs: run: | cd frontend npm install --frozen-lockfile - - name: Lint and TypeScript compilation + - name: Lint run: | cd frontend npm run lint - npm run make-i18n && tsc # Run lint on the python code lint-python: diff --git a/.github/workflows/openhands-resolver.yml b/.github/workflows/openhands-resolver.yml index 2719c3773607..f24a8e90cbfb 100644 --- a/.github/workflows/openhands-resolver.yml +++ b/.github/workflows/openhands-resolver.yml @@ -16,11 +16,6 @@ on: type: string default: "main" description: "Target branch to pull and create PR against" - base_container_image: - required: false - type: string - default: "" - description: "Custom sandbox env" secrets: LLM_MODEL: required: true @@ -144,7 +139,6 @@ jobs: echo "MAX_ITERATIONS=${{ inputs.max_iterations || 50 }}" >> $GITHUB_ENV echo "SANDBOX_ENV_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV - echo "SANDBOX_ENV_BASE_CONTAINER_IMAGE=${{ inputs.base_container_image }}" >> $GITHUB_ENV # Set branch variables echo "TARGET_BRANCH=${{ inputs.target_branch }}" >> $GITHUB_ENV diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b1914cbd5b29..847b6c469812 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,14 +21,14 @@ There are many ways that you can contribute: 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](#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. +3. **Improve the Codebase** by sending PRs (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? Here are a few ways you can help improve the codebase. #### UI/UX We're always looking to improve the look and feel of the application. If you've got a small fix -for something that's bugging you, feel free to open up a PR that changes the [`./frontend`](./frontend) directory. +for something that's bugging you, feel free to open up a PR that changes the `./frontend` directory. If you're looking to make a bigger change, add a new UI element, or significantly alter the style of the application, please open an issue first, or better, join the #frontend channel in our Slack @@ -46,7 +46,7 @@ We use the [SWE-bench](https://www.swebench.com/) benchmark to test our agent. Y channel in Slack to learn more. #### Adding a new agent -You may want to experiment with building new types of agents. You can add an agent to [`openhands/agenthub`](./openhands/agenthub) +You may want to experiment with building new types of agents. You can add an agent to `openhands/agenthub` to help expand the capabilities of OpenHands. #### Adding a new runtime @@ -57,8 +57,8 @@ If you work for a company that provides a cloud-based runtime, you could help us by implementing the [interface specified here](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/base.py). #### Testing -When you write code, it is also good to write tests. Please navigate to the [`./tests`](./tests) folder to see existing test suites. -At the moment, we have two kinds of tests: [`unit`](./tests/unit) and [`integration`](./evaluation/integration_tests). Please refer to the README for each test suite. These tests also run on GitHub's continuous integration to ensure quality of the project. +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 OpenHands @@ -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 PRs, with the evaluation process varying based on the type of change: #### For Small Improvements diff --git a/docs/modules/usage/configuration-options.md b/docs/modules/usage/configuration-options.md deleted file mode 100644 index 7a2718d7d786..000000000000 --- a/docs/modules/usage/configuration-options.md +++ /dev/null @@ -1,465 +0,0 @@ -# Configuration Options - -This guide details all configuration options available for OpenHands, helping you customize its behavior and integrate it with other services. - -:::note -If you are running in [GUI Mode](https://docs.all-hands.dev/modules/usage/how-to/gui-mode), the settings available in the Settings UI will always -take precedence. -::: - ---- - -# Table of Contents - -1. [Core Configuration](#core-configuration) - - [API Keys](#api-keys) - - [Workspace](#workspace) - - [Debugging and Logging](#debugging-and-logging) - - [Session Management](#session-management) - - [Trajectories](#trajectories) - - [File Store](#file-store) - - [Task Management](#task-management) - - [Sandbox Configuration](#sandbox-configuration) - - [Miscellaneous](#miscellaneous) -2. [LLM Configuration](#llm-configuration) - - [AWS Credentials](#aws-credentials) - - [API Configuration](#api-configuration) - - [Custom LLM Provider](#custom-llm-provider) - - [Embeddings](#embeddings) - - [Message Handling](#message-handling) - - [Model Selection](#model-selection) - - [Retrying](#retrying) - - [Advanced Options](#advanced-options) -3. [Agent Configuration](#agent-configuration) - - [Microagent Configuration](#microagent-configuration) - - [Memory Configuration](#memory-configuration) - - [LLM Configuration](#llm-configuration-2) - - [ActionSpace Configuration](#actionspace-configuration) - - [Microagent Usage](#microagent-usage) -4. [Sandbox Configuration](#sandbox-configuration-2) - - [Execution](#execution) - - [Container Image](#container-image) - - [Networking](#networking) - - [Linting and Plugins](#linting-and-plugins) - - [Dependencies and Environment](#dependencies-and-environment) - - [Evaluation](#evaluation) -5. [Security Configuration](#security-configuration) - - [Confirmation Mode](#confirmation-mode) - - [Security Analyzer](#security-analyzer) - ---- - -## Core Configuration - -The core configuration options are defined in the `[core]` section of the `config.toml` file. - -**API Keys** -- `e2b_api_key` - - Type: `str` - - Default: `""` - - Description: API key for E2B - -- `modal_api_token_id` - - Type: `str` - - Default: `""` - - Description: API token ID for Modal - -- `modal_api_token_secret` - - Type: `str` - - Default: `""` - - Description: API token secret for Modal - -**Workspace** -- `workspace_base` - - Type: `str` - - Default: `"./workspace"` - - Description: Base path for the workspace - -- `cache_dir` - - Type: `str` - - Default: `"/tmp/cache"` - - Description: Cache directory path - -**Debugging and Logging** -- `debug` - - Type: `bool` - - Default: `false` - - Description: Enable debugging - -- `disable_color` - - Type: `bool` - - Default: `false` - - Description: Disable color in terminal output - -**Trajectories** -- `trajectories_path` - - Type: `str` - - Default: `"./trajectories"` - - Description: Path to store trajectories (can be a folder or a file). If it's a folder, the trajectories will be saved in a file named with the session id name and .json extension, in that folder. - -**File Store** -- `file_store_path` - - Type: `str` - - Default: `"/tmp/file_store"` - - Description: File store path - -- `file_store` - - Type: `str` - - Default: `"memory"` - - Description: File store type - -- `file_uploads_allowed_extensions` - - Type: `list of str` - - Default: `[".*"]` - - Description: List of allowed file extensions for uploads - -- `file_uploads_max_file_size_mb` - - Type: `int` - - Default: `0` - - Description: Maximum file size for uploads, in megabytes - -- `file_uploads_restrict_file_types` - - Type: `bool` - - Default: `false` - - Description: Restrict file types for file uploads - -- `file_uploads_allowed_extensions` - - Type: `list of str` - - Default: `[".*"]` - - Description: List of allowed file extensions for uploads - -**Task Management** -- `max_budget_per_task` - - Type: `float` - - Default: `0.0` - - Description: Maximum budget per task (0.0 means no limit) - -- `max_iterations` - - Type: `int` - - Default: `100` - - Description: Maximum number of iterations - -**Sandbox Configuration** -- `workspace_mount_path_in_sandbox` - - Type: `str` - - Default: `"/workspace"` - - Description: Path to mount the workspace in the sandbox - -- `workspace_mount_path` - - Type: `str` - - Default: `""` - - Description: Path to mount the workspace - -- `workspace_mount_rewrite` - - Type: `str` - - Default: `""` - - Description: Path to rewrite the workspace mount path to. You can usually ignore this, it refers to special cases of running inside another container. - -**Miscellaneous** -- `run_as_openhands` - - Type: `bool` - - Default: `true` - - Description: Run as OpenHands - -- `runtime` - - Type: `str` - - Default: `"eventstream"` - - Description: Runtime environment - -- `default_agent` - - Type: `str` - - Default: `"CodeActAgent"` - - Description: Name of the default agent - -- `jwt_secret` - - Type: `str` - - Default: `uuid.uuid4().hex` - - Description: JWT secret for authentication. Please set it to your own value. - -## LLM Configuration - -The LLM (Large Language Model) configuration options are defined in the `[llm]` section of the `config.toml` file. - -To use these with the docker command, pass in `-e LLM_