Skip to content

Commit ff234be

Browse files
committed
Merge branch 'main' into kevin
2 parents 91c1b85 + 3d68711 commit ff234be

61 files changed

Lines changed: 1502 additions & 479 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/openhands-resolver.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
(github.event.review.author_association == 'OWNER' || github.event.review.author_association == 'COLLABORATOR' || github.event.review.author_association == 'MEMBER')
8484
)
8585
)
86-
runs-on: "${{ inputs.runner }}"
86+
runs-on: "${{ inputs.runner || 'ubuntu-latest' }}"
8787
steps:
8888
- name: Checkout repository
8989
uses: actions/checkout@v4
@@ -92,6 +92,9 @@ jobs:
9292
uses: actions/setup-python@v5
9393
with:
9494
python-version: "3.12"
95+
- name: Upgrade pip
96+
run: |
97+
python -m pip install --upgrade pip
9598
9699
- name: Get latest versions and create requirements.txt
97100
run: |
@@ -229,11 +232,11 @@ jobs:
229232
// Perform package installation
230233
if (isExperimentalLabel || isIssueCommentExperimental || isReviewCommentExperimental) {
231234
console.log("Installing experimental OpenHands...");
232-
await exec.exec("python -m pip install --upgrade pip");
235+
233236
await exec.exec("pip install git+https://github.com/all-hands-ai/openhands.git");
234237
} else {
235238
console.log("Installing from requirements.txt...");
236-
await exec.exec("python -m pip install --upgrade pip");
239+
237240
await exec.exec("pip install -r /tmp/requirements.txt");
238241
}
239242

config.template.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ enable_history_truncation = true
258258
# useful when an agent doesn't demand high quality but uses a lot of tokens
259259
llm_config = 'gpt3'
260260

261+
[agent.CustomAgent]
262+
# Example: use a custom agent from a different package
263+
# This will be automatically be registered as a new agent named "CustomAgent"
264+
classpath = "my_package.my_module.MyCustomAgent"
265+
261266
#################################### Sandbox ###################################
262267
# Configuration for the sandbox
263268
##############################################################################

