From 7d0aadf8eddfa8515fef467e875c8be5fa8e45cf Mon Sep 17 00:00:00 2001 From: Graham Neubig Date: Tue, 17 Jun 2025 16:44:52 -0400 Subject: [PATCH] Rename ~/.openhands-state to ~/.openhands (#9135) Co-authored-by: openhands Co-authored-by: Xingyao Wang --- README.md | 4 +++- README_CN.md | 4 +++- containers/app/Dockerfile | 2 +- docker-compose.yml | 4 ++-- docs/usage/how-to/cli-mode.mdx | 4 +++- docs/usage/how-to/headless-mode.mdx | 3 ++- docs/usage/llms/local-llms.mdx | 6 ++++-- docs/usage/local-setup.mdx | 4 +++- docs/usage/troubleshooting/troubleshooting.mdx | 11 +++++++---- openhands/runtime/impl/daytona/README.md | 8 ++++++-- 10 files changed, 34 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 3ec39dc564..2c216a0673 100644 --- a/README.md +++ b/README.md @@ -68,13 +68,15 @@ docker run -it --rm --pull=always \ -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.43-nikolaik \ -e LOG_ALL_EVENTS=true \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v ~/.openhands-state:/.openhands-state \ + -v ~/.openhands:/.openhands \ -p 3000:3000 \ --add-host host.docker.internal:host-gateway \ --name openhands-app \ docker.all-hands.dev/all-hands-ai/openhands:0.43 ``` +> **Note**: If you used OpenHands before version 0.44, you may want to run `mv ~/.openhands-state ~/.openhands` to migrate your conversation history to the new location. + You'll find OpenHands running at [http://localhost:3000](http://localhost:3000)! When you open the application, you'll be asked to choose an LLM provider and add an API key. diff --git a/README_CN.md b/README_CN.md index a2c4ed0763..24bc2e400c 100644 --- a/README_CN.md +++ b/README_CN.md @@ -57,13 +57,15 @@ docker run -it --rm --pull=always \ -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.43-nikolaik \ -e LOG_ALL_EVENTS=true \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v ~/.openhands-state:/.openhands-state \ + -v ~/.openhands:/.openhands \ -p 3000:3000 \ --add-host host.docker.internal:host-gateway \ --name openhands-app \ docker.all-hands.dev/all-hands-ai/openhands:0.43 ``` +> **注意**: 如果您在0.44版本之前使用过OpenHands,您可能需要运行 `mv ~/.openhands-state ~/.openhands` 来将对话历史迁移到新位置。 + 您将在[http://localhost:3000](http://localhost:3000)找到运行中的OpenHands! 打开应用程序时,您将被要求选择一个LLM提供商并添加API密钥。 diff --git a/containers/app/Dockerfile b/containers/app/Dockerfile index 59aef9a5d0..c545d46919 100644 --- a/containers/app/Dockerfile +++ b/containers/app/Dockerfile @@ -44,7 +44,7 @@ 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-state +ENV FILE_STORE_PATH=/.openhands RUN mkdir -p $FILE_STORE_PATH RUN mkdir -p $WORKSPACE_BASE diff --git a/docker-compose.yml b/docker-compose.yml index b51320dc4a..c2d0cc2caa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: container_name: openhands-app-${DATE:-} environment: - SANDBOX_RUNTIME_CONTAINER_IMAGE=${SANDBOX_RUNTIME_CONTAINER_IMAGE:-docker.all-hands.dev/all-hands-ai/runtime:0.43-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 + #- 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 for this user - WORKSPACE_MOUNT_PATH=${WORKSPACE_BASE:-$PWD/workspace} ports: - "3000:3000" @@ -16,7 +16,7 @@ services: - "host.docker.internal:host-gateway" volumes: - /var/run/docker.sock:/var/run/docker.sock - - ~/.openhands-state:/.openhands-state + - ~/.openhands:/.openhands - ${WORKSPACE_BASE:-$PWD/workspace}:/opt/workspace_base pull_policy: build stdin_open: true diff --git a/docs/usage/how-to/cli-mode.mdx b/docs/usage/how-to/cli-mode.mdx index 0c53d33544..9e052ebbe6 100644 --- a/docs/usage/how-to/cli-mode.mdx +++ b/docs/usage/how-to/cli-mode.mdx @@ -61,13 +61,15 @@ docker run -it \ -e LLM_API_KEY=$LLM_API_KEY \ -e LLM_MODEL=$LLM_MODEL \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v ~/.openhands-state:/.openhands-state \ + -v ~/.openhands:/.openhands \ --add-host host.docker.internal:host-gateway \ --name openhands-app-$(date +%Y%m%d%H%M%S) \ docker.all-hands.dev/all-hands-ai/openhands:0.43 \ python -m openhands.cli.main --override-cli-mode true ``` +> **Note**: If you used OpenHands before version 0.44, you may want to run `mv ~/.openhands-state ~/.openhands` to migrate your conversation history to the new location. + This launches the CLI in Docker, allowing you to interact with OpenHands as described above. The `-e SANDBOX_USER_ID=$(id -u)` ensures files created by the agent in your workspace have the correct permissions. diff --git a/docs/usage/how-to/headless-mode.mdx b/docs/usage/how-to/headless-mode.mdx index c5243cbc87..b65ca81423 100644 --- a/docs/usage/how-to/headless-mode.mdx +++ b/docs/usage/how-to/headless-mode.mdx @@ -39,12 +39,13 @@ docker run -it \ -e LLM_MODEL=$LLM_MODEL \ -e LOG_ALL_EVENTS=true \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v ~/.openhands-state:/.openhands-state \ + -v ~/.openhands:/.openhands \ --add-host host.docker.internal:host-gateway \ --name openhands-app-$(date +%Y%m%d%H%M%S) \ docker.all-hands.dev/all-hands-ai/openhands:0.43 \ python -m openhands.core.main -t "write a bash script that prints hi" ``` +> **Note**: If you used OpenHands before version 0.44, you may want to run `mv ~/.openhands-state ~/.openhands` to migrate your conversation history to the new location. The `-e SANDBOX_USER_ID=$(id -u)` is passed to the Docker command to ensure the sandbox user matches the host user’s permissions. This prevents the agent from creating root-owned files in the mounted workspace. diff --git a/docs/usage/llms/local-llms.mdx b/docs/usage/llms/local-llms.mdx index 39e58005be..4013d53d64 100644 --- a/docs/usage/llms/local-llms.mdx +++ b/docs/usage/llms/local-llms.mdx @@ -56,19 +56,21 @@ export LMSTUDIO_URL="http://host.docker.internal:1234" # <- Replace this with t docker pull docker.all-hands.dev/all-hands-ai/runtime:0.43-nikolaik -mkdir -p ~/.openhands-state && echo '{"language":"en","agent":"CodeActAgent","max_iterations":null,"security_analyzer":null,"confirmation_mode":false,"llm_model":"lm_studio/'$LMSTUDIO_MODEL_NAME'","llm_api_key":"dummy","llm_base_url":"'$LMSTUDIO_URL/v1'","remote_runtime_resource_factor":null,"github_token":null,"enable_default_condenser":true,"user_consents_to_analytics":true}' > ~/.openhands-state/settings.json +mkdir -p ~/.openhands && echo '{"language":"en","agent":"CodeActAgent","max_iterations":null,"security_analyzer":null,"confirmation_mode":false,"llm_model":"lm_studio/'$LMSTUDIO_MODEL_NAME'","llm_api_key":"dummy","llm_base_url":"'$LMSTUDIO_URL/v1'","remote_runtime_resource_factor":null,"github_token":null,"enable_default_condenser":true,"user_consents_to_analytics":true}' > ~/.openhands/settings.json docker run -it --rm --pull=always \ -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.43-nikolaik \ -e LOG_ALL_EVENTS=true \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v ~/.openhands-state:/.openhands-state \ + -v ~/.openhands:/.openhands \ -p 3000:3000 \ --add-host host.docker.internal:host-gateway \ --name openhands-app \ docker.all-hands.dev/all-hands-ai/openhands:0.43 ``` +> **Note**: If you used OpenHands before version 0.44, you may want to run `mv ~/.openhands-state ~/.openhands` to migrate your conversation history to the new location. + Once your server is running -- you can visit `http://localhost:3000` in your browser to use OpenHands with local Devstral model: ``` Digest: sha256:e72f9baecb458aedb9afc2cd5bc935118d1868719e55d50da73190d3a85c674f diff --git a/docs/usage/local-setup.mdx b/docs/usage/local-setup.mdx index 51aa0b2933..0199f7c790 100644 --- a/docs/usage/local-setup.mdx +++ b/docs/usage/local-setup.mdx @@ -73,13 +73,15 @@ docker run -it --rm --pull=always \ -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.43-nikolaik \ -e LOG_ALL_EVENTS=true \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v ~/.openhands-state:/.openhands-state \ + -v ~/.openhands:/.openhands \ -p 3000:3000 \ --add-host host.docker.internal:host-gateway \ --name openhands-app \ docker.all-hands.dev/all-hands-ai/openhands:0.43 ``` +> **Note**: If you used OpenHands before version 0.44, you may want to run `mv ~/.openhands-state ~/.openhands` to migrate your conversation history to the new location. + You'll find OpenHands running at http://localhost:3000! ### Setup diff --git a/docs/usage/troubleshooting/troubleshooting.mdx b/docs/usage/troubleshooting/troubleshooting.mdx index dcffd7da35..968c521e9a 100644 --- a/docs/usage/troubleshooting/troubleshooting.mdx +++ b/docs/usage/troubleshooting/troubleshooting.mdx @@ -31,9 +31,9 @@ On initial prompt, an error is seen with `Permission Denied` or `PermissionError **Resolution** -* Check if the `~/.openhands-state` is owned by `root`. If so, you can: - * Change the directory's ownership: `sudo chown : ~/.openhands-state`. - * or update permissions on the directory: `sudo chmod 777 ~/.openhands-state` +* Check if the `~/.openhands` is owned by `root`. If so, you can: + * Change the directory's ownership: `sudo chown : ~/.openhands`. + * or update permissions on the directory: `sudo chmod 777 ~/.openhands` * or delete it if you don’t need previous data. OpenHands will recreate it. You'll need to re-enter LLM settings. * If mounting a local directory, ensure your `WORKSPACE_BASE` has the necessary permissions for the user running OpenHands. @@ -56,13 +56,16 @@ To fix this: -e SANDBOX_VSCODE_PORT=41234 \ -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:latest \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v ~/.openhands-state:/.openhands-state \ + -v ~/.openhands:/.openhands \ -p 3000:3000 \ -p 41234:41234 \ --add-host host.docker.internal:host-gateway \ --name openhands-app \ docker.all-hands.dev/all-hands-ai/openhands:latest ``` + + > **Note**: If you used OpenHands before version 0.44, you may want to run `mv ~/.openhands-state ~/.openhands` to migrate your conversation history to the new location. + 2. Make sure to expose the same port with `-p 41234:41234` in your Docker command. 3. If running with the development workflow, you can set this in your `config.toml` file: ```toml diff --git a/openhands/runtime/impl/daytona/README.md b/openhands/runtime/impl/daytona/README.md index f37dce64ea..926c343982 100644 --- a/openhands/runtime/impl/daytona/README.md +++ b/openhands/runtime/impl/daytona/README.md @@ -89,12 +89,14 @@ docker run -it --rm --pull=always \ -e LOG_ALL_EVENTS=true \ -e RUNTIME=daytona \ -e DAYTONA_API_KEY=${DAYTONA_API_KEY} \ - -v ~/.openhands-state:/.openhands-state \ + -v ~/.openhands:/.openhands \ -p 3000:3000 \ --name openhands-app \ docker.all-hands.dev/all-hands-ai/openhands:${OPENHANDS_VERSION} ``` +> **Note**: If you used OpenHands before version 0.44, you may want to run `mv ~/.openhands-state ~/.openhands` to migrate your conversation history to the new location. + #### Windows: ```powershell docker run -it --rm --pull=always ` @@ -102,12 +104,14 @@ docker run -it --rm --pull=always ` -e LOG_ALL_EVENTS=true ` -e RUNTIME=daytona ` -e DAYTONA_API_KEY=${env:DAYTONA_API_KEY} ` - -v ~/.openhands-state:/.openhands-state ` + -v ~/.openhands:/.openhands ` -p 3000:3000 ` --name openhands-app ` docker.all-hands.dev/all-hands-ai/openhands:${env:OPENHANDS_VERSION} ``` +> **Note**: If you used OpenHands before version 0.44, you may want to run `mv ~/.openhands-state ~/.openhands` to migrate your conversation history to the new location. + > **Tip:** If you don't want your sandboxes to default to the EU region, you can set the `DAYTONA_TARGET` environment variable to `us` ### Running OpenHands Locally Without Docker