Skip to content

Update release/stable-with-patches by rebasing onto upstream/main #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 27 commits into
base: release/stable-with-patches
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8f3ff12
chore(deps): bump the version-all group with 6 updates (#8009)
dependabot[bot] Apr 22, 2025
039fe29
Add RateLimitError and handle rate limiting in GitLab and GitHub serv…
malhotra5 Apr 22, 2025
b0a9938
Always run git init in SaaS mode regardless of workspace_base setting…
rbren Apr 22, 2025
89f8e16
Fix: Don't show status indicator for command timeouts (#8012)
rbren Apr 22, 2025
62557d4
Use short tool descriptions for o4-mini (#8022)
enyst Apr 22, 2025
693c72d
remove sse subsection accessor of McpConfig in action_execution_clien…
cshimmin Apr 22, 2025
5d749ae
replace erroneous rstrip() with removesuffix() (#8024)
cshimmin Apr 22, 2025
5de62d8
add an option for a headless backend (#8032)
rbren Apr 23, 2025
1fd26d1
Release 0.34.0 (#8011)
mamoodi Apr 23, 2025
fa559ac
Add API keys management UI to settings page (#7710)
rbren Apr 23, 2025
dc91cb2
Add extensive typing to controller directory (#7731)
neubig Apr 23, 2025
bfd75a1
(Chore): Rm legacy resolver code (#8001)
malhotra5 Apr 23, 2025
00c449d
Add loading indicator to repository dropdown on home page (#8015)
rbren Apr 23, 2025
964478c
[Feat]: Custom secrets plumbing for BE (#7891)
malhotra5 Apr 23, 2025
3c4ebc3
fix: Add error handling for scenarios where tmux is unavailable (#8043)
pandukamuditha Apr 23, 2025
78d8240
fix: use lower range of tcp port for file viewer (#8051)
xingyaoww Apr 24, 2025
356cd9f
(Hotfix): Issue comments on Cloud Resolver (#8053)
malhotra5 Apr 24, 2025
00865fb
fix: reconnect if stream closed (#8055)
SmartManoj Apr 24, 2025
db01cd3
hotfix: Run both BE and FE pre-commits with husky (#8059)
amanape Apr 24, 2025
91fff77
Fix lint (#8060)
enyst Apr 24, 2025
41afb1e
feat: Use effective token in resolver workflow steps (#7955)
openhands-agent Apr 22, 2025
87ca621
feat: Add WaitAction for pausing execution (#7725)
openhands-agent Apr 22, 2025
e205f7d
ci: Add workflows to build and push openhands/runtime images
openhands-agent Apr 22, 2025
c85c39f
ci(resolver): Install openhands from release branch
openhands-agent Apr 23, 2025
edc3070
ci(resolver): Include commit SHA in pip cache key
openhands-agent Apr 23, 2025
8ef374c
ci(resolver): Use openhands branch SHA for pip cache key
openhands-agent Apr 23, 2025
bbdefad
ci(resolver): Use openhands branch SHA for pip cache key (fixup)
openhands-agent Apr 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/build-openhands-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

name: Build OpenHands Image

on:
push:
branches:
- release/stable-with-patches

permissions:
contents: read
packages: write

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Poetry
run: pipx install poetry

- name: Install dependencies
run: poetry install --no-interaction --no-ansi


- name: Build and Push OpenHands Image
run: |
echo "Building openhands image with tag stable-with-patches and git sha tag..."
# Set DOCKER_IMAGE_TAG for build.sh to pick up
export DOCKER_IMAGE_TAG=stable-with-patches
# Set RELEVANT_SHA for build.sh to add git sha tag
export RELEVANT_SHA=${{ github.sha }}
./containers/build.sh -i openhands --push -o remind101
env:
# Pass GITHUB_TOKEN for potential git operations within build script if needed
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66 changes: 66 additions & 0 deletions .github/workflows/build-runtime-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@

name: Build Runtime Image

on:
push:
branches:
- release/stable-with-patches

permissions:
contents: read
packages: write

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Poetry
run: pipx install poetry

- name: Install dependencies
run: poetry install --no-interaction --no-ansi


- name: Prepare Runtime Build Context
run: poetry run python openhands/runtime/utils/runtime_build.py --build_folder ./containers/runtime
env:
# Ensure the script uses the correct base image if needed, although default should be fine
# OH_RUNTIME_BASE_IMAGE: nikolaik/python-nodejs:python3.12-nodejs22
# Ensure the script knows the target repo (though build.sh overrides org later)
OH_RUNTIME_RUNTIME_IMAGE_REPO: ghcr.io/remind101/runtime # This might not be strictly necessary as build.sh constructs the final path


- name: Free up disk space by removing tool cache
run: sudo rm -rf /opt/hostedtoolcache

- name: Build and Push Runtime Image
run: |
echo "Building runtime image with tag stable-with-patches and source tag..."
# Set DOCKER_IMAGE_TAG for build.sh to pick up
export DOCKER_IMAGE_TAG=stable-with-patches
# Override the image name defined in config.sh
export DOCKER_IMAGE=openhands-runtime
# Set RELEVANT_SHA for build.sh to add git sha tag (optional but good practice)
export RELEVANT_SHA=${{ github.sha }}
./containers/build.sh -i runtime --push -o remind101
env:
# Pass GITHUB_TOKEN for potential git operations within build script if needed
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81 changes: 62 additions & 19 deletions .github/workflows/openhands-resolver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ on:
required: false
LLM_API_KEY:
required: true
APP_ID:
required: false
APP_PRIVATE_KEY:
required: false
LLM_BASE_URL:
required: false
PAT_TOKEN:
Expand Down Expand Up @@ -89,15 +93,48 @@ jobs:
with:
python-version: "3.12"

- name: Get latest versions and create requirements.txt
run: |
python -m pip index versions openhands-ai > openhands_versions.txt
OPENHANDS_VERSION=$(head -n 1 openhands_versions.txt | awk '{print $2}' | tr -d '()')
- name: Generate GitHub App Token
id: generate-token
# Only run if App ID and Key are provided via secrets
if: secrets.APP_ID && secrets.APP_PRIVATE_KEY
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

# Create a new requirements.txt locally within the workflow, ensuring no reference to the repo's file
echo "openhands-ai==${OPENHANDS_VERSION}" > /tmp/requirements.txt
- name: Determine Auth Token
id: determine-auth-token
run: |
if [ -n "${{ steps.generate-token.outputs.token }}" ]; then
echo "Using GitHub App Token"
echo "AUTH_TOKEN=${{ steps.generate-token.outputs.token }}" >> $GITHUB_ENV
elif [ -n "${{ secrets.PAT_TOKEN }}" ]; then
echo "Using PAT Token"
echo "AUTH_TOKEN=${{ secrets.PAT_TOKEN }}" >> $GITHUB_ENV
else
echo "Using default GITHUB_TOKEN"
echo "AUTH_TOKEN=${{ github.token }}" >> $GITHUB_ENV
fi
- name: Create requirements.txt and get branch SHA
id: setup_reqs_and_sha
env:
# Use the determined auth token for git clone and ls-remote
GIT_TOKEN: ${{ env.AUTH_TOKEN }}
run: |
echo "Using openhands-ai from remind101/OpenHands@release/stable-with-patches"
# Create a new requirements.txt locally within the workflow
echo "git+https://${GIT_TOKEN}@github.com/remind101/OpenHands.git@release/stable-with-patches#egg=openhands-ai" > /tmp/requirements.txt
cat /tmp/requirements.txt

echo "Fetching latest commit SHA for release/stable-with-patches..."
SHA=$(git ls-remote https://${GIT_TOKEN}@github.com/remind101/OpenHands.git refs/heads/release/stable-with-patches | awk '{print $1}')
echo "Latest SHA: $SHA"
if [ -z "$SHA" ]; then
echo "Error: Could not retrieve SHA for release/stable-with-patches branch."
exit 1
fi
echo "OPENHANDS_BRANCH_SHA=$SHA" >> $GITHUB_ENV

- name: Cache pip dependencies
if: |
!(
Expand All @@ -114,9 +151,10 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}/lib/python3.12/site-packages/*
key: ${{ runner.os }}-pip-openhands-resolver-${{ hashFiles('/tmp/requirements.txt') }}
key: ${{ runner.os }}-pip-openhands-resolver-${{ env.OPENHANDS_BRANCH_SHA }}
restore-keys: |
${{ runner.os }}-pip-openhands-resolver-${{ hashFiles('/tmp/requirements.txt') }}
${{ runner.os }}-pip-openhands-resolver-${{ env.OPENHANDS_BRANCH_SHA }}
${{ runner.os }}-pip-openhands-resolver-

- name: Check required environment variables
env:
Expand All @@ -126,7 +164,7 @@ jobs:
LLM_API_VERSION: ${{ inputs.LLM_API_VERSION }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
PAT_USERNAME: ${{ secrets.PAT_USERNAME }}
GITHUB_TOKEN: ${{ github.token }}
APP_TOKEN_GENERATED: ${{ steps.generate-token.outputs.token && 'true' || 'false' }}
run: |
required_vars=("LLM_API_KEY")
for var in "${required_vars[@]}"; do
Expand All @@ -141,8 +179,13 @@ jobs:
echo "Warning: LLM_BASE_URL is not set, will use default API endpoint"
fi

if [ -z "$PAT_TOKEN" ]; then
echo "Warning: PAT_TOKEN is not set, falling back to GITHUB_TOKEN"
# Check auth token source
if [ "$APP_TOKEN_GENERATED" == "true" ]; then
echo "Info: Using GitHub App Token for authentication."
elif [ -n "$PAT_TOKEN" ]; then
echo "Info: Using PAT_TOKEN for authentication."
else
echo "Warning: Neither App Token nor PAT_TOKEN is set, falling back to default GITHUB_TOKEN. This may have insufficient permissions."
fi

if [ -z "$PAT_USERNAME" ]; then
Expand Down Expand Up @@ -178,16 +221,16 @@ jobs:
fi

echo "MAX_ITERATIONS=${{ inputs.max_iterations || 50 }}" >> $GITHUB_ENV
echo "SANDBOX_ENV_GITHUB_TOKEN=${{ secrets.PAT_TOKEN || github.token }}" >> $GITHUB_ENV
echo "SANDBOX_BASE_CONTAINER_IMAGE=${{ inputs.base_container_image }}" >> $GITHUB_ENV
echo "SANDBOX_ENV_GITHUB_TOKEN=${{ env.AUTH_TOKEN }}" >> $GITHUB_ENV
echo "SANDBOX_ENV_BASE_CONTAINER_IMAGE=${{ inputs.base_container_image }}" >> $GITHUB_ENV

# Set branch variables
echo "TARGET_BRANCH=${{ inputs.target_branch || 'main' }}" >> $GITHUB_ENV

- name: Comment on issue with start message
uses: actions/github-script@v7
with:
github-token: ${{ secrets.PAT_TOKEN || github.token }}
github-token: ${{ env.AUTH_TOKEN }}
script: |
const issueType = process.env.ISSUE_TYPE;
github.rest.issues.createComment({
Expand Down Expand Up @@ -235,7 +278,7 @@ jobs:

- name: Attempt to resolve issue
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN || github.token }}
GITHUB_TOKEN: ${{ env.AUTH_TOKEN }}
GITHUB_USERNAME: ${{ secrets.PAT_USERNAME || 'openhands-agent' }}
GIT_USERNAME: ${{ secrets.PAT_USERNAME || 'openhands-agent' }}
LLM_MODEL: ${{ secrets.LLM_MODEL || inputs.LLM_MODEL }}
Expand Down Expand Up @@ -272,7 +315,7 @@ jobs:
- name: Create draft PR or push branch
if: always() # Create PR or branch even if the previous steps fail
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN || github.token }}
GITHUB_TOKEN: ${{ env.AUTH_TOKEN }}
GITHUB_USERNAME: ${{ secrets.PAT_USERNAME || 'openhands-agent' }}
GIT_USERNAME: ${{ secrets.PAT_USERNAME || 'openhands-agent' }}
LLM_MODEL: ${{ secrets.LLM_MODEL || inputs.LLM_MODEL }}
Expand Down Expand Up @@ -304,7 +347,7 @@ jobs:
AGENT_RESPONDED: ${{ env.AGENT_RESPONDED || 'false' }}
ISSUE_NUMBER: ${{ env.ISSUE_NUMBER }}
with:
github-token: ${{ secrets.PAT_TOKEN || github.token }}
github-token: ${{ env.AUTH_TOKEN }}
script: |
const fs = require('fs');
const issueNumber = process.env.ISSUE_NUMBER;
Expand Down Expand Up @@ -341,7 +384,7 @@ jobs:
ISSUE_NUMBER: ${{ env.ISSUE_NUMBER }}
RESOLUTION_SUCCESS: ${{ steps.check_result.outputs.RESOLUTION_SUCCESS }}
with:
github-token: ${{ secrets.PAT_TOKEN || github.token }}
github-token: ${{ env.AUTH_TOKEN }}
script: |
const fs = require('fs');
const path = require('path');
Expand Down Expand Up @@ -414,7 +457,7 @@ jobs:
env:
ISSUE_NUMBER: ${{ env.ISSUE_NUMBER }}
with:
github-token: ${{ secrets.PAT_TOKEN || github.token }}
github-token: ${{ env.AUTH_TOKEN }}
script: |
const issueNumber = process.env.ISSUE_NUMBER;

Expand Down
2 changes: 1 addition & 1 deletion Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ poetry run pytest ./tests/unit/test_*.py
To reduce build time (e.g., if no changes were made to the client-runtime component), you can use an existing Docker container image by
setting the SANDBOX_RUNTIME_CONTAINER_IMAGE environment variable to the desired Docker image.

Example: `export SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.33-nikolaik`
Example: `export SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.34-nikolaik`

## Develop inside Docker container

Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ check-dependencies:
ifeq ($(INSTALL_DOCKER),)
@$(MAKE) -s check-docker
endif
@$(MAKE) -s check-tmux
@$(MAKE) -s check-poetry
@echo "$(GREEN)Dependencies checked successfully.$(RESET)"

Expand Down Expand Up @@ -101,6 +102,15 @@ check-docker:
exit 1; \
fi

check-tmux:
@echo "$(YELLOW)Checking tmux installation...$(RESET)"
@if command -v tmux > /dev/null; then \
echo "$(BLUE)$(shell tmux -V) is already installed.$(RESET)"; \
else \
echo "$(RED)tmux is not installed. Please install tmux to continue.$(RESET)"; \
exit 1; \
fi

check-poetry:
@echo "$(YELLOW)Checking Poetry installation...$(RESET)"
@if command -v poetry > /dev/null; then \
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ system requirements and more information.


```bash
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.33-nikolaik
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.34-nikolaik

docker run -it --rm --pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.33-nikolaik \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.34-nikolaik \
-e LOG_ALL_EVENTS=true \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ~/.openhands-state:/.openhands-state \
-p 3000:3000 \
--add-host host.docker.internal:host-gateway \
--name openhands-app \
docker.all-hands.dev/all-hands-ai/openhands:0.33
docker.all-hands.dev/all-hands-ai/openhands:0.34
```

You'll find OpenHands running at [http://localhost:3000](http://localhost:3000)!
Expand Down
27 changes: 25 additions & 2 deletions containers/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /app

COPY ./frontend/package.json frontend/package-lock.json ./
RUN npm install -g [email protected]
RUN npm ci
RUN npm ci --network-timeout 600000

COPY ./frontend ./
RUN npm run build
Expand Down Expand Up @@ -63,14 +63,37 @@ RUN useradd -l -m -u $OPENHANDS_USER_ID -s /bin/bash openhands && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN chown -R openhands:app /app && chmod -R 770 /app
RUN sudo chown -R openhands:app $WORKSPACE_BASE && sudo chmod -R 770 $WORKSPACE_BASE

# Install Playwright Chromium dependencies as root
USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
libnss3 \
libnspr4 \
libdbus-1-3 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libdrm2 \
libgbm1 \
libatspi2.0-0 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxrandr2 \
libxkbcommon0 \
libpango-1.0-0 \
libcairo2 \
libasound2 \
&& rm -rf /var/lib/apt/lists/*

USER openhands

ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH" \
PYTHONPATH='/app'

COPY --chown=openhands:app --chmod=770 --from=backend-builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
RUN playwright install --with-deps chromium
RUN playwright install chromium

COPY --chown=openhands:app --chmod=770 ./microagents ./microagents
COPY --chown=openhands:app --chmod=770 ./openhands ./openhands
Expand Down
Loading
Loading