Skip to content

Commit 8bc8f52

Browse files
committed
Merge branch 'main' into kevin
2 parents d0d65a2 + 8b90d61 commit 8bc8f52

12 files changed

Lines changed: 119 additions & 77 deletions

docs/docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@
104104
]
105105
},
106106
{
107-
"group": "Customization",
107+
"group": "Customizations & Settings",
108108
"pages": [
109+
"usage/common-settings",
109110
"usage/prompting/repository",
110111
{
111112
"group": "Microagents",

docs/usage/cloud/cloud-ui.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Cloud UI
3-
description: The Cloud UI provides a web interface for interacting with OpenHands. This page explains how to use the
4-
OpenHands Cloud UI.
3+
description: The Cloud UI provides a web interface for interacting with OpenHands. This page provides references on
4+
how to use the OpenHands Cloud UI.
55
---
66

77
## Landing Page
@@ -22,8 +22,9 @@ The Settings page allows you to:
2222
- [Install the OpenHands Slack app](/usage/cloud/slack-installation).
2323
- Set application settings like your preferred language, notifications and other preferences.
2424
- Add credits to your account.
25-
- Generate custom secrets.
26-
- Create API keys to work with OpenHands programmatically.
25+
- [Generate custom secrets](/usage/common-settings#secrets-management).
26+
- [Create API keys to work with OpenHands programmatically](/usage/cloud/cloud-api).
27+
- Change your email address.
2728

2829
## Key Features
2930

docs/usage/cloud/slack-installation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ description: This guide walks you through installing the OpenHands Slack app.
2525

2626
**Make sure your Slack workspace admin/owner has installed OpenHands Slack App first.**
2727

28-
Every user in the Slack workspace (including admins/owners) must link their Cloud OpenHands account to the OpenHands Slack App. To do this:
28+
Every user in the Slack workspace (including admins/owners) must link their OpenHands Cloud account to the OpenHands Slack App. To do this:
2929
1. Visit [integrations settings](https://app.all-hands.dev/settings/integrations) in OpenHands Cloud.
3030
2. Click `Install OpenHands Slack App`.
3131
3. In the top right corner, select the workspace to install the OpenHands Slack app.

docs/usage/common-settings.mdx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: OpenHands Settings
3+
description: Overview of some of the settings available in OpenHands.
4+
---
5+
6+
## Openhands Cloud vs Running on Your Own
7+
8+
There are some differences between the settings available in OpenHands Cloud and those available when running OpenHands
9+
on your own:
10+
* [OpenHands Cloud settings](/usage/cloud/cloud-ui#settings)
11+
* [Settings available when running on your own](/usage/how-to/gui-mode#settings)
12+
13+
Refer to these pages for more detailed information.
14+
15+
## Secrets Management
16+
17+
OpenHands provides a secrets manager that allows you to securely store and manage sensitive information that can be
18+
accessed by the agent during runtime, such as API keys. These secrets are automatically exported as environment
19+
variables in the agent's runtime environment.
20+
21+
### Accessing the Secrets Manager
22+
23+
In the Settings page, navigate to the `Secrets` tab. Here, you'll see a list of all your existing custom secrets.
24+
25+
### Adding a New Secret
26+
1. Click `Add a new secret`.
27+
2. Fill in the following fields:
28+
- **Name**: A unique identifier for your secret (e.g., `AWS_ACCESS_KEY`). This will be the environment variable name.
29+
- **Value**: The sensitive information you want to store.
30+
- **Description** (optional): A brief description of what the secret is used for, which is also provided to the agent.
31+
3. Click `Add secret` to save.
32+
33+
### Editing a Secret
34+
35+
1. Click the `Edit` button next to the secret you want to modify.
36+
2. You can update the name and description of the secret.
37+
<Note>
38+
For security reasons, you cannot view or edit the value of an existing secret. If you need to change the
39+
value, delete the secret and create a new one.
40+
</Note>
41+
42+
### Deleting a Secret
43+
44+
1. Click the `Delete` button next to the secret you want to remove.
45+
2. Select `Confirm` to delete the secret.
46+
47+
### Using Secrets in the Agent
48+
- All custom secrets are automatically exported as environment variables in the agent's runtime environment.
49+
- You can access them in your code using standard environment variable access methods
50+
(e.g., `os.environ['SECRET_NAME']` in Python).
51+
- Example: If you create a secret named `OPENAI_API_KEY`, you can access it in your code as
52+
`process.env.OPENAI_API_KEY` in JavaScript or `os.environ['OPENAI_API_KEY']` in Python.

docs/usage/getting-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Start Building
3-
description: So you've [run OpenHands](./installation) and have [set up your LLM](./installation#setup). Now what?
3+
description: So you've [run OpenHands](/usage/installation). Now what?
44
icon: code
55
---
66

docs/usage/how-to/gui-mode.mdx

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ You can use the Settings page at any time to:
2525
- Setup the LLM provider and model for OpenHands.
2626
- [Setup the search engine](/usage/search-engine-setup).
2727
- [Configure MCP servers](/usage/mcp).
28-
- [Connect to GitHub](/usage/how-to/gui-mode#github-setup) and [connect to GitLab](/usage/how-to/gui-mode#gitlab-setup)
28+
- [Connect to GitHub](/usage/how-to/gui-mode#github-setup) and [connect to GitLab](/usage/how-to/gui-mode#gitlab-setup).
2929
- Set application settings like your preferred language, notifications and other preferences.
30-
- [Manage custom secrets](/usage/how-to/gui-mode#secrets-management).
30+
- [Manage custom secrets](/usage/common-settings#secrets-management).
3131

3232
#### GitHub Setup
3333

@@ -157,37 +157,6 @@ OpenHands automatically exports a `GITLAB_TOKEN` to the shell environment if pro
157157

158158
</AccordionGroup>
159159

160-
161-
#### Secrets Management
162-
163-
OpenHands provides a secrets manager that allows you to securely store and manage sensitive information that can be accessed by the agent during runtime, such as API keys. These secrets are automatically exported as environment variables in the agent's runtime environment.
164-
165-
1. **Accessing the Secrets Manager**:
166-
- In the Settings page, navigate to the `Secrets` tab.
167-
- You'll see a list of all your existing custom secrets (if any).
168-
169-
2. **Adding a New Secret**:
170-
- Click the `Add New Secret` button.
171-
- Fill in the following fields:
172-
- **Name**: A unique identifier for your secret (e.g., `AWS_ACCESS_KEY`). This will be the environment variable name.
173-
- **Value**: The sensitive information you want to store.
174-
- **Description** (optional): A brief description of what the secret is used for, which is also provided to the agent.
175-
- Click `Add Secret` to save.
176-
177-
3. **Editing a Secret**:
178-
- Click the `Edit` button next to the secret you want to modify.
179-
- You can update the name and description of the secret.
180-
- Note: For security reasons, you cannot view or edit the value of an existing secret. If you need to change the value, delete the secret and create a new one.
181-
182-
4. **Deleting a Secret**:
183-
- Click the `Delete` button next to the secret you want to remove.
184-
- Confirm the deletion when prompted.
185-
186-
5. **Using Secrets in the Agent**:
187-
- All custom secrets are automatically exported as environment variables in the agent's runtime environment.
188-
- You can access them in your code using standard environment variable access methods (e.g., `os.environ['SECRET_NAME']` in Python).
189-
- Example: If you create a secret named `OPENAI_API_KEY`, you can access it in your code as `process.env.OPENAI_API_KEY` in JavaScript or `os.environ['OPENAI_API_KEY']` in Python.
190-
191160
#### Advanced Settings
192161

193162
The `Advanced` settings allows configuration of additional LLM settings. Inside the Settings page, under the `LLM` tab,
@@ -208,11 +177,11 @@ section of the documentation.
208177
The status indicator located in the bottom left of the screen will cycle through a number of states as a new conversation
209178
is loaded. Typically these include:
210179

211-
* `Disconnected` : The frontend is not connected to any conversation
180+
* `Disconnected` : The frontend is not connected to any conversation.
212181
* `Connecting` : The frontend is connecting a websocket to a conversation.
213182
* `Building Runtime...` : The server is building a runtime. This is typically in development mode only while building a docker image.
214183
* `Starting Runtime...` : The server is starting a new runtime instance - probably a new docker container or remote runtime.
215-
* `Initializing Agent...` : The server is starting the agent loop. (This step does not appear at present with Nested runtimes)
184+
* `Initializing Agent...` : The server is starting the agent loop (This step does not appear at present with Nested runtimes).
216185
* `Setting up workspace...` : Usually this means a `git clone ...` operation.
217186
* `Setting up git hooks` : Setting up the git pre commit hooks for the workspace.
218187
* `Agent is awaiting user input...` : Ready to go!

docs/usage/installation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Quick Start
3-
description: Running OpenHands Cloud or running on your local system.
3+
description: Running OpenHands Cloud or running on your own.
44
icon: rocket
55
---
66

openhands/cli/settings.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,23 +264,28 @@ def provider_validator(x):
264264
if change_model:
265265
model_completer = FuzzyWordCompleter(provider_models)
266266

267-
# Define a validator function that prints an error message
267+
# Define a validator function that allows custom models but shows a warning
268268
def model_validator(x):
269-
is_valid = x in provider_models
270-
if not is_valid:
269+
# Allow any non-empty model name
270+
if not x.strip():
271+
return False
272+
273+
# Show a warning for models not in the predefined list, but still allow them
274+
if x not in provider_models:
271275
print_formatted_text(
272276
HTML(
273-
f'<grey>Invalid model selected for provider {provider}: {x}</grey>'
277+
f'<yellow>Warning: {x} is not in the predefined list for provider {provider}. '
278+
f'Make sure this model name is correct.</yellow>'
274279
)
275280
)
276-
return is_valid
281+
return True
277282

278283
model = await get_validated_input(
279284
session,
280285
'(Step 2/3) Select LLM Model (TAB for options, CTRL-c to cancel): ',
281286
completer=model_completer,
282287
validator=model_validator,
283-
error_message=f'Invalid model selected for provider {provider}',
288+
error_message='Model name cannot be empty',
284289
)
285290
else:
286291
# Use the default model

openhands/server/conversation_manager/conversation_manager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ async def maybe_start_agent_loop(
107107
async def send_to_event_stream(self, connection_id: str, data: dict):
108108
"""Send data to an event stream."""
109109

110+
@abstractmethod
111+
async def send_event_to_conversation(self, sid: str, data: dict):
112+
"""Send an event to a conversation."""
113+
110114
@abstractmethod
111115
async def disconnect_from_session(self, connection_id: str):
112116
"""Disconnect from a session."""

openhands/server/conversation_manager/docker_nested_conversation_manager.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,18 @@ async def send_to_event_stream(self, connection_id: str, data: dict):
275275
# Not supported - clients should connect directly to the nested server!
276276
raise ValueError('unsupported_operation')
277277

278+
async def send_event_to_conversation(self, sid, data):
279+
async with httpx.AsyncClient(
280+
headers={
281+
'X-Session-API-Key': self._get_session_api_key_for_conversation(sid)
282+
}
283+
) as client:
284+
nested_url = self._get_nested_url(sid)
285+
response = await client.post(
286+
f'{nested_url}/api/conversations/{sid}/events', json=data
287+
)
288+
response.raise_for_status()
289+
278290
async def disconnect_from_session(self, connection_id: str):
279291
# Not supported - clients should connect directly to the nested server!
280292
raise ValueError('unsupported_operation')

0 commit comments

Comments
 (0)