Skip to content

Commit 624799f

Browse files
authored
Merge branch 'main' into env_runtime_startup_env_vars
2 parents 4630166 + 6c88b10 commit 624799f

36 files changed

+573
-212
lines changed

Diff for: .github/workflows/openhands-resolver.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ jobs:
177177
echo "SANDBOX_ENV_BASE_CONTAINER_IMAGE=${{ inputs.base_container_image }}" >> $GITHUB_ENV
178178
179179
# Set branch variables
180-
echo "TARGET_BRANCH=${{ inputs.target_branch }}" >> $GITHUB_ENV
180+
echo "TARGET_BRANCH=${{ inputs.target_branch || 'main' }}" >> $GITHUB_ENV
181181
182182
- name: Comment on issue with start message
183183
uses: actions/github-script@v7
@@ -277,6 +277,7 @@ jobs:
277277
if [ "${{ steps.check_result.outputs.RESOLUTION_SUCCESS }}" == "true" ]; then
278278
cd /tmp && python -m openhands.resolver.send_pull_request \
279279
--issue-number ${{ env.ISSUE_NUMBER }} \
280+
--target-branch ${{ env.TARGET_BRANCH }} \
280281
--pr-type draft \
281282
--reviewer ${{ github.actor }} | tee pr_result.txt && \
282283
grep "draft created" pr_result.txt | sed 's/.*\///g' > pr_number.txt

Diff for: .openhands/microagents/glossary.md