docs/README.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,32 @@ This website is built using [Docusaurus](https://docusaurus.io/).
44

55
When published, the content will be published at https://docs.all-hands.dev/.
66

7-
### Installation
7+
### Local Development
88

99
```bash
1010
$ cd docs
11-
$ yarn
11+
$ npm install
12+
$ npm run start
1213
```
1314

14-
### Local Development
15-
16-
```
17-
$ yarn start # for the default English version
18-
```
19-
20-
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
15+
This command starts a local development server and opens up a browser window.
16+
Most changes are reflected live without having to restart the server.
2117

2218
Alternatively, you can pass a `--locale` argument to render a specific language in dev mode as in:
2319

2420
```
25-
$ yarn start --locale pt-BR # for the Brazilian Portuguese version
26-
$ yarn start --locale fr # for the French version
27-
$ yarn start --locale zh-Hans # for the Chinese Han (simplified variant) version
21+
$ npm run start --locale pt-BR # for the Brazilian Portuguese version
22+
$ npm run start --locale fr # for the French version
23+
$ npm run start --locale zh-Hans # for the Chinese Han (simplified variant) version
2824
```
2925

3026
### Build
3127

3228
```
33-
$ yarn build
29+
$ npm run build
3430
```
3531

3632
This command generates static content into the `build` directory and can be served using any static contents hosting service.
37-
3833
It compiles all languages.
3934

4035
### Deployment

docs/modules/usage/cloud/_category_.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/modules/usage/cloud/cloud-api.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# OpenHands Cloud API
22

3-
OpenHands Cloud provides a REST API that allows you to programmatically interact with the service. This is useful if you easily want to kick off your own jobs from your programs in a flexible way.
3+
OpenHands Cloud provides a REST API that allows you to programmatically interact with the service. This is useful if
4+
you want to kick off your own jobs from your programs in a flexible way.
45

56
This guide explains how to obtain an API key and use the API to start conversations.
67
For more detailed information about the API, refer to the [OpenHands API Reference](https://docs.all-hands.dev/swagger-ui/).
@@ -9,27 +10,27 @@ For more detailed information about the API, refer to the [OpenHands API Referen
910

1011
To use the OpenHands Cloud API, you'll need to generate an API key:
1112

12-
1. Log in to your [OpenHands Cloud](https://app.all-hands.dev) account
13-
2. Navigate to the [Settings page](https://app.all-hands.dev/settings)
14-
3. Locate the "API Keys" section
15-
4. Click "Generate New Key"
16-
5. Give your key a descriptive name (e.g., "Development", "Production")
17-
6. Copy the generated API key and store it securely - it will only be shown once
13+
1. Log in to your [OpenHands Cloud](https://app.all-hands.dev) account.
14+
2. Navigate to the [Settings page](https://app.all-hands.dev/settings).
15+
3. Select the `API Keys` tab.
16+
4. Click `Create API Key`.
17+
5. Give your key a descriptive name (Example: "Development" or "Production") and select `Create`.
18+
6. Copy the generated API key and store it securely. It will only be shown once.
1819

1920
![API Key Generation](/img/docs/api-key-generation.png)
2021

2122
## API Usage
2223

2324
### Starting a New Conversation
2425

25-
To start a new conversation with OpenHands performing a task, you'll need to make a POST request to the conversation endpoint.
26+
To start a new conversation with OpenHands to perform a task, you'll need to make a POST request to the conversation endpoint.
2627

2728
#### Request Parameters
2829

29-
| Parameter | Type | Required | Description |
30-
|-----------|------|----------|-------------|
31-
| `initial_user_msg` | string | Yes | The initial message to start the conversation |
32-
| `repository` | string | No | Git repository name to provide context in the format `owner/repo`. You must have access to the repo. |
30+
| Parameter | Type | Required | Description |
31+
|--------------------|----------|----------|------------------------------------------------------------------------------------------------------|
32+
| `initial_user_msg` | string | Yes | The initial message to start the conversation. |
33+
| `repository` | string | No | Git repository name to provide context in the format `owner/repo`. You must have access to the repo. |
3334

3435
#### Examples
3536

@@ -126,11 +127,11 @@ The API will return a JSON object with details about the created conversation:
126127
}
127128
```
128129

129-
You may also receive an `AuthenticationError` if:
130+
You may receive an `AuthenticationError` if:
130131

131-
1. You provided an invalid API key
132-
2. You provided the wrong repo name
133-
3. You don't have access to the repo
132+
- You provided an invalid API key.
133+
- You provided the wrong repository name.
134+
- You don't have access to the repository.
134135

135136

136137
### Retrieving Conversation Status

docs/modules/usage/cloud/openhands-cloud.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ When using your GitLab account, OpenHands will automatically have access to your
6060

6161
## Conversation Persistence
6262

63-
- Conversations List – Displays only the 10 most recent conversations initiated within the past 10 days.
63+
- Conversations List – Displays only the 20 most recent conversations initiated within the past 10 days.
6464
- Workspaces – Conversation workspaces are retained for 14 days.
6565
- Runtimes – Runtimes remain active ("warm") for 30 minutes. After this period, resuming a conversation may take 1–2 minutes.
Lines changed: 74 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,37 @@
11
# CLI Mode
22

3-
OpenHands can be run in an interactive CLI mode, which allows users to start an interactive session via the command line.
3+
CLI mode provides a powerful interactive Command-Line Interface (CLI) that lets you engage with OpenHands directly
4+
from your terminal.
45

56
This mode is different from the [headless mode](headless-mode), which is non-interactive and better for scripting.
67

7-
## With Python
8+
## Getting Started
89

9-
To start an interactive OpenHands session via the command line:
10+
### Running with Python
1011

1112
1. Ensure you have followed the [Development setup instructions](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md).
12-
2. Run the following command:
13+
2. Set your model, API key, and other preferences using environment variables or with the [`config.toml`](https://github.com/All-Hands-AI/OpenHands/blob/main/config.template.toml) file.
14+
3. Launch an interactive OpenHands conversation from the command line:
1315

1416
```bash
15-
poetry run python -m openhands.core.cli
17+
poetry run python -m openhands.cli.main
1618
```
1719

1820
Example:
1921
```bash
20-
poetry run python -m openhands.core.cli -t "Print 'Hello, World'" --no-auto-continue
22+
poetry run python -m openhands.cli.main -t "Print 'Hello, World'" --no-auto-continue
2123
```
2224

23-
This command will start an interactive session where you can input tasks and receive responses from OpenHands.
24-
25-
You'll need to be sure to set your model, API key, and other settings via environment variables
26-
[or the `config.toml` file](https://github.com/All-Hands-AI/OpenHands/blob/main/config.template.toml).
27-
28-
## With Docker
25+
This command opens an interactive prompt where you can type tasks or commands and get responses from OpenHands.
2926

30-
To run OpenHands in CLI mode with Docker:
27+
### Running with Docker
3128

32-
1. Set the following environmental variables in your terminal:
29+
1. Set the following environment variables in your terminal:
30+
- `SANDBOX_VOLUMES` to specify the directory you want OpenHands to access ([See using SANDBOX_VOLUMES for more info](../runtimes/docker#using-sandbox_volumes))
31+
- `LLM_MODEL` - the LLM model to use (e.g. `export LLM_MODEL="anthropic/claude-3-7-sonnet-20250219"`)
32+
- `LLM_API_KEY` - your API key (e.g. `export LLM_API_KEY="sk_test_12345"`)
3333

34-
- `SANDBOX_VOLUMES` to specify the directory you want OpenHands to access (Ex: `export SANDBOX_VOLUMES=$(pwd)/workspace:/workspace:rw`).
35-
- The agent works in `/workspace` by default, so mount your project directory there if you want the agent to modify files.
36-
- For read-only data, use a different mount path (Ex: `export SANDBOX_VOLUMES=$(pwd)/workspace:/workspace:rw,/path/to/large/dataset:/data:ro`).
37-
- `LLM_MODEL` to the model to use (Ex: `export LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"`).
38-
- `LLM_API_KEY` to the API key (Ex: `export LLM_API_KEY="sk_test_12345"`).
39-
40-
2. Run the following Docker command:
34+
2. Run the following command:
4135

4236
```bash
4337
docker run -it \
@@ -52,10 +46,65 @@ docker run -it \
5246
--add-host host.docker.internal:host-gateway \
5347
--name openhands-app-$(date +%Y%m%d%H%M%S) \
5448
docker.all-hands.dev/all-hands-ai/openhands:0.37 \
55-
python -m openhands.core.cli
49+
python -m openhands.cli.main
5650
```
5751

58-
This command will start an interactive session in Docker where you can input tasks and receive responses from OpenHands.
52+
This launches the CLI in Docker, allowing you to interact with OpenHands as described above.
53+
54+
The `-e SANDBOX_USER_ID=$(id -u)` ensures files created by the agent in your workspace have the correct permissions.
55+
56+
## Interactive CLI Overview
57+
58+
### What is CLI Mode?
59+
60+
CLI mode enables real-time interaction with OpenHands agents. You can type natural language tasks, use interactive
61+
commands, and receive instant feedback—all inside your terminal.
62+
63+
### Starting a Conversation
64+
65+
When you start the CLI, you'll see a welcome message and a prompt (`>`). Enter your first task or type a command to
66+
begin your conversation.
67+
68+
### Available Commands
69+
70+
You can use the following commands whenever the prompt (`>`) is displayed:
71+
72+
| Command | Description |
73+
|--------------|----------------------------------------------------------------|
74+
| `/help` | Show all available interactive commands and their descriptions |
75+
| `/exit` | Exit the application |
76+
| `/init` | Initialize a new repository for agent exploration |
77+
| `/status` | Show conversation details and usage metrics |
78+
| `/new` | Start a new conversation |
79+
| `/settings` | View and modify current LLM/agent settings |
80+
| `/resume` | Resume the agent if paused |
81+
82+
#### Settings and Configuration
83+
84+
You can update your model, API key, agent, and other preferences interactively using the `/settings` command. Just
85+
follow the prompts:
86+
87+
- **Basic settings**: Choose a model/provider and enter your API key.
88+
- **Advanced settings**: Set custom endpoints, enable or disable confirmation mode, and configure memory condensation.
89+
90+
Settings can also be managed via the `config.toml` file.
91+
92+
#### Repository Initialization
93+
94+
The `/init` command helps the agent understand your project by creating a `.openhands/microagents/repo.md` file with
95+
project details and structure. Use this when onboarding the agent to a new codebase.
96+
97+
#### Agent Pause/Resume Feature
98+
99+
You can pause the agent while it is running by pressing `Ctrl-P`. To continue the conversation after pausing, simply
100+
type `/resume` at the prompt.
101+
102+
## Tips and Troubleshooting
103+
104+
- Use `/help` at any time to see the list of available commands.
105+
- If you encounter permission issues, make sure your workspace directory is trusted and all required environment variables are set correctly.
106+
- For advanced LLM configuration, use the advanced options in `/settings`.
107+
- When confirmation mode is enabled, the CLI will prompt before sensitive operations. You can type `a` or `always` at the first confirmation prompt to automatically confirm subsequent actions for the current conversation.
108+
- If you want to start over, use `/new` to begin a fresh conversation without restarting the CLI.
59109

60-
The `-e SANDBOX_USER_ID=$(id -u)` is passed to the Docker command to ensure the sandbox user matches the host user’s
61-
permissions. This prevents the agent from creating root-owned files in the mounted workspace.
110+
---

docs/modules/usage/how-to/gui-mode.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ OpenHands automatically exports a `GITHUB_TOKEN` to the shell environment if pro
3939
- Minimal Permissions ( Select `Meta Data = Read-only` read for search, `Pull Requests = Read and Write` and `Content = Read and Write` for branch creation)
4040
2. **Enter Token in OpenHands**:
4141
- Click the Settings button (gear icon).
42+
- Navigate to the `Git` tab.
4243
- Paste your token in the `GitHub Token` field.
43-
- Click `Save` to apply the changes.
44+
- Click `Save Changes` to apply the changes.
4445
</details>
4546

4647
<details>
@@ -98,9 +99,9 @@ OpenHands automatically exports a `GITLAB_TOKEN` to the shell environment if pro
9899
- Set an expiration date or leave it blank for a non-expiring token.
99100
2. **Enter Token in OpenHands**:
100101
- Click the Settings button (gear icon).
102+
- Navigate to the `Git` tab.
101103
- Paste your token in the `GitLab Token` field.
102-
- Enter your GitLab instance URL if using self-hosted GitLab.
103-
- Click `Save` to apply the changes.
104+
- Click `Save Changes` to apply the changes.
104105
</details>
105106

106107
<details>
@@ -112,7 +113,6 @@ OpenHands automatically exports a `GITLAB_TOKEN` to the shell environment if pro
112113
- Ensure the token is properly saved in settings.
113114
- Check that the token hasn't expired.
114115
- Verify the token has the required scopes.
115-
- For self-hosted instances, verify the correct instance URL.
116116

117117
- **Access Denied**:
118118
- Verify project access permissions.
@@ -122,7 +122,7 @@ OpenHands automatically exports a `GITLAB_TOKEN` to the shell environment if pro
122122

123123
### Advanced Settings
124124

125-
1. Inside the Settings page, toggle `Advanced` options to access additional settings.
125+
1. Inside the Settings page, under the `LLM` tab, toggle `Advanced` options to access additional settings.
126126
2. Use the `Custom Model` text box to manually enter a model if it's not in the list.
127127
3. Specify a `Base URL` if required by your LLM provider.
128128

docs/modules/usage/how-to/headless-mode.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@ You'll need to be sure to set your model, API key, and other settings via enviro
2121

2222
To run OpenHands in Headless mode with Docker:
2323

24-
1. Set the following environmental variables in your terminal:
25-
26-
- `SANDBOX_VOLUMES` to specify the directory you want OpenHands to access (Ex: `export SANDBOX_VOLUMES=$(pwd)/workspace:/workspace:rw`).
27-
- The agent works in `/workspace` by default, so mount your project directory there if you want the agent to modify files.
28-
- For read-only data, use a different mount path (Ex: `export SANDBOX_VOLUMES=$(pwd)/workspace:/workspace:rw,/path/to/large/dataset:/data:ro`).
29-
- `LLM_MODEL` to the model to use (Ex: `export LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"`).
30-
- `LLM_API_KEY` to the API key (Ex: `export LLM_API_KEY="sk_test_12345"`).
24+
1. Set the following environment variables in your terminal:
25+
- `SANDBOX_VOLUMES` to specify the directory you want OpenHands to access ([See using SANDBOX_VOLUMES for more info](../runtimes/docker#using-sandbox_volumes))
26+
- `LLM_MODEL` - the LLM model to use (e.g. `export LLM_MODEL="anthropic/claude-3-7-sonnet-20250219"`)
27+
- `LLM_API_KEY` - your API key (e.g. `export LLM_API_KEY="sk_test_12345"`)
3128

3229
2. Run the following Docker command:
3330

docs/modules/usage/installation.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ After launching OpenHands, you **must** select an `LLM Provider` and `LLM Model`
8484
This can be done during the initial settings popup or by selecting the `Settings`
8585
button (gear icon) in the UI.
8686

87-
If the required model does not exist in the list, you can toggle `Advanced` options and manually enter it with the correct prefix
88-
in the `Custom Model` text box.
87+
If the required model does not exist in the list, in `Settings` under the `LLM` tab, you can toggle `Advanced` options
88+
and manually enter it with the correct prefix in the `Custom Model` text box.
8989
The `Advanced` options also allow you to specify a `Base URL` if required.
9090

9191
### Getting an API Key

0 commit comments

Comments
 (0)