+172
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# OpenHands Glossary
2+
3+
### Agent
4+
The core AI entity in OpenHands that can perform software development tasks by interacting with tools, browsing the web, and modifying code.
5+
6+
#### Agent Controller
7+
A component that manages the agent's lifecycle, handles its state, and coordinates interactions between the agent and various tools.
8+
9+
#### Agent Delegation
10+
The ability of an agent to hand off specific tasks to other specialized agents for better task completion.
11+
12+
#### Agent Hub
13+
A central registry of different agent types and their capabilities, allowing for easy agent selection and instantiation.
14+
15+
#### Agent Skill
16+
A specific capability or function that an agent can perform, such as file manipulation, web browsing, or code editing.
17+
18+
#### Agent State
19+
The current context and status of an agent, including its memory, active tools, and ongoing tasks.
20+
21+
#### CodeAct Agent
22+
[A generalist agent in OpenHands](https://arxiv.org/abs/2407.16741) designed to perform tasks by editing and executing code.
23+
24+
### Browser
25+
A system for web-based interactions and tasks.
26+
27+
#### Browser Gym
28+
A testing and evaluation environment for browser-based agent interactions and tasks.
29+
30+
#### Web Browser Tool
31+
A tool that enables agents to interact with web pages and perform web-based tasks.
32+
33+
### Commands
34+
Terminal and execution related functionality.
35+
36+
#### Bash Session
37+
A persistent terminal session that maintains state and history for bash command execution.
38+
This uses tmux under the hood.
39+
40+
### Configuration
41+
System-wide settings and options.
42+
43+
#### Agent Configuration
44+
Settings that define an agent's behavior, capabilities, and limitations, including available tools and runtime settings.
45+
46+
#### Configuration Options
47+
Settings that control various aspects of OpenHands behavior, including runtime, security, and agent settings.
48+
49+
#### LLM Config
50+
Configuration settings for language models used by agents, including model selection and parameters.
51+
52+
#### LLM Draft Config
53+
Settings for draft mode operations with language models, typically used for faster, lower-quality responses.
54+
55+
#### Runtime Configuration
56+
Settings that define how the runtime environment should be set up and operated.
57+
58+
#### Security Options
59+
Configuration settings that control security features and restrictions.
60+
61+
### Conversation
62+
A sequence of interactions between a user and an agent, including messages, actions, and their results.
63+
64+
#### Conversation Info
65+
Metadata about a conversation, including its status, participants, and timeline.
66+
67+
#### Conversation Manager
68+
A component that handles the creation, storage, and retrieval of conversations.
69+
70+
#### Conversation Metadata
71+
Additional information about conversations, such as tags, timestamps, and related resources.
72+
73+
#### Conversation Status
74+
The current state of a conversation, including whether it's active, completed, or failed.
75+
76+
#### Conversation Store
77+
A storage system for maintaining conversation history and related data.
78+
79+
### Events
80+
81+
#### Event
82+
Every Conversation comprises a series of Events. Each Event is either an Action or an Observation.
83+
84+
#### Event Stream
85+
A continuous flow of events that represents the ongoing activities and interactions in the system.
86+
87+
#### Action
88+
A specific operation or command that an agent executes through available tools, such as running a command or editing a file.
89+
90+
#### Observation
91+
The response or result returned by a tool after an agent's action, providing feedback about the action's outcome.
92+
93+
### Interface
94+
Different ways to interact with OpenHands.
95+
96+
#### CLI Mode
97+
A command-line interface mode for interacting with OpenHands agents without a graphical interface.
98+
99+
#### GUI Mode
100+
A graphical user interface mode for interacting with OpenHands agents through a web interface.
101+
102+
#### Headless Mode
103+
A mode of operation where OpenHands runs without a user interface, suitable for automation and scripting.
104+
105+
### Agent Memory
106+
The system that decides which parts of the Event Stream (i.e. the conversation history) should be passed into each LLM prompt.
107+
108+
#### Memory Store
109+
A storage system for maintaining agent memory and context across sessions.
110+
111+
#### Condenser
112+
A component that processes and summarizes conversation history to maintain context while staying within token limits.
113+
114+
#### Truncation
115+
A very simple Condenser strategy. Reduces conversation history or content to stay within token limits.
116+
117+
### Microagent
118+
A specialized prompt that enhances OpenHands with domain-specific knowledge, repository-specific context, and task-specific workflows.
119+
120+
#### Microagent Registry
121+
A central repository of available microagents and their configurations.
122+
123+
#### Public Microagent
124+
A general-purpose microagent available to all OpenHands users, triggered by specific keywords.
125+
126+
#### Repository Microagent
127+
A type of microagent that provides repository-specific context and guidelines, stored in the `.openhands/microagents/` directory.
128+
129+
### Prompt
130+
Components for managing and processing prompts.
131+
132+
#### Prompt Caching
133+
A system for caching and reusing common prompts to improve performance.
134+
135+
#### Prompt Manager
136+
A component that handles the loading, processing, and management of prompts used by agents, including microagents.
137+
138+
#### Response Parsing
139+
The process of interpreting and structuring responses from language models and tools.
140+
141+
### Runtime
142+
The execution environment where agents perform their tasks, which can be local, remote, or containerized.
143+
144+
#### Action Execution Server
145+
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.
146+
147+
#### Action Execution Client
148+
A component that handles the execution of actions in the runtime environment, managing the communication between the agent and the runtime.
149+
150+
#### Docker Runtime
151+
A containerized runtime environment that provides isolation and reproducibility for agent operations.
152+
153+
#### E2B Runtime
154+
A specialized runtime environment built on E2B for secure and isolated code execution.
155+
156+
#### Local Runtime
157+
A runtime environment that executes on the local machine, suitable for development and testing.
158+
159+
#### Modal Runtime
160+
A runtime environment built on Modal for scalable and distributed agent operations.
161+
162+
#### Remote Runtime
163+
A sandboxed environment that executes code and commands remotely, providing isolation and security for agent operations.
164+
165+
#### Runtime Builder
166+
A component that builds a Docker image for the Action Execution Server based on a user-specified base image.
167+
168+
### Security
169+
Security-related components and features.
170+
171+
#### Security Analyzer
172+
A component that checks agent actions for potential security risks.

Diff for: dev_config/python/ruff.toml

+3
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ inline-quotes = "single"
2424

2525
[format]
2626
quote-style = "single"
27+
28+
[lint.flake8-bugbear]
29+
extend-immutable-calls = ["Depends", "fastapi.Depends", "fastapi.params.Depends"]

Diff for: docs/modules/usage/how-to/github-action.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ You can provide custom directions for OpenHands by following the [README for the
4242
Github resolver will automatically check for valid [repository secrets](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions?tool=webui#creating-secrets-for-a-repository) or [repository variables](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#creating-configuration-variables-for-a-repository) to customize its behavior.
4343
The customization options you can set are:
4444

45-
| **Attribute name** | **Type** | **Purpose** | **Example** |
46-
|----------------------------------| -------- |-------------------------------------------------------------------------------------------------------------|------------------------------------------------------|
47-
| `LLM_MODEL` | Variable | Set the LLM to use with OpenHands | `LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"` |
48-
| `OPENHANDS_MAX_ITER` | Variable | Set max limit for agent iterations | `OPENHANDS_MAX_ITER=10` |
49-
| `OPENHANDS_MACRO` | Variable | Customize default macro for invoking the resolver | `OPENHANDS_MACRO=@resolveit` |
50-
| `OPENHANDS_BASE_CONTAINER_IMAGE` | Variable | Custom Sandbox ([learn more](https://docs.all-hands.dev/modules/usage/how-to/custom-sandbox-guide)) | `OPENHANDS_BASE_CONTAINER_IMAGE="custom_image"` |
45+
| **Attribute name** | **Type** | **Purpose** | **Example** |
46+
| -------------------------------- | -------- | --------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
47+
| `LLM_MODEL` | Variable | Set the LLM to use with OpenHands | `LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"` |
48+
| `OPENHANDS_MAX_ITER` | Variable | Set max limit for agent iterations | `OPENHANDS_MAX_ITER=10` |
49+
| `OPENHANDS_MACRO` | Variable | Customize default macro for invoking the resolver | `OPENHANDS_MACRO=@resolveit` |
50+
| `OPENHANDS_BASE_CONTAINER_IMAGE` | Variable | Custom Sandbox ([learn more](https://docs.all-hands.dev/modules/usage/how-to/custom-sandbox-guide)) | `OPENHANDS_BASE_CONTAINER_IMAGE="custom_image"` |
51+
| `TARGET_BRANCH` | Variable | Merge to branch other than `main` | `TARGET_BRANCH="dev"` |

Diff for: frontend/__tests__/components/chat/chat-interface.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { afterEach, beforeAll, describe, expect, it, vi } from "vitest";
2+
import type { Message } from "#/message";
23
import { act, screen, waitFor, within } from "@testing-library/react";
34
import userEvent from "@testing-library/user-event";
45
import { renderWithProviders } from "test-utils";
+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import { render, screen } from "@testing-library/react";
2+
import { describe, it, expect } from "vitest";
3+
import { Messages } from "#/components/features/chat/messages";
4+
import type { Message } from "#/message";
5+
6+
describe("File Operations Messages", () => {
7+
it("should show success indicator for successful file read operation", () => {
8+
const messages: Message[] = [
9+
{
10+
type: "action",
11+
translationID: "read_file_contents",
12+
content: "Successfully read file contents",
13+
success: true,
14+
sender: "assistant",
15+
timestamp: new Date().toISOString(),
16+
},
17+
];
18+
19+
render(<Messages messages={messages} isAwaitingUserConfirmation={false} />);
20+
21+
const statusIcon = screen.getByTestId("status-icon");
22+
expect(statusIcon).toBeInTheDocument();
23+
expect(statusIcon.closest("svg")).toHaveClass("fill-success");
24+
});
25+
26+
it("should show failure indicator for failed file read operation", () => {
27+
const messages: Message[] = [
28+
{
29+
type: "action",
30+
translationID: "read_file_contents",
31+
content: "Failed to read file contents",
32+
success: false,
33+
sender: "assistant",
34+
timestamp: new Date().toISOString(),
35+
},
36+
];
37+
38+
render(<Messages messages={messages} isAwaitingUserConfirmation={false} />);
39+
40+
const statusIcon = screen.getByTestId("status-icon");
41+
expect(statusIcon).toBeInTheDocument();
42+
expect(statusIcon.closest("svg")).toHaveClass("fill-danger");
43+
});
44+
45+
it("should show success indicator for successful file edit operation", () => {
46+
const messages: Message[] = [
47+
{
48+
type: "action",
49+
translationID: "edit_file_contents",
50+
content: "Successfully edited file contents",
51+
success: true,
52+
sender: "assistant",
53+
timestamp: new Date().toISOString(),
54+
},
55+
];
56+
57+
render(<Messages messages={messages} isAwaitingUserConfirmation={false} />);
58+
59+
const statusIcon = screen.getByTestId("status-icon");
60+
expect(statusIcon).toBeInTheDocument();
61+
expect(statusIcon.closest("svg")).toHaveClass("fill-success");
62+
});
63+
64+
it("should show failure indicator for failed file edit operation", () => {
65+
const messages: Message[] = [
66+
{
67+
type: "action",
68+
translationID: "edit_file_contents",
69+
content: "Failed to edit file contents",
70+
success: false,
71+
sender: "assistant",
72+
timestamp: new Date().toISOString(),
73+
},
74+
];
75+
76+
render(<Messages messages={messages} isAwaitingUserConfirmation={false} />);
77+
78+
const statusIcon = screen.getByTestId("status-icon");
79+
expect(statusIcon).toBeInTheDocument();
80+
expect(statusIcon.closest("svg")).toHaveClass("fill-danger");
81+
});
82+
});

Diff for: frontend/__tests__/components/modals/settings/account-settings-modal.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ describe("AccountSettingsModal", () => {
132132
agent: "CodeActAgent",
133133
confirmation_mode: false,
134134
enable_default_condenser: false,
135+
github_token: undefined,
135136
language: "en",
136137
llm_base_url: "",
137138
llm_model: "anthropic/claude-3-5-sonnet-20241022",

0 commit comments

Comments
 (0)