Compare commits

..

3 Commits

252 changed files with 4919 additions and 12138 deletions
-15
View File
@@ -1,15 +0,0 @@
// For format details, see: https://aka.ms/devcontainer.json
{
"name": "Python 3",
// Documentation for this image:
// - https://github.com/devcontainers/templates/tree/main/src/python
// - https://github.com/microsoft/vscode-remote-try-python
// - https://hub.docker.com/r/microsoft/devcontainers-python
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
"ghcr.io/devcontainers-extra/features/poetry:2": {},
"ghcr.io/devcontainers/features/node:1": {},
},
"postCreateCommand": ".devcontainer/setup.sh",
}
-7
View File
@@ -1,7 +0,0 @@
#!/bin/bash
# Install `nc`
sudo apt update && sudo apt install netcat -y
# Do common setup tasks
source .openhands/setup.sh
-5
View File
@@ -1,5 +0,0 @@
[*]
# force *nix line endings so files don't look modified in container run from Windows clone
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
-6
View File
@@ -1,7 +1 @@
*.ipynb linguist-vendored
# force *nix line endings so files don't look modified in container run from Windows clone
* text eol=lf
# Git incorrectly thinks some media is text
*.png -text
*.mp4 -text
+1 -1
View File
@@ -24,7 +24,7 @@ on:
LLM_MODEL:
required: false
type: string
default: "anthropic/claude-sonnet-4-20250514"
default: "anthropic/claude-3-7-sonnet-20250219"
LLM_API_VERSION:
required: false
type: string
+2 -4
View File
@@ -47,10 +47,8 @@ jobs:
run: poetry install --without evaluation
- name: Build Environment
run: make build
- name: Run Unit Tests
- name: Run Tests
run: poetry run pytest --forked -n auto -svv ./tests/unit
- name: Run Runtime Tests with CLIRuntime
run: TEST_RUNTIME=cli poetry run pytest -svv tests/runtime/test_bash.py
# Run specific Windows python tests
test-on-windows:
@@ -74,5 +72,5 @@ jobs:
run: poetry install --without evaluation
- name: Run Windows unit tests
run: poetry run pytest -svv tests/unit/test_windows_bash.py
- name: Run Windows runtime tests with LocalRuntime
- name: Run Windows runtime tests
run: $env:TEST_RUNTIME="local"; poetry run pytest -svv tests/runtime/test_bash.py
+1 -8
View File
@@ -161,16 +161,9 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
.vscode/
.cursorignore
# VS Code: Ignore all but certain files that specify repo-specific settings.
# https://stackoverflow.com/questions/32964920/should-i-commit-the-vscode-folder-to-source-control
.vscode/**/*
!.vscode/extensions.json
!.vscode/launch.json
!.vscode/settings.json
!.vscode/tasks.json
# evaluation
evaluation/evaluation_outputs
evaluation/outputs
-15
View File
@@ -66,18 +66,3 @@ These details may or may not be useful for your current task.
- Actions with `thought` property are displayed in the UI based on their action type:
- Regular actions (like "run", "edit") display the thought as a separate message
- Special actions (like "think") are displayed as collapsible elements only
#### Adding User Settings:
- To add a new user setting to OpenHands, follow these steps:
1. Add the setting to the frontend:
- Add the setting to the `Settings` type in `frontend/src/types/settings.ts`
- Add the setting to the `ApiSettings` type in the same file
- Add the setting with an appropriate default value to `DEFAULT_SETTINGS` in `frontend/src/services/settings.ts`
- Update the `useSettings` hook in `frontend/src/hooks/query/use-settings.ts` to map the API response
- Update the `useSaveSettings` hook in `frontend/src/hooks/mutation/use-save-settings.ts` to include the setting in API requests
- Add UI components (like toggle switches) in the appropriate settings screen (e.g., `frontend/src/routes/app-settings.tsx`)
- Add i18n translations for the setting name and any tooltips in `frontend/src/i18n/translation.json`
- Add the translation key to `frontend/src/i18n/declaration.ts`
2. Add the setting to the backend:
- Add the setting to the `Settings` model in `openhands/storage/data_models/settings.py`
- Update any relevant backend code to apply the setting (e.g., in session creation)
-1
View File
@@ -9,5 +9,4 @@ python -m pip install pre-commit
if [ -d ".git" ]; then
echo "Installing pre-commit hooks..."
pre-commit install
make install-pre-commit-hooks
fi
-6
View File
@@ -1,6 +0,0 @@
{
// force *nix line endings so files don't look modified in container run from Windows clone
"files.eol": "\n",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
}
+1 -1
View File
@@ -67,7 +67,7 @@ docker run -it --rm --pull=always \
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.
[Anthropic's Claude Sonnet 4](https://www.anthropic.com/api) (`anthropic/claude-sonnet-4-20250514`)
[Anthropic's Claude 3.7 Sonnet](https://www.anthropic.com/api) (`anthropic/claude-3-7-sonnet-20250219`)
works best, but you have [many options](https://docs.all-hands.dev/modules/usage/llms).
## 💡 Other ways to run OpenHands
-146
View File
@@ -1,146 +0,0 @@
<a name="readme-top"></a>
<div align="center">
<img src="./docs/static/img/logo.png" alt="Logo" width="200">
<h1 align="center">OpenHands: 少写代码,多做事</h1>
</div>
<div align="center">
<a href="https://github.com/All-Hands-AI/OpenHands/graphs/contributors"><img src="https://img.shields.io/github/contributors/All-Hands-AI/OpenHands?style=for-the-badge&color=blue" alt="Contributors"></a>
<a href="https://github.com/All-Hands-AI/OpenHands/stargazers"><img src="https://img.shields.io/github/stars/All-Hands-AI/OpenHands?style=for-the-badge&color=blue" alt="Stargazers"></a>
<a href="https://github.com/All-Hands-AI/OpenHands/blob/main/LICENSE"><img src="https://img.shields.io/github/license/All-Hands-AI/OpenHands?style=for-the-badge&color=blue" alt="MIT License"></a>
<br/>
<a href="https://join.slack.com/t/openhands-ai/shared_invite/zt-34zm4j0gj-Qz5kRHoca8DFCbqXPS~f_A"><img src="https://img.shields.io/badge/Slack-Join%20Us-red?logo=slack&logoColor=white&style=for-the-badge" alt="加入我们的Slack社区"></a>
<a href="https://discord.gg/ESHStjSjD4"><img src="https://img.shields.io/badge/Discord-Join%20Us-purple?logo=discord&logoColor=white&style=for-the-badge" alt="加入我们的Discord社区"></a>
<a href="https://github.com/All-Hands-AI/OpenHands/blob/main/CREDITS.md"><img src="https://img.shields.io/badge/Project-Credits-blue?style=for-the-badge&color=FFE165&logo=github&logoColor=white" alt="致谢"></a>
<br/>
<a href="https://docs.all-hands.dev/modules/usage/getting-started"><img src="https://img.shields.io/badge/Documentation-000?logo=googledocs&logoColor=FFE165&style=for-the-badge" alt="查看文档"></a>
<a href="https://arxiv.org/abs/2407.16741"><img src="https://img.shields.io/badge/Paper%20on%20Arxiv-000?logoColor=FFE165&logo=arxiv&style=for-the-badge" alt="Arxiv论文"></a>
<a href="https://docs.google.com/spreadsheets/d/1wOUdFCMyY6Nt0AIqF705KN4JKOWgeI4wUGUP60krXXs/edit?gid=0#gid=0"><img src="https://img.shields.io/badge/Benchmark%20score-000?logoColor=FFE165&logo=huggingface&style=for-the-badge" alt="评估基准分数"></a>
<hr>
</div>
欢迎使用OpenHands(前身为OpenDevin),这是一个由AI驱动的软件开发代理平台。
OpenHands代理可以完成人类开发者能做的任何事情:修改代码、运行命令、浏览网页、调用API,甚至从StackOverflow复制代码片段。
在[docs.all-hands.dev](https://docs.all-hands.dev)了解更多信息,或[注册OpenHands Cloud](https://app.all-hands.dev)开始使用。
> [!IMPORTANT]
> 在工作中使用OpenHands?我们很想与您交流!填写
> [这份简短表格](https://docs.google.com/forms/d/e/1FAIpQLSet3VbGaz8z32gW9Wm-Grl4jpt5WgMXPgJ4EDPVmCETCBpJtQ/viewform)
> 加入我们的设计合作伙伴计划,您将获得商业功能的早期访问权限,并有机会对我们的产品路线图提供意见。
![应用截图](./docs/static/img/screenshot.png)
## ☁️ OpenHands Cloud
开始使用OpenHands的最简单方式是在[OpenHands Cloud](https://app.all-hands.dev)上,
新用户可获得$50的免费额度。
## 💻 在本地运行OpenHands
OpenHands也可以使用Docker在本地系统上运行。
查看[运行OpenHands](https://docs.all-hands.dev/modules/usage/installation)指南了解
系统要求和更多信息。
> [!WARNING]
> 在公共网络上?请参阅我们的[强化Docker安装指南](https://docs.all-hands.dev/modules/usage/runtimes/docker#hardened-docker-installation)
> 通过限制网络绑定和实施其他安全措施来保护您的部署。
```bash
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik
docker run -it --rm --pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-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.39
```
您将在[http://localhost:3000](http://localhost:3000)找到运行中的OpenHands
打开应用程序时,您将被要求选择一个LLM提供商并添加API密钥。
[Anthropic的Claude Sonnet 4](https://www.anthropic.com/api)`anthropic/claude-sonnet-4-20250514`
效果最佳,但您还有[许多选择](https://docs.all-hands.dev/modules/usage/llms)。
## 💡 运行OpenHands的其他方式
> [!CAUTION]
> OpenHands旨在由单个用户在其本地工作站上运行。
> 它不适合多租户部署,即多个用户共享同一实例。没有内置的身份验证、隔离或可扩展性。
>
> 如果您有兴趣在多租户环境中运行OpenHands,请
> [与我们联系](https://docs.google.com/forms/d/e/1FAIpQLSet3VbGaz8z32gW9Wm-Grl4jpt5WgMXPgJ4EDPVmCETCBpJtQ/viewform)
> 了解高级部署选项。
您还可以[将OpenHands连接到本地文件系统](https://docs.all-hands.dev/modules/usage/runtimes/docker#connecting-to-your-filesystem)
以可编程的[无头模式](https://docs.all-hands.dev/modules/usage/how-to/headless-mode)运行OpenHands
通过[友好的CLI](https://docs.all-hands.dev/modules/usage/how-to/cli-mode)与其交互,
或使用[GitHub Action](https://docs.all-hands.dev/modules/usage/how-to/github-action)在标记的问题上运行它。
访问[运行OpenHands](https://docs.all-hands.dev/modules/usage/installation)获取更多信息和设置说明。
如果您想修改OpenHands源代码,请查看[Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md)。
遇到问题?[故障排除指南](https://docs.all-hands.dev/modules/usage/troubleshooting)可以提供帮助。
## 📖 文档
<a href="https://deepwiki.com/All-Hands-AI/OpenHands"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki" title="DeepWiki自动生成文档"></a>
要了解有关项目的更多信息,以及使用OpenHands的技巧,
请查看我们的[文档](https://docs.all-hands.dev/modules/usage/getting-started)。
在那里,您将找到有关如何使用不同LLM提供商、
故障排除资源和高级配置选项的资源。
## 🤝 如何加入社区
OpenHands是一个社区驱动的项目,我们欢迎每个人的贡献。我们大部分沟通
通过Slack进行,因此这是开始的最佳场所,但我们也很乐意您通过Discord或Github与我们联系:
- [加入我们的Slack工作空间](https://join.slack.com/t/openhands-ai/shared_invite/zt-34zm4j0gj-Qz5kRHoca8DFCbqXPS~f_A) - 这里我们讨论研究、架构和未来发展。
- [加入我们的Discord服务器](https://discord.gg/ESHStjSjD4) - 这是一个社区运营的服务器,用于一般讨论、问题和反馈。
- [阅读或发布Github问题](https://github.com/All-Hands-AI/OpenHands/issues) - 查看我们正在处理的问题,或添加您自己的想法。
在[COMMUNITY.md](./COMMUNITY.md)中了解更多关于社区的信息,或在[CONTRIBUTING.md](./CONTRIBUTING.md)中找到有关贡献的详细信息。
## 📈 进展
在[这里](https://github.com/orgs/All-Hands-AI/projects/1)查看OpenHands月度路线图(每月月底在维护者会议上更新)。
<p align="center">
<a href="https://star-history.com/#All-Hands-AI/OpenHands&Date">
<img src="https://api.star-history.com/svg?repos=All-Hands-AI/OpenHands&type=Date" width="500" alt="Star History Chart">
</a>
</p>
## 📜 许可证
根据MIT许可证分发。有关更多信息,请参阅[`LICENSE`](./LICENSE)。
## 🙏 致谢
OpenHands由大量贡献者构建,每一份贡献都备受感谢!我们还借鉴了其他开源项目,对他们的工作深表感谢。
有关OpenHands中使用的开源项目和许可证列表,请参阅我们的[CREDITS.md](./CREDITS.md)文件。
## 📚 引用
```
@misc{openhands,
title={{OpenHands: An Open Platform for AI Software Developers as Generalist Agents}},
author={Xingyao Wang and Boxuan Li and Yufan Song and Frank F. Xu and Xiangru Tang and Mingchen Zhuge and Jiayi Pan and Yueqi Song and Bowen Li and Jaskirat Singh and Hoang H. Tran and Fuqiang Li and Ren Ma and Mingzhang Zheng and Bill Qian and Yanjun Shao and Niklas Muennighoff and Yizhe Zhang and Binyuan Hui and Junyang Lin and Robert Brennan and Hao Peng and Heng Ji and Graham Neubig},
year={2024},
eprint={2407.16741},
archivePrefix={arXiv},
primaryClass={cs.SE},
url={https://arxiv.org/abs/2407.16741},
}
```
+1 -1
View File
@@ -52,4 +52,4 @@ $ poetry run python docs/translation_updater.py
# ...
```
This process uses `claude-sonnet-4-20250514` as base model and each language consumes at least ~30k input tokens and ~35k output tokens.
This process uses `claude-3-7-sonnet-20250219` as base model and each language consumes at least ~30k input tokens and ~35k output tokens.
@@ -0,0 +1,33 @@
# Résolveur GitHub Cloud
Le Résolveur GitHub automatise les corrections de code et fournit une assistance intelligente pour vos dépôts.
## Configuration
Le Résolveur GitHub Cloud est disponible automatiquement lorsque vous
[accordez l'accès au dépôt OpenHands Cloud](./openhands-cloud#adding-repository-access).
## Utilisation
Après avoir accordé l'accès au dépôt OpenHands Cloud, vous pouvez utiliser le Résolveur GitHub Cloud sur les problèmes et les pull requests
du dépôt.
### Problèmes (Issues)
Sur votre dépôt, étiquetez un problème avec `openhands`. OpenHands va :
1. Commenter le problème pour vous informer qu'il y travaille.
- Vous pouvez cliquer sur le lien pour suivre la progression sur OpenHands Cloud.
2. Ouvrir une pull request s'il détermine que le problème a été résolu avec succès.
3. Commenter le problème avec un résumé des tâches effectuées et un lien vers la pull request.
### Pull Requests
Pour qu'OpenHands travaille sur des pull requests, utilisez `@openhands` dans les commentaires de premier niveau ou en ligne pour :
- Poser des questions
- Demander des mises à jour
- Obtenir des explications de code
OpenHands va :
1. Commenter la PR pour vous informer qu'il y travaille.
2. Effectuer la tâche.
@@ -1,32 +0,0 @@
# Résolveur de Problèmes Cloud
Le Résolveur de Problèmes Cloud automatise les corrections de code et fournit une assistance intelligente pour vos dépôts sur GitHub et GitLab.
## Configuration
Le Résolveur de Problèmes Cloud est disponible automatiquement lorsque vous accordez l'accès au dépôt OpenHands Cloud :
- [Accès au dépôt GitHub](./github-installation#adding-repository-access)
- [Accès au dépôt GitLab](./gitlab-installation#adding-repository-access)
## Utilisation
Après avoir accordé l'accès au dépôt OpenHands Cloud, vous pouvez utiliser le Résolveur de Problèmes Cloud sur les problèmes et les pull/merge requests dans vos dépôts.
### Travailler avec les Problèmes
Sur votre dépôt, étiquetez un problème avec `openhands`. OpenHands va :
1. Commenter le problème pour vous faire savoir qu'il y travaille
- Vous pouvez cliquer sur le lien pour suivre la progression sur OpenHands Cloud
2. Ouvrir une pull request (GitHub) ou une merge request (GitLab) s'il détermine que le problème a été résolu avec succès
3. Commenter le problème avec un résumé des tâches effectuées et un lien vers la PR/MR
### Travailler avec les Pull/Merge Requests
Pour qu'OpenHands travaille sur les pull requests (GitHub) ou les merge requests (GitLab), mentionnez `@openhands` dans les commentaires pour :
- Poser des questions
- Demander des mises à jour
- Obtenir des explications de code
OpenHands va :
1. Commenter pour vous faire savoir qu'il y travaille
2. Effectuer la tâche demandée
@@ -1,29 +0,0 @@
# Interface Cloud
L'interface Cloud fournit une interface web pour interagir avec OpenHands AI. Cette page explique comment accéder et utiliser l'interface Cloud d'OpenHands.
## Accès à l'Interface
L'interface Cloud d'OpenHands est accessible à [app.all-hands.dev](https://app.all-hands.dev). Vous devrez vous connecter avec votre compte GitHub ou GitLab pour accéder à l'interface.
<!-- Image will be added in a future update -->
<!-- ![Interface Cloud OpenHands](/img/docs/openhands-cloud-ui.png) -->
## Fonctionnalités Clés
Pour des informations détaillées sur les fonctionnalités disponibles dans l'interface Cloud d'OpenHands, veuillez consulter la section [Fonctionnalités Clés](../key-features.md) de la documentation.
## Paramètres
La page des paramètres vous permet de :
1. Configurer les préférences de votre compte
2. Gérer l'accès aux dépôts
3. Générer des clés API pour un accès programmatique
4. Personnaliser votre expérience OpenHands
## Prochaines Étapes
- [Utiliser le Résolveur de Problèmes Cloud](./cloud-issue-resolver.md) pour automatiser les corrections de code et obtenir de l'aide
- [En savoir plus sur l'API Cloud](./cloud-api.md) pour un accès programmatique
- [Retourner à la Mise en Route](./openhands-cloud.md)
@@ -1,55 +0,0 @@
# Installation GitHub
Ce guide vous accompagne dans le processus d'installation et de configuration d'OpenHands Cloud pour vos dépôts GitHub.
## Prérequis
- Un compte GitHub
- Accès à OpenHands Cloud
## Étapes d'Installation
1. Connectez-vous à [OpenHands Cloud](https://app.all-hands.dev)
2. Si vous n'avez pas encore connecté votre compte GitHub :
- Cliquez sur `Se connecter à GitHub`
- Examinez et acceptez les conditions d'utilisation
- Autorisez l'application OpenHands AI
## Ajout d'Accès au Dépôt
Vous pouvez accorder à OpenHands l'accès à des dépôts spécifiques :
1. Cliquez sur le menu déroulant `Sélectionner un projet GitHub`, puis sélectionnez `Ajouter plus de dépôts...`
2. Sélectionnez votre organisation et choisissez les dépôts spécifiques auxquels vous souhaitez accorder l'accès à OpenHands.
- OpenHands demande des jetons à courte durée de vie (expiration de 8 heures) avec ces permissions :
- Actions : Lecture et écriture
- Administration : Lecture seule
- Statuts de commit : Lecture et écriture
- Contenus : Lecture et écriture
- Problèmes : Lecture et écriture
- Métadonnées : Lecture seule
- Pull requests : Lecture et écriture
- Webhooks : Lecture et écriture
- Workflows : Lecture et écriture
- L'accès au dépôt pour un utilisateur est accordé en fonction de :
- Permission accordée pour le dépôt
- Permissions GitHub de l'utilisateur (propriétaire/collaborateur)
3. Cliquez sur `Installer & Autoriser`
## Modification de l'Accès au Dépôt
Vous pouvez modifier l'accès au dépôt à tout moment :
* En utilisant le même workflow `Sélectionner un projet GitHub > Ajouter plus de dépôts`, ou
* En visitant la page Paramètres et en sélectionnant `Configurer les Dépôts GitHub` dans la section `Paramètres GitHub`.
## Utilisation d'OpenHands avec GitHub
Une fois que vous avez accordé l'accès au dépôt, vous pouvez utiliser OpenHands avec vos dépôts GitHub.
Pour plus de détails sur l'utilisation d'OpenHands avec les problèmes et les pull requests GitHub, consultez la documentation du [Résolveur de Problèmes Cloud](./cloud-issue-resolver.md).
## Prochaines Étapes
- [Accéder à l'Interface Cloud](./cloud-ui.md) pour interagir avec l'interface web
- [Utiliser le Résolveur de Problèmes Cloud](./cloud-issue-resolver.md) pour automatiser les corrections de code et obtenir de l'aide
- [Utiliser l'API Cloud](./cloud-api.md) pour interagir programmatiquement avec OpenHands
@@ -1,50 +0,0 @@
# Installation GitLab
Ce guide vous accompagne dans le processus d'installation et de configuration d'OpenHands Cloud pour vos dépôts GitLab.
## Prérequis
- Un compte GitLab
- Accès à OpenHands Cloud
## Étapes d'Installation
1. Connectez-vous à [OpenHands Cloud](https://app.all-hands.dev)
2. Si vous n'avez pas encore connecté votre compte GitLab :
- Cliquez sur `Se connecter à GitLab`
- Examinez et acceptez les conditions d'utilisation
- Autorisez l'application OpenHands AI
## Ajout d'Accès au Dépôt
Vous pouvez accorder à OpenHands l'accès à des dépôts spécifiques :
1. Cliquez sur le menu déroulant `Sélectionner un projet GitLab`, puis sélectionnez `Ajouter plus de dépôts...`
2. Sélectionnez votre organisation et choisissez les dépôts spécifiques auxquels vous souhaitez accorder l'accès à OpenHands.
- OpenHands demande des permissions avec ces portées :
- api : Accès complet à l'API
- read_user : Lecture des informations utilisateur
- read_repository : Lecture des informations du dépôt
- write_repository : Écriture dans le dépôt
- L'accès au dépôt pour un utilisateur est accordé en fonction de :
- Permission accordée pour le dépôt
- Permissions GitLab de l'utilisateur (propriétaire/mainteneur/développeur)
3. Cliquez sur `Installer & Autoriser`
## Modification de l'Accès au Dépôt
Vous pouvez modifier l'accès au dépôt à tout moment :
* En utilisant le même workflow `Sélectionner un projet GitLab > Ajouter plus de dépôts`, ou
* En visitant la page Paramètres et en sélectionnant `Configurer les Dépôts GitLab` dans la section `Paramètres GitLab`.
## Utilisation d'OpenHands avec GitLab
Une fois que vous avez accordé l'accès au dépôt, vous pouvez utiliser OpenHands avec vos dépôts GitLab.
Pour plus de détails sur l'utilisation d'OpenHands avec les problèmes et les merge requests GitLab, consultez la documentation du [Résolveur de Problèmes Cloud](./cloud-issue-resolver.md).
## Prochaines Étapes
- [Accéder à l'Interface Cloud](./cloud-ui.md) pour interagir avec l'interface web
- [Utiliser le Résolveur de Problèmes Cloud](./cloud-issue-resolver.md) pour automatiser les corrections de code et obtenir de l'aide
- [Utiliser l'API Cloud](./cloud-api.md) pour interagir programmatiquement avec OpenHands
@@ -1,24 +0,0 @@
# OpenHands Cloud
OpenHands Cloud est la version hébergée dans le cloud d'OpenHands par All Hands AI.
## Accès à OpenHands Cloud
Pour commencer avec OpenHands Cloud, visitez [app.all-hands.dev](https://app.all-hands.dev).
Vous serez invité à vous connecter avec votre compte GitHub ou GitLab :
1. Après avoir lu et accepté les conditions d'utilisation, cliquez sur `Se connecter à GitHub` ou `Se connecter à GitLab`.
2. Examinez les permissions demandées par OpenHands et autorisez l'application.
- OpenHands nécessitera certaines permissions de votre compte. Pour en savoir plus sur ces permissions,
vous pouvez cliquer sur le lien `En savoir plus` sur la page d'autorisation.
## Prochaines Étapes
Une fois que vous avez connecté votre compte, vous pouvez :
- [Installer l'Intégration GitHub](./github-installation.md) pour utiliser OpenHands avec vos dépôts GitHub
- [Installer l'Intégration GitLab](./gitlab-installation.md) pour utiliser OpenHands avec vos dépôts GitLab
- [Accéder à l'Interface Cloud](./cloud-ui.md) pour interagir avec l'interface web
- [Utiliser l'API Cloud](./cloud-api.md) pour interagir programmatiquement avec OpenHands
- [Configurer le Résolveur de Problèmes Cloud](./cloud-issue-resolver.md) pour automatiser les corrections de code et fournir une assistance intelligente
@@ -0,0 +1,65 @@
# OpenHands Cloud
OpenHands Cloud est la version hébergée dans le cloud d'OpenHands par All Hands AI.
## Accéder à OpenHands Cloud
OpenHands Cloud est accessible à l'adresse https://app.all-hands.dev/.
Vous pouvez également interagir avec OpenHands Cloud par programmation en utilisant l'[API](./cloud-api).
## Premiers pas
Après avoir visité OpenHands Cloud, il vous sera demandé de vous connecter avec votre compte GitHub ou GitLab :
1. Après avoir lu et accepté les conditions d'utilisation, cliquez sur `Log in with GitHub` ou `Log in with GitLab`.
2. Examinez les autorisations demandées par OpenHands, puis cliquez sur `Authorize OpenHands AI`.
- OpenHands nécessitera certaines autorisations de votre compte GitHub ou GitLab. Pour en savoir plus sur ces autorisations :
- GitHub : Vous pouvez cliquer sur le lien `Learn more` sur la page d'autorisation GitHub.
- GitLab : Vous pouvez développer chaque demande d'autorisation sur la page d'autorisation GitLab.
## Accès aux dépôts
### GitHub
#### Ajouter l'accès aux dépôts
Vous pouvez accorder à OpenHands un accès à des dépôts spécifiques :
1. Cliquez sur `Add GitHub repos` sur la page d'accueil.
2. Sélectionnez l'organisation, puis choisissez les dépôts spécifiques auxquels vous souhaitez donner accès à OpenHands.
<details>
<summary>Détails des autorisations pour l'accès aux dépôts</summary>
Openhands demande des jetons à courte durée de vie (expiration de 8 heures) avec ces autorisations :
- Actions : Lecture et écriture
- Administration : Lecture seule
- Statuts de commit : Lecture et écriture
- Contenus : Lecture et écriture
- Issues : Lecture et écriture
- Métadonnées : Lecture seule
- Pull requests : Lecture et écriture
- Webhooks : Lecture et écriture
- Workflows : Lecture et écriture
L'accès au dépôt pour un utilisateur est accordé en fonction de :
- L'autorisation accordée pour le dépôt.
- Les autorisations GitHub de l'utilisateur (propriétaire/collaborateur).
</details>
3. Cliquez sur `Install & Authorize`.
#### Modifier l'accès aux dépôts
Vous pouvez modifier l'accès aux dépôts GitHub à tout moment en :
* Utilisant le même processus `Add GitHub repos`, ou
* Visitant la page Paramètres et en sélectionnant `Configure GitHub Repositories` dans la section `Git Settings`.
### GitLab
Lorsque vous utilisez votre compte GitLab, OpenHands aura automatiquement accès à vos dépôts.
## Persistance des conversations
- Liste des conversations Affiche uniquement les 10 conversations les plus récentes initiées au cours des 10 derniers jours.
- Espaces de travail Les espaces de travail de conversation sont conservés pendant 14 jours.
- Environnements d'exécution Les environnements d'exécution restent actifs ("chauds") pendant 30 minutes. Après cette période, la reprise d'une conversation peut prendre 1 à 2 minutes.
@@ -1,8 +1,8 @@
# Aperçu des Fonctionnalités d'OpenHands
# Aperçu des fonctionnalités d'OpenHands
![aperçu](/img/oh-features.png)
### Panneau de Discussion
### Panneau de discussion
- Affiche la conversation entre l'utilisateur et OpenHands.
- OpenHands explique ses actions dans ce panneau.
@@ -10,8 +10,8 @@
- Montre les modifications de fichiers effectuées par OpenHands.
### VS Code
- VS Code intégré pour parcourir et modifier les fichiers.
- Peut également être utilisé pour télécharger et envoyer des fichiers.
- VS Code intégré pour parcourir et modifier des fichiers.
- Peut également être utilisé pour télécharger et importer des fichiers.
### Terminal
- Un espace permettant à OpenHands et aux utilisateurs d'exécuter des commandes terminal.
@@ -25,5 +25,5 @@
- Les utilisateurs peuvent interagir avec l'application en cours d'exécution.
### Navigateur
- Utilisé par OpenHands pour naviguer sur les sites web.
- Utilisé par OpenHands pour naviguer sur des sites web.
- Le navigateur n'est pas interactif.
@@ -13,7 +13,7 @@ recommandations pour la sélection de modèles. Nos derniers résultats d'évalu
Sur la base de ces résultats et des retours de la communauté, les modèles suivants ont été vérifiés comme fonctionnant raisonnablement bien avec OpenHands :
- [anthropic/claude-sonnet-4-20250514](https://www.anthropic.com/api) (recommandé)
- [anthropic/claude-3-7-sonnet-20250219](https://www.anthropic.com/api) (recommandé)
- [gemini/gemini-2.5-pro](https://blog.google/technology/google-deepmind/gemini-model-thinking-updates-march-2025/)
- [deepseek/deepseek-chat](https://api-docs.deepseek.com/)
- [openai/o3-mini](https://openai.com/index/openai-o3-mini/)
@@ -0,0 +1,31 @@
# Cloud GitHub Resolver
GitHub Resolverはコードの修正を自動化し、リポジトリに対してインテリジェントな支援を提供します。
## セットアップ
Cloud GitHub Resolverは、[OpenHands Cloudにリポジトリアクセス権を付与する](./openhands-cloud#adding-repository-access)と自動的に利用可能になります。
## 使用方法
OpenHands Cloudにリポジトリアクセス権を付与した後、リポジトリの課題(Issue)とプルリクエストでCloud GitHub Resolverを使用できます。
### 課題(Issues
リポジトリで課題に`openhands`ラベルを付けると、OpenHandsは以下の操作を行います:
1. 課題にコメントして、作業中であることを通知します。
- OpenHands Cloudで進捗状況を追跡するためのリンクをクリックできます。
2. 課題が正常に解決されたと判断した場合、プルリクエストを開きます。
3. 実行されたタスクの概要とプルリクエストへのリンクを含むコメントを課題に投稿します。
### プルリクエスト
プルリクエストでOpenHandsを利用するには、トップレベルまたはインラインコメントで`@openhands`を使用して:
- 質問する
- 更新をリクエストする
- コードの説明を取得する
OpenHandsは以下の操作を行います:
1. PRにコメントして、作業中であることを通知します。
2. タスクを実行します。
@@ -1,32 +0,0 @@
# クラウド課題リゾルバー
クラウド課題リゾルバーは、GitHubとGitLabのリポジトリに対してコード修正を自動化し、インテリジェントな支援を提供します。
## セットアップ
クラウド課題リゾルバーは、OpenHands Cloudリポジトリアクセスを許可すると自動的に利用可能になります:
- [GitHubリポジトリアクセス](./github-installation#adding-repository-access)
- [GitLabリポジトリアクセス](./gitlab-installation#adding-repository-access)
## 使用方法
OpenHands Cloudリポジトリアクセスを許可した後、リポジトリの課題やプルリクエスト/マージリクエストでクラウド課題リゾルバーを使用できます。
### 課題の操作
リポジトリで、課題に`openhands`というラベルを付けます。OpenHandsは以下を行います:
1. 課題にコメントして、作業中であることを知らせます
- リンクをクリックすると、OpenHands Cloudで進捗状況を追跡できます
2. 課題が正常に解決されたと判断した場合、プルリクエスト(GitHub)またはマージリクエスト(GitLab)を開きます
3. 実行されたタスクの概要とPR/MRへのリンクを含むコメントを課題に残します
### プルリクエスト/マージリクエストの操作
プルリクエスト(GitHub)またはマージリクエスト(GitLab)でOpenHandsを動作させるには、コメントで`@openhands`を言及して以下を行います:
- 質問する
- 更新をリクエストする
- コードの説明を取得する
OpenHandsは以下を行います:
1. 作業中であることを知らせるコメントをします
2. リクエストされたタスクを実行します
@@ -1,29 +0,0 @@
# クラウドUI
クラウドUIは、OpenHands AIと対話するためのウェブインターフェースを提供します。このページでは、OpenHands クラウドUIへのアクセス方法と使用方法について説明します。
## UIへのアクセス
OpenHands クラウドUIは[app.all-hands.dev](https://app.all-hands.dev)でアクセスできます。インターフェースにアクセスするには、GitHubまたはGitLabアカウントでサインインする必要があります。
<!-- 画像は将来のアップデートで追加されます -->
<!-- ![OpenHands クラウドUI](/img/docs/openhands-cloud-ui.png) -->
## 主な機能
OpenHands クラウドUIで利用可能な機能の詳細については、ドキュメントの[主な機能](../key-features.md)セクションを参照してください。
## 設定
設定ページでは以下のことができます:
1. アカウント設定の構成
2. リポジトリアクセスの管理
3. プログラムによるアクセスのためのAPIキーの生成
4. OpenHandsエクスペリエンスのカスタマイズ
## 次のステップ
- [クラウド課題リゾルバーを使用する](./cloud-issue-resolver.md)でコード修正を自動化し、支援を受ける
- [クラウドAPIについて学ぶ](./cloud-api.md)でプログラムによるアクセスを行う
- [はじめにに戻る](./openhands-cloud.md)
@@ -1,55 +0,0 @@
# GitHub インストール
このガイドでは、GitHubリポジトリ用にOpenHands Cloudをインストールおよび設定するプロセスについて説明します。
## 前提条件
- GitHubアカウント
- OpenHands Cloudへのアクセス
## インストール手順
1. [OpenHands Cloud](https://app.all-hands.dev)にログインします
2. まだGitHubアカウントを接続していない場合:
- `GitHubに接続する`をクリックします
- 利用規約を確認して同意します
- OpenHands AIアプリケーションを承認します
## リポジトリアクセスの追加
特定のリポジトリへのアクセスをOpenHandsに許可できます:
1. `GitHubプロジェクトを選択`ドロップダウンをクリックし、`リポジトリを追加...`を選択します
2. 組織を選択し、OpenHandsにアクセスを許可する特定のリポジトリを選択します。
- OpenHandsは以下の権限を持つ短期間のトークン(8時間の有効期限)をリクエストします:
- アクション:読み取りと書き込み
- 管理:読み取り専用
- コミットステータス:読み取りと書き込み
- コンテンツ:読み取りと書き込み
- 課題:読み取りと書き込み
- メタデータ:読み取り専用
- プルリクエスト:読み取りと書き込み
- Webhook:読み取りと書き込み
- ワークフロー:読み取りと書き込み
- ユーザーのリポジトリアクセスは以下に基づいて付与されます:
- リポジトリに付与された権限
- ユーザーのGitHub権限(所有者/コラボレーター)
3. `インストール&承認`をクリックします
## リポジトリアクセスの変更
リポジトリアクセスはいつでも変更できます:
* 同じ`GitHubプロジェクトを選択 > リポジトリを追加`ワークフローを使用する、または
* 設定ページにアクセスし、`GitHub設定`セクションで`GitHubリポジトリを設定する`を選択します。
## GitHubでのOpenHandsの使用
リポジトリアクセスを許可すると、GitHubリポジトリでOpenHandsを使用できます。
GitHub課題とプルリクエストでOpenHandsを使用する方法の詳細については、[クラウド課題リゾルバー](./cloud-issue-resolver.md)のドキュメントを参照してください。
## 次のステップ
- [クラウドUIにアクセスする](./cloud-ui.md)でウェブインターフェースと対話する
- [クラウド課題リゾルバーを使用する](./cloud-issue-resolver.md)でコード修正を自動化し、支援を受ける
- [クラウドAPIを使用する](./cloud-api.md)でプログラムによりOpenHandsと対話する
@@ -1,50 +0,0 @@
# GitLab インストール
このガイドでは、GitLabリポジトリ用にOpenHands Cloudをインストールおよび設定するプロセスについて説明します。
## 前提条件
- GitLabアカウント
- OpenHands Cloudへのアクセス
## インストール手順
1. [OpenHands Cloud](https://app.all-hands.dev)にログインします
2. まだGitLabアカウントを接続していない場合:
- `GitLabに接続する`をクリックします
- 利用規約を確認して同意します
- OpenHands AIアプリケーションを承認します
## リポジトリアクセスの追加
特定のリポジトリへのアクセスをOpenHandsに許可できます:
1. `GitLabプロジェクトを選択`ドロップダウンをクリックし、`リポジトリを追加...`を選択します
2. 組織を選択し、OpenHandsにアクセスを許可する特定のリポジトリを選択します。
- OpenHandsは以下のスコープで権限をリクエストします:
- api:完全なAPIアクセス
- read_user:ユーザー情報の読み取り
- read_repository:リポジトリ情報の読み取り
- write_repository:リポジトリへの書き込み
- ユーザーのリポジトリアクセスは以下に基づいて付与されます:
- リポジトリに付与された権限
- ユーザーのGitLab権限(所有者/メンテナー/開発者)
3. `インストール&承認`をクリックします
## リポジトリアクセスの変更
リポジトリアクセスはいつでも変更できます:
* 同じ`GitLabプロジェクトを選択 > リポジトリを追加`ワークフローを使用する、または
* 設定ページにアクセスし、`GitLab設定`セクションで`GitLabリポジトリを設定する`を選択します。
## GitLabでのOpenHandsの使用
リポジトリアクセスを許可すると、GitLabリポジトリでOpenHandsを使用できます。
GitLab課題とマージリクエストでOpenHandsを使用する方法の詳細については、[クラウド課題リゾルバー](./cloud-issue-resolver.md)のドキュメントを参照してください。
## 次のステップ
- [クラウドUIにアクセスする](./cloud-ui.md)でウェブインターフェースと対話する
- [クラウド課題リゾルバーを使用する](./cloud-issue-resolver.md)でコード修正を自動化し、支援を受ける
- [クラウドAPIを使用する](./cloud-api.md)でプログラムによりOpenHandsと対話する
@@ -1,24 +0,0 @@
# OpenHands クラウド
OpenHands クラウドは、All Hands AIのOpenHandsのホスト型クラウドバージョンです。
## OpenHands クラウドへのアクセス
OpenHands クラウドを始めるには、[app.all-hands.dev](https://app.all-hands.dev)にアクセスしてください。
GitHubまたはGitLabアカウントで接続するよう求められます:
1. 利用規約を読んで同意した後、`GitHubに接続する`または`GitLabに接続する`をクリックします。
2. OpenHandsがリクエストする権限を確認し、アプリケーションを承認します。
- OpenHandsはあなたのアカウントから特定の権限を必要とします。これらの権限について詳しく知るには、
承認ページの`詳細を見る`リンクをクリックしてください。
## 次のステップ
アカウントを接続したら、以下のことができます:
- [GitHub統合をインストールする](./github-installation.md)でGitHubリポジトリでOpenHandsを使用する
- [GitLab統合をインストールする](./gitlab-installation.md)でGitLabリポジトリでOpenHandsを使用する
- [クラウドUIにアクセスする](./cloud-ui.md)でウェブインターフェースと対話する
- [クラウドAPIを使用する](./cloud-api.md)でプログラムによりOpenHandsと対話する
- [クラウド課題リゾルバーを設定する](./cloud-issue-resolver.md)でコード修正を自動化し、インテリジェントな支援を提供する
@@ -0,0 +1,65 @@
# OpenHands Cloud
OpenHands CloudはAll Hands AIによるOpenHandsのクラウドホスト版です。
## OpenHands Cloudへのアクセス
OpenHands Cloudは https://app.all-hands.dev/ でアクセスできます。
[API](./cloud-api)を使用してプログラム的にOpenHands Cloudと対話することもできます。
## はじめに
OpenHands Cloudにアクセスすると、GitHubまたはGitLabアカウントとの接続を求められます:
1. 利用規約を読んで同意した後、`Log in with GitHub`または`Log in with GitLab`をクリックします。
2. OpenHandsが要求する権限を確認し、`Authorize OpenHands AI`をクリックします。
- OpenHandsはGitHubまたはGitLabアカウントからいくつかの権限を必要とします。これらの権限について詳しく知るには:
- GitHubGitHub認証ページの`Learn more`リンクをクリックできます。
- GitLab:GitLab認証ページで各権限リクエストを展開できます。
## リポジトリアクセス
### GitHub
#### リポジトリアクセスの追加
OpenHandsに特定のリポジトリへのアクセス権を付与できます:
1. ホームページで`Add GitHub repos`をクリックします。
2. 組織を選択し、OpenHandsにアクセス権を付与する特定のリポジトリを選択します。
<details>
<summary>リポジトリアクセスの権限詳細</summary>
Openhandsは短期間のトークン(8時間で期限切れ)を以下の権限で要求します:
- Actions:読み取りと書き込み
- Administration:読み取り専用
- Commit statuses:読み取りと書き込み
- Contents:読み取りと書き込み
- Issues:読み取りと書き込み
- Metadata:読み取り専用
- Pull requests:読み取りと書き込み
- Webhooks:読み取りと書き込み
- Workflows:読み取りと書き込み
ユーザーのリポジトリアクセスは以下に基づいて付与されます:
- リポジトリに対して付与された権限
- ユーザーのGitHub権限(オーナー/コラボレーター)
</details>
3. `Install & Authorize`をクリックします。
#### リポジトリアクセスの変更
GitHubリポジトリアクセスはいつでも以下の方法で変更できます:
* 同じ`Add GitHub repos`ワークフローを使用する、または
* 設定ページにアクセスし、`Git Settings`セクションの下にある`Configure GitHub Repositories`を選択する。
### GitLab
GitLabアカウントを使用する場合、OpenHandsは自動的にあなたのリポジトリにアクセスできるようになります。
## 会話の保持
- 会話リスト – 過去10日間に開始された最新10件の会話のみが表示されます。
- ワークスペース – 会話ワークスペースは14日間保持されます。
- ランタイム – ランタイムは30分間アクティブ(「ウォーム」)な状態を維持します。この期間後、会話を再開するには1〜2分かかる場合があります。
@@ -3,11 +3,11 @@
![概要](/img/oh-features.png)
### チャットパネル
- ユーザーとOpenHandsの会話を表示します。
- ユーザーとOpenHandsの会話を表示します。
- OpenHandsはこのパネルで自身の行動を説明します。
### 変更
- OpenHandsによって実行されたファイル変更を表示します。
### 変更
- OpenHandsによって実行されたファイル変更を表示します。
### VS Code
- ファイルの閲覧や修正のための組み込みVS Code。
@@ -18,7 +18,7 @@
### Jupyter
- OpenHandsによって実行されたすべてのPythonコマンドを表示します。
- データ可視化タスクにOpenHandsを使用する際に特に便利です。
- OpenHandsを使用してデータ可視化タスクを実行する際に特に便利です。
### アプリ
- OpenHandsがアプリケーションを実行する際にウェブサーバーを表示します。
@@ -26,4 +26,4 @@
### ブラウザ
- OpenHandsがウェブサイトを閲覧するために使用します。
- ブラウザは非対話です。
- このブラウザは非対話です。
@@ -13,7 +13,7 @@ OpenHandsはLiteLLMでサポートされているあらゆるLLMに接続でき
これらの調査結果とコミュニティからのフィードバックに基づき、以下のモデルはOpenHandsでうまく動作することが確認されています:
- [anthropic/claude-sonnet-4-20250514](https://www.anthropic.com/api) (推奨)
- [anthropic/claude-3-7-sonnet-20250219](https://www.anthropic.com/api) (推奨)
- [gemini/gemini-2.5-pro](https://blog.google/technology/google-deepmind/gemini-model-thinking-updates-march-2025/)
- [deepseek/deepseek-chat](https://api-docs.deepseek.com/)
- [openai/o3-mini](https://openai.com/index/openai-o3-mini/)
@@ -0,0 +1,33 @@
# Resolvedor GitHub na Nuvem
O Resolvedor GitHub automatiza correções de código e fornece assistência inteligente para seus repositórios.
## Configuração
O Resolvedor GitHub na Nuvem está disponível automaticamente quando você
[concede acesso de repositório ao OpenHands Cloud](./openhands-cloud#adding-repository-access).
## Uso
Após conceder acesso de repositório ao OpenHands Cloud, você pode usar o Resolvedor GitHub na Nuvem nos problemas e pull requests
do repositório.
### Problemas (Issues)
No seu repositório, rotule um problema com `openhands`. O OpenHands irá:
1. Comentar no problema para informar que está trabalhando nele.
- Você pode clicar no link para acompanhar o progresso no OpenHands Cloud.
2. Abrir um pull request se determinar que o problema foi resolvido com sucesso.
3. Comentar no problema com um resumo das tarefas realizadas e um link para o pull request.
### Pull Requests
Para fazer o OpenHands trabalhar em pull requests, use `@openhands` em comentários de nível superior ou em linha para:
- Fazer perguntas
- Solicitar atualizações
- Obter explicações de código
O OpenHands irá:
1. Comentar no PR para informar que está trabalhando nele.
2. Realizar a tarefa.
@@ -1,32 +0,0 @@
# Resolvedor de Problemas na Nuvem
O Resolvedor de Problemas na Nuvem automatiza correções de código e fornece assistência inteligente para seus repositórios no GitHub e GitLab.
## Configuração
O Resolvedor de Problemas na Nuvem está disponível automaticamente quando você concede acesso ao repositório OpenHands Cloud:
- [Acesso ao repositório GitHub](./github-installation#adding-repository-access)
- [Acesso ao repositório GitLab](./gitlab-installation#adding-repository-access)
## Uso
Após conceder acesso ao repositório OpenHands Cloud, você pode usar o Resolvedor de Problemas na Nuvem em issues e pull/merge requests em seus repositórios.
### Trabalhando com Issues
No seu repositório, rotule uma issue com `openhands`. O OpenHands irá:
1. Comentar na issue para informar que está trabalhando nela
- Você pode clicar no link para acompanhar o progresso no OpenHands Cloud
2. Abrir um pull request (GitHub) ou merge request (GitLab) se determinar que o problema foi resolvido com sucesso
3. Comentar na issue com um resumo das tarefas realizadas e um link para o PR/MR
### Trabalhando com Pull/Merge Requests
Para fazer o OpenHands trabalhar em pull requests (GitHub) ou merge requests (GitLab), mencione `@openhands` nos comentários para:
- Fazer perguntas
- Solicitar atualizações
- Obter explicações de código
O OpenHands irá:
1. Comentar para informar que está trabalhando nisso
2. Realizar a tarefa solicitada
@@ -1,29 +0,0 @@
# Interface da Nuvem
A Interface da Nuvem fornece uma interface web para interagir com o OpenHands AI. Esta página explica como acessar e usar a Interface da Nuvem do OpenHands.
## Acessando a Interface
A Interface da Nuvem do OpenHands pode ser acessada em [app.all-hands.dev](https://app.all-hands.dev). Você precisará fazer login com sua conta do GitHub ou GitLab para acessar a interface.
<!-- A imagem será adicionada em uma atualização futura -->
<!-- ![Interface da Nuvem do OpenHands](/img/docs/openhands-cloud-ui.png) -->
## Recursos Principais
Para informações detalhadas sobre os recursos disponíveis na Interface da Nuvem do OpenHands, consulte a seção [Recursos Principais](../key-features.md) da documentação.
## Configurações
A página de configurações permite que você:
1. Configure as preferências da sua conta
2. Gerencie o acesso ao repositório
3. Gere chaves de API para acesso programático
4. Personalize sua experiência com o OpenHands
## Próximos Passos
- [Use o Resolvedor de Problemas na Nuvem](./cloud-issue-resolver.md) para automatizar correções de código e obter assistência
- [Aprenda sobre a API da Nuvem](./cloud-api.md) para acesso programático
- [Voltar para Introdução](./openhands-cloud.md)
@@ -1,55 +0,0 @@
# Instalação do GitHub
Este guia orienta você pelo processo de instalação e configuração do OpenHands Cloud para seus repositórios GitHub.
## Pré-requisitos
- Uma conta GitHub
- Acesso ao OpenHands Cloud
## Passos de Instalação
1. Faça login no [OpenHands Cloud](https://app.all-hands.dev)
2. Se você ainda não conectou sua conta GitHub:
- Clique em `Conectar ao GitHub`
- Revise e aceite os termos de serviço
- Autorize a aplicação OpenHands AI
## Adicionando Acesso ao Repositório
Você pode conceder ao OpenHands acesso a repositórios específicos:
1. Clique no menu suspenso `Selecionar um projeto GitHub`, depois selecione `Adicionar mais repositórios...`
2. Selecione sua organização e escolha os repositórios específicos para conceder acesso ao OpenHands.
- OpenHands solicita tokens de curta duração (expiração de 8 horas) com estas permissões:
- Ações: Leitura e escrita
- Administração: Somente leitura
- Status de commit: Leitura e escrita
- Conteúdos: Leitura e escrita
- Issues: Leitura e escrita
- Metadados: Somente leitura
- Pull requests: Leitura e escrita
- Webhooks: Leitura e escrita
- Workflows: Leitura e escrita
- O acesso ao repositório para um usuário é concedido com base em:
- Permissão concedida para o repositório
- Permissões do GitHub do usuário (proprietário/colaborador)
3. Clique em `Instalar e Autorizar`
## Modificando o Acesso ao Repositório
Você pode modificar o acesso ao repositório a qualquer momento:
* Usando o mesmo fluxo de trabalho `Selecionar um projeto GitHub > Adicionar mais repositórios`, ou
* Visitando a página de Configurações e selecionando `Configurar Repositórios GitHub` na seção `Configurações do GitHub`.
## Usando OpenHands com GitHub
Depois de conceder acesso ao repositório, você pode usar o OpenHands com seus repositórios GitHub.
Para detalhes sobre como usar o OpenHands com issues e pull requests do GitHub, consulte a documentação do [Resolvedor de Problemas na Nuvem](./cloud-issue-resolver.md).
## Próximos Passos
- [Acesse a Interface da Nuvem](./cloud-ui.md) para interagir com a interface web
- [Use o Resolvedor de Problemas na Nuvem](./cloud-issue-resolver.md) para automatizar correções de código e obter assistência
- [Use a API da Nuvem](./cloud-api.md) para interagir programaticamente com o OpenHands
@@ -1,50 +0,0 @@
# Instalação do GitLab
Este guia orienta você pelo processo de instalação e configuração do OpenHands Cloud para seus repositórios GitLab.
## Pré-requisitos
- Uma conta GitLab
- Acesso ao OpenHands Cloud
## Passos de Instalação
1. Faça login no [OpenHands Cloud](https://app.all-hands.dev)
2. Se você ainda não conectou sua conta GitLab:
- Clique em `Conectar ao GitLab`
- Revise e aceite os termos de serviço
- Autorize a aplicação OpenHands AI
## Adicionando Acesso ao Repositório
Você pode conceder ao OpenHands acesso a repositórios específicos:
1. Clique no menu suspenso `Selecionar um projeto GitLab`, depois selecione `Adicionar mais repositórios...`
2. Selecione sua organização e escolha os repositórios específicos para conceder acesso ao OpenHands.
- OpenHands solicita permissões com estes escopos:
- api: Acesso completo à API
- read_user: Ler informações do usuário
- read_repository: Ler informações do repositório
- write_repository: Escrever no repositório
- O acesso ao repositório para um usuário é concedido com base em:
- Permissão concedida para o repositório
- Permissões do GitLab do usuário (proprietário/mantenedor/desenvolvedor)
3. Clique em `Instalar e Autorizar`
## Modificando o Acesso ao Repositório
Você pode modificar o acesso ao repositório a qualquer momento:
* Usando o mesmo fluxo de trabalho `Selecionar um projeto GitLab > Adicionar mais repositórios`, ou
* Visitando a página de Configurações e selecionando `Configurar Repositórios GitLab` na seção `Configurações do GitLab`.
## Usando OpenHands com GitLab
Depois de conceder acesso ao repositório, você pode usar o OpenHands com seus repositórios GitLab.
Para detalhes sobre como usar o OpenHands com issues e merge requests do GitLab, consulte a documentação do [Resolvedor de Problemas na Nuvem](./cloud-issue-resolver.md).
## Próximos Passos
- [Acesse a Interface da Nuvem](./cloud-ui.md) para interagir com a interface web
- [Use o Resolvedor de Problemas na Nuvem](./cloud-issue-resolver.md) para automatizar correções de código e obter assistência
- [Use a API da Nuvem](./cloud-api.md) para interagir programaticamente com o OpenHands
@@ -1,24 +1,45 @@
# OpenHands Cloud
# Openhands Cloud
OpenHands Cloud é a versão hospedada na nuvem do OpenHands da All Hands AI.
O OpenHands Cloud é a versão hospedada na nuvem do OpenHands da All Hands AI.
## Acessando o OpenHands Cloud
Para começar com o OpenHands Cloud, visite [app.all-hands.dev](https://app.all-hands.dev).
Atualmente, os usuários estão sendo admitidos para acessar o OpenHands Cloud em ondas. Para se inscrever,
[entre na lista de espera](https://www.all-hands.dev/join-waitlist). Assim que for aprovado, você receberá um e-mail com
instruções sobre como acessá-lo.
Você será solicitado a se conectar com sua conta GitHub ou GitLab:
## Primeiros Passos
1. Após ler e aceitar os termos de serviço, clique em `Conectar ao GitHub` ou `Conectar ao GitLab`.
2. Revise as permissões solicitadas pelo OpenHands e autorize a aplicação.
- OpenHands exigirá certas permissões da sua conta. Para ler mais sobre essas permissões,
você pode clicar no link `Saiba mais` na página de autorização.
Após visitar o OpenHands Cloud, você será solicitado a se conectar com sua conta do GitHub:
1. Após ler e aceitar os termos de serviço, clique em `Connect to GitHub`.
2. Revise as permissões solicitadas pelo OpenHands e clique em `Authorize OpenHands AI`.
- O OpenHands exigirá algumas permissões da sua conta do GitHub. Para ler mais sobre essas permissões,
você pode clicar no link `Learn more` na página de autorização do GitHub.
## Próximos Passos
## Acesso ao Repositório
Depois de conectar sua conta, você pode:
### Adicionando Acesso ao Repositório
- [Instalar a Integração com GitHub](./github-installation.md) para usar o OpenHands com seus repositórios GitHub
- [Instalar a Integração com GitLab](./gitlab-installation.md) para usar o OpenHands com seus repositórios GitLab
- [Acessar a Interface da Nuvem](./cloud-ui.md) para interagir com a interface web
- [Usar a API da Nuvem](./cloud-api.md) para interagir programaticamente com o OpenHands
- [Configurar o Resolvedor de Problemas na Nuvem](./cloud-issue-resolver.md) para automatizar correções de código e fornecer assistência inteligente
Você pode conceder ao OpenHands acesso específico ao repositório:
1. Clique no menu suspenso `Select a GitHub project`, selecione `Add more repositories...`.
2. Selecione a organização e escolha os repositórios específicos para conceder acesso ao OpenHands.
- O Openhands solicita tokens de curta duração (expiração de 8 horas) com estas permissões:
- Actions: Read and write
- Administration: Read-only
- Commit statuses: Read and write
- Contents: Read and write
- Issues: Read and write
- Metadata: Read-only
- Pull requests: Read and write
- Webhooks: Read and write
- Workflows: Read and write
- O acesso ao repositório para um usuário é concedido com base em:
- Permissão concedida para o repositório.
- Permissões do GitHub do usuário (proprietário/colaborador).
3. Clique em `Install & Authorize`.
### Modificando o Acesso ao Repositório
Você pode modificar o acesso ao repositório a qualquer momento:
* Usando o mesmo fluxo de trabalho `Select a GitHub project > Add more repositories`, ou
* Visitando a página de Configurações e selecionando `Configure GitHub Repositories` na seção `GitHub Settings`.
@@ -0,0 +1,65 @@
# Openhands Cloud
OpenHands Cloud é a versão hospedada na nuvem do OpenHands pela All Hands AI.
## Acessando o OpenHands Cloud
O OpenHands Cloud pode ser acessado em https://app.all-hands.dev/.
Você também pode interagir com o OpenHands Cloud programaticamente usando a [API](./cloud-api).
## Primeiros Passos
Ao visitar o OpenHands Cloud, você será solicitado a conectar-se com sua conta GitHub ou GitLab:
1. Após ler e aceitar os termos de serviço, clique em `Log in with GitHub` ou `Log in with GitLab`.
2. Revise as permissões solicitadas pelo OpenHands e então clique em `Authorize OpenHands AI`.
- O OpenHands precisará de algumas permissões da sua conta GitHub ou GitLab. Para ler mais sobre essas permissões:
- GitHub: Você pode clicar no link `Learn more` na página de autorização do GitHub.
- GitLab: Você pode expandir cada solicitação de permissão na página de autorização do GitLab.
## Acesso ao Repositório
### GitHub
#### Adicionando Acesso ao Repositório
Você pode conceder ao OpenHands acesso específico ao repositório:
1. Clique em `Add GitHub repos` na página inicial.
2. Selecione a organização e, em seguida, escolha os repositórios específicos para conceder acesso ao OpenHands.
<details>
<summary>Detalhes de Permissão para Acesso ao Repositório</summary>
O Openhands solicita tokens de curta duração (expiração de 8 horas) com estas permissões:
- Actions: Leitura e escrita
- Administration: Somente leitura
- Commit statuses: Leitura e escrita
- Contents: Leitura e escrita
- Issues: Leitura e escrita
- Metadata: Somente leitura
- Pull requests: Leitura e escrita
- Webhooks: Leitura e escrita
- Workflows: Leitura e escrita
O acesso ao repositório para um usuário é concedido com base em:
- Permissão concedida para o repositório.
- Permissões do GitHub do usuário (proprietário/colaborador).
</details>
3. Clique em `Install & Authorize`.
#### Modificando o Acesso ao Repositório
Você pode modificar o acesso ao repositório do GitHub a qualquer momento:
* Usando o mesmo fluxo de trabalho `Add GitHub repos`, ou
* Visitando a página de Configurações e selecionando `Configure GitHub Repositories` na seção `Git Settings`.
### GitLab
Ao usar sua conta GitLab, o OpenHands terá automaticamente acesso aos seus repositórios.
## Persistência de Conversas
- Lista de Conversas Exibe apenas as 10 conversas mais recentes iniciadas nos últimos 10 dias.
- Workspaces Os workspaces de conversas são mantidos por 14 dias.
- Runtimes Os runtimes permanecem ativos ("aquecidos") por 30 minutos. Após esse período, retomar uma conversa pode levar de 1 a 2 minutos.
@@ -1,4 +1,4 @@
# Visão Geral das Funcionalidades do OpenHands
# Visão Geral dos Recursos do OpenHands
![visão geral](/img/oh-features.png)
@@ -6,7 +6,7 @@
- Exibe a conversa entre o usuário e o OpenHands.
- O OpenHands explica suas ações neste painel.
### Alterações
### Mudanças
- Mostra as alterações de arquivos realizadas pelo OpenHands.
### VS Code
@@ -14,13 +14,13 @@
- Também pode ser usado para fazer upload e download de arquivos.
### Terminal
- Um espaço para o OpenHands e usuários executarem comandos de terminal.
- Um espaço para o OpenHands e os usuários executarem comandos de terminal.
### Jupyter
- Mostra todos os comandos Python que foram executados pelo OpenHands.
- Particularmente útil ao usar o OpenHands para tarefas de visualização de dados.
- Particularmente útil ao usar o OpenHands para realizar tarefas de visualização de dados.
### Aplicativo
### App
- Exibe o servidor web quando o OpenHands executa uma aplicação.
- Os usuários podem interagir com a aplicação em execução.
@@ -13,7 +13,7 @@ recomendações para seleção de modelos. Nossos resultados de benchmarking mai
Com base nessas descobertas e feedback da comunidade, os seguintes modelos foram verificados e funcionam razoavelmente bem com o OpenHands:
- [anthropic/claude-sonnet-4-20250514](https://www.anthropic.com/api) (recomendado)
- [anthropic/claude-3-7-sonnet-20250219](https://www.anthropic.com/api) (recomendado)
- [gemini/gemini-2.5-pro](https://blog.google/technology/google-deepmind/gemini-model-thinking-updates-march-2025/)
- [deepseek/deepseek-chat](https://api-docs.deepseek.com/)
- [openai/o3-mini](https://openai.com/index/openai-o3-mini/)
@@ -0,0 +1,31 @@
# Cloud GitHub Resolver
GitHub Resolver 自动修复代码并为您的仓库提供智能辅助。
## 设置
当您[授予 OpenHands Cloud 仓库访问权限](./openhands-cloud#adding-repository-access)后,Cloud GitHub Resolver 会自动可用。
## 使用方法
授予 OpenHands Cloud 仓库访问权限后,您可以在仓库的 issues 和 pull requests 中使用 Cloud GitHub Resolver。
### Issues
在您的仓库中,给 issue 添加 `openhands` 标签。OpenHands 将会:
1. 在 issue 上发表评论,让您知道它正在处理该问题。
- 您可以点击链接在 OpenHands Cloud 上跟踪进度。
2. 如果确定问题已成功解决,则会打开一个 pull request。
3. 在 issue 上发表评论,总结已执行的任务并提供 pull request 的链接。
### Pull Requests
要让 OpenHands 处理 pull requests,请在顶级或内联评论中使用 `@openhands` 来:
- 提问
- 请求更新
- 获取代码解释
OpenHands 将会:
1. 在 PR 上发表评论,让您知道它正在处理该请求。
2. 执行任务。
@@ -1,32 +0,0 @@
# 云问题解决器
云问题解决器可以自动修复代码并为您的GitHub和GitLab仓库提供智能辅助。
## 设置
当您授予OpenHands Cloud仓库访问权限时,云问题解决器会自动可用:
- [GitHub仓库访问](./github-installation#adding-repository-access)
- [GitLab仓库访问](./gitlab-installation#adding-repository-access)
## 使用方法
授予OpenHands Cloud仓库访问权限后,您可以在仓库的问题和拉取/合并请求中使用云问题解决器。
### 处理问题
在您的仓库中,给问题添加`openhands`标签。OpenHands将会:
1. 在问题上发表评论,让您知道它正在处理
- 您可以点击链接在OpenHands Cloud上跟踪进度
2. 如果确定问题已成功解决,则打开拉取请求(GitHub)或合并请求(GitLab
3. 在问题上发表评论,总结已执行的任务并提供PR/MR的链接
### 处理拉取/合并请求
要让OpenHands处理拉取请求(GitHub)或合并请求(GitLab),在评论中提及`@openhands`以:
- 提问
- 请求更新
- 获取代码解释
OpenHands将会:
1. 发表评论让您知道它正在处理
2. 执行请求的任务
@@ -1,29 +0,0 @@
# 云界面
云界面为与OpenHands AI交互提供了网页界面。本页面说明如何访问和使用OpenHands云界面。
## 访问界面
OpenHands云界面可以在[app.all-hands.dev](https://app.all-hands.dev)访问。您需要使用GitHub或GitLab账户登录才能访问界面。
<!-- 图片将在未来更新中添加 -->
<!-- ![OpenHands云界面](/img/docs/openhands-cloud-ui.png) -->
## 主要功能
有关OpenHands云界面中可用功能的详细信息,请参阅文档的[主要功能](../key-features.md)部分。
## 设置
设置页面允许您:
1. 配置您的账户偏好
2. 管理仓库访问权限
3. 生成用于程序化访问的API密钥
4. 自定义您的OpenHands体验
## 下一步
- [使用云问题解决器](./cloud-issue-resolver.md)自动修复代码并获取帮助
- [了解云API](./cloud-api.md)进行程序化访问
- [返回入门指南](./openhands-cloud.md)
@@ -1,55 +0,0 @@
# GitHub 安装
本指南将引导您完成为GitHub仓库安装和配置OpenHands Cloud的过程。
## 前提条件
- GitHub账户
- 访问OpenHands Cloud
## 安装步骤
1. 登录[OpenHands Cloud](https://app.all-hands.dev)
2. 如果您尚未连接GitHub账户:
- 点击`连接到GitHub`
- 查看并接受服务条款
- 授权OpenHands AI应用程序
## 添加仓库访问权限
您可以授予OpenHands访问特定仓库的权限:
1. 点击`选择GitHub项目`下拉菜单,然后选择`添加更多仓库...`
2. 选择您的组织并选择要授予OpenHands访问权限的特定仓库。
- OpenHands请求短期令牌(8小时过期)并具有以下权限:
- 操作:读取和写入
- 管理:只读
- 提交状态:读取和写入
- 内容:读取和写入
- 问题:读取和写入
- 元数据:只读
- 拉取请求:读取和写入
- Webhooks:读取和写入
- 工作流程:读取和写入
- 用户的仓库访问权限基于:
- 为仓库授予的权限
- 用户的GitHub权限(所有者/协作者)
3. 点击`安装并授权`
## 修改仓库访问权限
您可以随时修改仓库访问权限:
* 使用相同的`选择GitHub项目 > 添加更多仓库`工作流程,或
* 访问设置页面并在`GitHub设置`部分选择`配置GitHub仓库`
## 使用OpenHands与GitHub
一旦您授予了仓库访问权限,您就可以将OpenHands与您的GitHub仓库一起使用。
有关如何将OpenHands与GitHub问题和拉取请求一起使用的详细信息,请参阅[云问题解决器](./cloud-issue-resolver.md)文档。
## 下一步
- [访问云界面](./cloud-ui.md)与网页界面交互
- [使用云问题解决器](./cloud-issue-resolver.md)自动修复代码并获取帮助
- [使用云API](./cloud-api.md)以编程方式与OpenHands交互
@@ -1,50 +0,0 @@
# GitLab 安装
本指南将引导您完成为GitLab仓库安装和配置OpenHands Cloud的过程。
## 前提条件
- GitLab账户
- 访问OpenHands Cloud
## 安装步骤
1. 登录[OpenHands Cloud](https://app.all-hands.dev)
2. 如果您尚未连接GitLab账户:
- 点击`连接到GitLab`
- 查看并接受服务条款
- 授权OpenHands AI应用程序
## 添加仓库访问权限
您可以授予OpenHands访问特定仓库的权限:
1. 点击`选择GitLab项目`下拉菜单,然后选择`添加更多仓库...`
2. 选择您的组织并选择要授予OpenHands访问权限的特定仓库。
- OpenHands请求具有以下范围的权限:
- api:完全API访问
- read_user:读取用户信息
- read_repository:读取仓库信息
- write_repository:写入仓库
- 用户的仓库访问权限基于:
- 为仓库授予的权限
- 用户的GitLab权限(所有者/维护者/开发者)
3. 点击`安装并授权`
## 修改仓库访问权限
您可以随时修改仓库访问权限:
* 使用相同的`选择GitLab项目 > 添加更多仓库`工作流程,或
* 访问设置页面并在`GitLab设置`部分选择`配置GitLab仓库`
## 使用OpenHands与GitLab
一旦您授予了仓库访问权限,您就可以将OpenHands与您的GitLab仓库一起使用。
有关如何将OpenHands与GitLab问题和合并请求一起使用的详细信息,请参阅[云问题解决器](./cloud-issue-resolver.md)文档。
## 下一步
- [访问云界面](./cloud-ui.md)与网页界面交互
- [使用云问题解决器](./cloud-issue-resolver.md)自动修复代码并获取帮助
- [使用云API](./cloud-api.md)以编程方式与OpenHands交互
@@ -1,24 +0,0 @@
# OpenHands 云
OpenHands 云是All Hands AI的OpenHands的托管云版本。
## 访问OpenHands云
要开始使用OpenHands云,请访问[app.all-hands.dev](https://app.all-hands.dev)。
系统将提示您连接您的GitHub或GitLab账户:
1. 阅读并接受服务条款后,点击`连接到GitHub``连接到GitLab`
2. 查看OpenHands请求的权限并授权应用程序。
- OpenHands将需要您账户的某些权限。要了解更多关于这些权限的信息,
您可以点击授权页面上的`了解更多`链接。
## 下一步
一旦您连接了账户,您可以:
- [安装GitHub集成](./github-installation.md)以将OpenHands与您的GitHub仓库一起使用
- [安装GitLab集成](./gitlab-installation.md)以将OpenHands与您的GitLab仓库一起使用
- [访问云界面](./cloud-ui.md)与网页界面交互
- [使用云API](./cloud-api.md)以编程方式与OpenHands交互
- [设置云问题解决器](./cloud-issue-resolver.md)自动修复代码并提供智能辅助
@@ -0,0 +1,65 @@
# OpenHands Cloud
OpenHands Cloud 是由 All Hands AI 提供的 OpenHands 云托管版本。
## 访问 OpenHands Cloud
OpenHands Cloud 可以通过 https://app.all-hands.dev/ 访问。
您还可以使用 [API](./cloud-api) 以编程方式与 OpenHands Cloud 交互。
## 入门指南
访问 OpenHands Cloud 后,系统会要求您连接您的 GitHub 或 GitLab 账户:
1. 阅读并接受服务条款后,点击 `Log in with GitHub` 或 `Log in with GitLab`。
2. 查看 OpenHands 请求的权限,然后点击 `Authorize OpenHands AI`。
- OpenHands 将需要您的 GitHub 或 GitLab 账户的一些权限。要了解更多关于这些权限的信息:
- GitHub:您可以点击 GitHub 授权页面上的 `Learn more` 链接。
- GitLab:您可以在 GitLab 授权页面上展开每个权限请求。
## 仓库访问
### GitHub
#### 添加仓库访问权限
您可以授予 OpenHands 特定仓库的访问权限:
1. 在首页点击 `Add GitHub repos`。
2. 选择组织,然后选择要授予 OpenHands 访问权限的特定仓库。
<details>
<summary>仓库访问权限详情</summary>
Openhands 请求短期令牌(8小时过期)并具有以下权限:
- Actions:读写权限
- Administration:只读权限
- Commit statuses:读写权限
- Contents:读写权限
- Issues:读写权限
- Metadata:只读权限
- Pull requests:读写权限
- Webhooks:读写权限
- Workflows:读写权限
用户的仓库访问权限基于:
- 为仓库授予的权限。
- 用户的 GitHub 权限(所有者/协作者)。
</details>
3. 点击 `Install & Authorize`。
#### 修改仓库访问权限
您可以随时修改 GitHub 仓库访问权限,方法是:
* 使用相同的 `Add GitHub repos` 流程,或
* 访问设置页面,在 `Git Settings` 部分下选择 `Configure GitHub Repositories`。
### GitLab
使用 GitLab 账户时,OpenHands 将自动获得对您仓库的访问权限。
## 对话持久性
- 对话列表 – 仅显示过去 10 天内发起的 10 个最近对话。
- 工作区 – 对话工作区保留 14 天。
- 运行时 – 运行时保持活跃("热"状态)30 分钟。在此期间后,恢复对话可能需要 1-2 分钟。
@@ -1,6 +1,6 @@
# OpenHands 功能概览
![概览](/img/oh-features.png)
![overview](/img/oh-features.png)
### 聊天面板
- 显示用户与 OpenHands 之间的对话。
@@ -22,7 +22,7 @@
### 应用
- 当 OpenHands 运行应用程序时显示网络服务器。
- 用户可以与正在运行的应用程序交互。
- 用户可以与运行的应用程序交互。
### 浏览器
- 由 OpenHands 用于浏览网站。
@@ -12,7 +12,7 @@ OpenHands 可以连接到任何 LiteLLM 支持的 LLM。但是,它需要一个
基于这些发现和社区反馈,以下模型已被验证可以与 OpenHands 合理地配合使用:
- [anthropic/claude-sonnet-4-20250514](https://www.anthropic.com/api)(推荐)
- [anthropic/claude-3-7-sonnet-20250219](https://www.anthropic.com/api)(推荐)
- [gemini/gemini-2.5-pro](https://blog.google/technology/google-deepmind/gemini-model-thinking-updates-march-2025/)
- [deepseek/deepseek-chat](https://api-docs.deepseek.com/)
- [openai/o3-mini](https://openai.com/index/openai-o3-mini/)
+1 -1
View File
@@ -1,4 +1,4 @@
# Cloud API
# OpenHands Cloud API
OpenHands Cloud provides a REST API that allows you to programmatically interact with the service. This is useful if
you want to kick off your own jobs from your programs in a flexible way.
@@ -0,0 +1,33 @@
# Cloud GitHub Resolver
The GitHub Resolver automates code fixes and provides intelligent assistance for your repositories.
## Setup
The Cloud GitHub Resolver is available automatically when you
[grant OpenHands Cloud repository access](./openhands-cloud#adding-repository-access).
## Usage
After granting OpenHands Cloud repository access, you can use the Cloud GitHub Resolver on the issues and pull requests
on the repository.
### Issues
On your repository, label an issue with `openhands`. OpenHands will:
1. Comment on the issue to let you know it is working on it.
- You can click on the link to track the progress on OpenHands Cloud.
2. Open a pull request if it determines that the issue has been successfully resolved.
3. Comment on the issue with a summary of the performed tasks and a link to the pull request.
### Pull Requests
To get OpenHands to work on pull requests, use `@openhands` in top level or inline comments to:
- Ask questions
- Request updates
- Get code explanations
OpenHands will:
1. Comment on the PR to let you know it is working on it.
2. Perform the task.
@@ -1,32 +0,0 @@
# Cloud Issue Resolver
The Cloud Issue Resolver automates code fixes and provides intelligent assistance for your repositories on GitHub.
## Setup
The Cloud Issue Resolver is available automatically when you grant OpenHands Cloud repository access:
- [GitHub repository access](./github-installation#adding-repository-access)
## Usage
After granting OpenHands Cloud repository access, you can use the Cloud Issue Resolver on issues and pull requests in your repositories.
### Working with Issues
On your repository, label an issue with `openhands` or add a message starting with
`@openhands`. OpenHands will:
1. Comment on the issue to let you know it is working on it
- You can click on the link to track the progress on OpenHands Cloud
2. Open a pull request if it determines that the issue has been successfully resolved
3. Comment on the issue with a summary of the performed tasks and a link to the PR
### Working with Pull Requests
To get OpenHands to work on pull requests, mention `@openhands` in comments to:
- Ask questions
- Request updates
- Get code explanations
OpenHands will:
1. Comment to let you know it is working on it
2. Perform the requested task
-26
View File
@@ -1,26 +0,0 @@
# Cloud UI
The Cloud UI provides a web interface for interacting with OpenHands AI. This page explains how to access and use the OpenHands Cloud UI.
## Accessing the UI
The OpenHands Cloud UI can be accessed at [app.all-hands.dev](https://app.all-hands.dev). You'll need to sign in with your GitHub or GitLab account to access the interface.
## Key Features
For detailed information about the features available in the OpenHands Cloud UI, please refer to the [Key Features](../key-features.md) section of the documentation.
## Settings
The settings page allows you to:
- Configure your account preferences.
- Manage repository access.
- Generate API keys for programmatic access.
- Generate custom secrets for the agent.
## Next Steps
- [Use the Cloud Issue Resolver](./cloud-issue-resolver.md) to automate code fixes and get assistance.
- [Learn about the Cloud API](./cloud-api.md) for programmatic access.
@@ -1,53 +0,0 @@
# GitHub Installation
This guide walks you through the process of installing and configuring OpenHands Cloud for your GitHub repositories.
## Prerequisites
- A GitHub account
- Access to OpenHands Cloud
## Installation Steps
1. Log in to [OpenHands Cloud](https://app.all-hands.dev)
2. If you haven't connected your GitHub account yet:
- Click on `Connect to GitHub`
- Review and accept the terms of service
- Authorize the OpenHands AI application
## Adding Repository Access
You can grant OpenHands access to specific repositories:
1. Click on `Add GitHub repos`
2. Select your organization and choose the specific repositories to grant OpenHands access to.
- OpenHands requests short-lived tokens (8-hour expiration) with these permissions:
- Actions: Read and write
- Administration: Read-only
- Commit statuses: Read and write
- Contents: Read and write
- Issues: Read and write
- Metadata: Read-only
- Pull requests: Read and write
- Webhooks: Read and write
- Workflows: Read and write
- Repository access for a user is granted based on:
- Permission granted for the repository
- User's GitHub permissions (owner/collaborator)
3. Click `Install & Authorize`
## Modifying Repository Access
You can modify repository access at any time by visiting the Settings page and selecting `Configure GitHub Repositories` under the `Git` tab.
## Using OpenHands with GitHub
Once you've granted repository access, you can use OpenHands with your GitHub repositories.
For details on how to use OpenHands with GitHub issues and pull requests, see the [Cloud Issue Resolver](./cloud-issue-resolver.md) documentation.
## Next Steps
- [Access the Cloud UI](./cloud-ui.md) to interact with the web interface
- [Use the Cloud Issue Resolver](./cloud-issue-resolver.md) to automate code fixes and get assistance
- [Use the Cloud API](./cloud-api.md) to programmatically interact with OpenHands
@@ -1,22 +0,0 @@
# GitLab Installation
This guide walks you through the process of installing and configuring OpenHands Cloud for your GitLab repositories.
## Prerequisites
- A GitLab account
- Access to OpenHands Cloud
## Installation Steps
1. Log in to [OpenHands Cloud](https://app.all-hands.dev)
2. If you haven't connected your GitLab account yet:
- Click on `Log in with GitLab`
- Authorize the OpenHands application
## Next Steps
- [Access the Cloud UI](./cloud-ui.md) to interact with the web interface
- [Use the Cloud API](./cloud-api.md) to programmatically interact with OpenHands
@@ -1,24 +0,0 @@
# OpenHands Cloud
OpenHands Cloud is the hosted cloud version of All Hands AI's OpenHands.
## Accessing OpenHands Cloud
To get started with OpenHands Cloud, visit [app.all-hands.dev](https://app.all-hands.dev).
You'll be prompted to connect with your GitHub or GitLab account:
1. Click `Log in with GitHub` or `Log in with GitLab`.
2. Review the permissions requested by OpenHands and authorize the application.
- OpenHands will require certain permissions from your account. To read more about these permissions,
you can click the `Learn more` link on the authorization page.
## Next Steps
Once you've connected your account, you can:
- [Install GitHub Integration](./github-installation.md) to use OpenHands with your GitHub repositories
- [Install GitLab Integration](./gitlab-installation.md) to use OpenHands with your GitLab repositories
- [Access the Cloud UI](./cloud-ui.md) to interact with the web interface
- [Use the Cloud API](./cloud-api.md) to programmatically interact with OpenHands
- [Set up the Cloud Issue Resolver](./cloud-issue-resolver.md) to automate code fixes and provide intelligent assistance
+1 -1
View File
@@ -23,7 +23,7 @@ This command opens an interactive prompt where you can type tasks or commands an
1. Set the following environment variables in your terminal:
- `SANDBOX_VOLUMES` to specify the directory you want OpenHands to access ([See using SANDBOX_VOLUMES for more info](../runtimes/docker#using-sandbox_volumes))
- `LLM_MODEL` - the LLM model to use (e.g. `export LLM_MODEL="anthropic/claude-sonnet-4-20250514"`)
- `LLM_MODEL` - the LLM model to use (e.g. `export LLM_MODEL="anthropic/claude-3-7-sonnet-20250219"`)
- `LLM_API_KEY` - your API key (e.g. `export LLM_API_KEY="sk_test_12345"`)
2. Run the following command:
+1 -1
View File
@@ -14,7 +14,7 @@ The following `launch.json` will allow debugging the agent, controller and serve
"name": "OpenHands CLI",
"type": "debugpy",
"request": "launch",
"module": "openhands.cli.main",
"module": "openhands.core.cli",
"justMyCode": false
},
{
+1 -1
View File
@@ -23,7 +23,7 @@ To run OpenHands in Headless mode with Docker:
1. Set the following environment variables in your terminal:
- `SANDBOX_VOLUMES` to specify the directory you want OpenHands to access ([See using SANDBOX_VOLUMES for more info](../runtimes/docker#using-sandbox_volumes))
- `LLM_MODEL` - the LLM model to use (e.g. `export LLM_MODEL="anthropic/claude-sonnet-4-20250514"`)
- `LLM_MODEL` - the LLM model to use (e.g. `export LLM_MODEL="anthropic/claude-3-7-sonnet-20250219"`)
- `LLM_API_KEY` - your API key (e.g. `export LLM_API_KEY="sk_test_12345"`)
2. Run the following Docker command:
+1 -1
View File
@@ -13,7 +13,7 @@ recommendations for model selection. Our latest benchmarking results can be foun
Based on these findings and community feedback, these are the latest models that have been verified to work reasonably well with OpenHands:
- [anthropic/claude-sonnet-4-20250514](https://www.anthropic.com/api) (recommended)
- [anthropic/claude-3-7-sonnet-20250219](https://www.anthropic.com/api) (recommended)
- [openai/o4-mini](https://openai.com/index/introducing-o3-and-o4-mini/)
- [gemini/gemini-2.5-pro](https://blog.google/technology/google-deepmind/gemini-model-thinking-updates-march-2025/)
- [deepseek/deepseek-chat](https://api-docs.deepseek.com/)
+4 -4
View File
@@ -27,7 +27,7 @@
"@docusaurus/tsconfig": "^3.7.0",
"@docusaurus/types": "^3.5.1",
"swagger-cli": "^4.0.4",
"swagger-ui-dist": "^5.22.0",
"swagger-ui-dist": "^5.21.0",
"typescript": "~5.8.3"
},
"engines": {
@@ -18730,9 +18730,9 @@
}
},
"node_modules/swagger-ui-dist": {
"version": "5.22.0",
"resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.22.0.tgz",
"integrity": "sha512-8YlCSxiyb8uPFa7qoB1lRHYr1PBbT1NuV9RvQdFFPFPudRBTPf9coU5jl02KhzvrtmTEw4jXRgb0kg8pJvVuWQ==",
"version": "5.21.0",
"resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.21.0.tgz",
"integrity": "sha512-E0K3AB6HvQd8yQNSMR7eE5bk+323AUxjtCz/4ZNKiahOlPhPJxqn3UPIGs00cyY/dhrTDJ61L7C/a8u6zhGrZg==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
+1 -1
View File
@@ -36,7 +36,7 @@
"@docusaurus/tsconfig": "^3.7.0",
"@docusaurus/types": "^3.5.1",
"swagger-cli": "^4.0.4",
"swagger-ui-dist": "^5.22.0",
"swagger-ui-dist": "^5.21.0",
"typescript": "~5.8.3"
},
"browserslist": {
+6 -27
View File
@@ -24,40 +24,19 @@ const sidebars: SidebarsConfig = {
items: [
{
type: 'doc',
label: 'Getting Started',
label: 'Openhands Cloud',
id: 'usage/cloud/openhands-cloud',
},
{
type: 'category',
label: 'Installation',
items: [
{
type: 'doc',
label: 'GitHub Installation',
id: 'usage/cloud/github-installation',
},
{
type: 'doc',
label: 'GitLab Installation',
id: 'usage/cloud/gitlab-installation',
},
],
},
{
type: 'doc',
label: 'Cloud UI',
id: 'usage/cloud/cloud-ui',
},
{
type: 'doc',
label: 'Cloud Issue Resolver',
id: 'usage/cloud/cloud-issue-resolver',
},
{
type: 'doc',
label: 'Cloud API',
id: 'usage/cloud/cloud-api',
},
{
type: 'doc',
label: 'Cloud GitHub Resolver',
id: 'usage/cloud/cloud-github-resolver',
},
],
},
{
+1 -1
View File
@@ -57,7 +57,7 @@ def translate_content(content, target_lang):
system_prompt = f'You are a professional translator. Translate the following content into {target_lang}. Preserve all Markdown formatting, code blocks, and front matter. Keep any {{% jsx %}} tags and similar intact. Do not translate code examples, URLs, or technical terms.'
message = client.messages.create(
model='claude-sonnet-4-20250514',
model='claude-3-7-sonnet-20250219',
max_tokens=4096,
temperature=0,
system=system_prompt,
-31
View File
@@ -42,37 +42,6 @@ api_key = "XXX"
temperature = 0.0
```
### Configuring Condensers for Evaluation
For benchmarks that support condenser configuration (like SWE-Bench), you can define multiple condenser configurations in your `config.toml` file. A condenser is responsible for managing conversation history to maintain context while staying within token limits - you can learn more about how it works [here](https://www.all-hands.dev/blog/openhands-context-condensensation-for-more-efficient-ai-agents):
```toml
# LLM-based summarizing condenser for evaluation
[condenser.summarizer_for_eval]
type = "llm"
llm_config = "haiku" # Reference to an LLM config to use for summarization
keep_first = 2 # Number of initial events to always keep
max_size = 100 # Maximum size of history before triggering summarization
# Recent events condenser for evaluation
[condenser.recent_for_eval]
type = "recent"
keep_first = 2 # Number of initial events to always keep
max_events = 50 # Maximum number of events to keep in history
```
You can then specify which condenser configuration to use when running evaluation scripts, for example:
```bash
EVAL_CONDENSER=summarizer_for_eval \
./evaluation/benchmarks/swe_bench/scripts/run_infer.sh llm.eval_gpt4_1106_preview HEAD CodeActAgent 500 100 1 princeton-nlp/SWE-bench_Verified test
```
The name is up to you, but should match a name defined in your `config.toml` file. The last argument in the command specifies the condenser configuration to use. In this case, `summarizer_for_eval` is used, which refers to the LLM-based summarizing condenser as defined above.
If no condenser configuration is specified, the 'noop' condenser will be used by default, which keeps the full conversation history.
```
For other configurations specific to evaluation, such as `save_trajectory_path`, these are typically set in the `get_config` function of the respective `run_infer.py` file for each benchmark.
## Supported Benchmarks
+3 -12
View File
@@ -45,7 +45,7 @@ For example, for instance ID `django_django-11011`, it will try to pull our pre-
This image will be used create an OpenHands runtime image where the agent will operate on.
```bash
./evaluation/benchmarks/swe_bench/scripts/run_infer.sh [model_config] [git-version] [agent] [eval_limit] [max_iter] [num_workers] [dataset] [dataset_split] [n_runs] [mode]
./evaluation/benchmarks/swe_bench/scripts/run_infer.sh [model_config] [git-version] [agent] [eval_limit] [max_iter] [num_workers] [dataset] [dataset_split]
# Example
./evaluation/benchmarks/swe_bench/scripts/run_infer.sh llm.eval_gpt4_1106_preview HEAD CodeActAgent 500 100 1 princeton-nlp/SWE-bench_Verified test
@@ -69,20 +69,13 @@ default, it is set to 1.
- `dataset`, a huggingface dataset name. e.g. `princeton-nlp/SWE-bench`, `princeton-nlp/SWE-bench_Lite`, `princeton-nlp/SWE-bench_Verified`, or `princeton-nlp/SWE-bench_Multimodal`, specifies which dataset to evaluate on.
- `dataset_split`, split for the huggingface dataset. e.g., `test`, `dev`. Default to `test`.
- `n_runs`, e.g. `3`, is the number of times to run the evaluation. Default is 1.
- `mode`, e.g. `swt`, `swt-ci`, or `swe`, specifies the evaluation mode. Default is `swe`.
> [!CAUTION]
> Setting `num_workers` larger than 1 is not officially tested, YMMV.
There are also optional environment variables you can set:
There is also one optional environment variable you can set.
```bash
# Use hint text in the evaluation (default: false)
export USE_HINT_TEXT=true # Ignore this if you are not sure.
# Specify a condenser configuration for memory management (default: NoOpCondenser)
export EVAL_CONDENSER=summarizer_for_eval # Name of the condenser config group in config.toml
export USE_HINT_TEXT=true # if you want to use hint text in the evaluation. Default to false. Ignore this if you are not sure.
```
Let's say you'd like to run 10 instances using `llm.eval_gpt4_1106_preview` and CodeActAgent,
@@ -158,8 +151,6 @@ The script now accepts optional arguments:
- `instance_id`: Specify a single instance to evaluate (optional)
- `dataset_name`: The name of the dataset to use (default: `"princeton-nlp/SWE-bench_Lite"`)
- `split`: The split of the dataset to use (default: `"test"`)
- `environment`: The environment to use for patch evaluation (default: `"local"`). You can set it to
`"modal"` to use [official SWE-Bench support](https://github.com/swe-bench/SWE-bench/blob/main/docs/assets/evaluation.md#%EF%B8%8F-evaluation-with-modal) for running evaluation on Modal.
For example, to evaluate a specific instance with a custom dataset and split:
@@ -1,69 +0,0 @@
TASK_INSTRUECTION="""
Given the following GitHub problem description, your objective is to localize the specific files, classes or functions, and lines of code that need modification or contain key information to resolve the issue.
Follow these steps to localize the issue:
## Step 1: Categorize and Extract Key Problem Information
- Classify the problem statement into the following categories:
Problem description, error trace, code to reproduce the bug, and additional context.
- Identify modules in the '{package_name}' package mentioned in each category.
- Use extracted keywords and line numbers to search for relevant code references for additional context.
## Step 2: Locate Referenced Modules
- Accurately determine specific modules
- Explore the repo to familiarize yourself with its structure.
- Analyze the described execution flow to identify specific modules or components being referenced.
- Pay special attention to distinguishing between modules with similar names using context and described execution flow.
- Output Format for collected relevant modules:
- Use the format: 'file_path:QualifiedName'
- E.g., for a function `calculate_sum` in the `MathUtils` class located in `src/helpers/math_helpers.py`, represent it as: 'src/helpers/math_helpers.py:MathUtils.calculate_sum'.
## Step 3: Analyze and Reproducing the Problem
- Clarify the Purpose of the Issue
- If expanding capabilities: Identify where and how to incorporate new behavior, fields, or modules.
- If addressing unexpected behavior: Focus on localizing modules containing potential bugs.
- Reconstruct the execution flow
- Identify main entry points triggering the issue.
- Trace function calls, class interactions, and sequences of events.
- Identify potential breakpoints causing the issue.
Important: Keep the reconstructed flow focused on the problem, avoiding irrelevant details.
## Step 4: Locate Areas for Modification
- Locate specific files, functions, or lines of code requiring changes or containing critical information for resolving the issue.
- Consider upstream and downstream dependencies that may affect or be affected by the issue.
- If applicable, identify where to introduce new fields, functions, or variables.
- Think Thoroughly: List multiple potential solutions and consider edge cases that could impact the resolution.
## Output Format for Final Results:
Your final output should list the locations requiring modification, wrapped with triple backticks ```
Each location should include the file path, class name (if applicable), function name, or line numbers, ordered by importance.
Your answer would better include about 5 files.
### Examples:
```
full_path1/file1.py
line: 10
class: MyClass1
function: my_function1
full_path2/file2.py
line: 76
function: MyClass2.my_function2
full_path3/file3.py
line: 24
line: 156
function: my_function3
```
Return just the location(s)
Note: Your thinking should be thorough and so it's fine if it's very long.
"""
FAKE_USER_MSG_FOR_LOC = (
'Verify if the found locations contain all the necessary information to address the issue, and check for any relevant references in other parts of the codebase that may not have appeared in the search results. '
'If not, continue searching for additional locations related to the issue.\n'
'Verify that you have carefully analyzed the impact of the found locations on the repository, especially their dependencies. '
'If you think you have solved the task, please send your final answer (including the former answer and reranking) to user through message and then call `finish` to finish.\n'
'IMPORTANT: YOU SHOULD NEVER ASK FOR HUMAN HELP.\n'
)
@@ -44,8 +44,6 @@ from openhands.core.config import (
get_llm_config_arg,
get_parser,
)
from openhands.core.config.utils import get_condenser_config_arg
from openhands.core.config.condenser_config import NoOpCondenserConfig
from openhands.core.logger import openhands_logger as logger
from openhands.core.main import create_runtime, run_controller
from openhands.critic import AgentFinishedCritic
@@ -758,7 +756,6 @@ if __name__ == '__main__':
choices=['swe', 'swt', 'swt-ci'],
help="mode to run the evaluation, either 'swe', 'swt', or 'swt-ci'",
)
args, _ = parser.parse_known_args()
# NOTE: It is preferable to load datasets from huggingface datasets and perform post-processing
@@ -795,19 +792,6 @@ if __name__ == '__main__':
if llm_config is None:
raise ValueError(f'Could not find LLM config: --llm_config {args.llm_config}')
# Get condenser config from environment variable
condenser_name = os.environ.get('EVAL_CONDENSER')
if condenser_name:
condenser_config = get_condenser_config_arg(condenser_name)
if condenser_config is None:
raise ValueError(
f'Could not find Condenser config: EVAL_CONDENSER={condenser_name}'
)
else:
# If no specific condenser config is provided via env var, default to NoOpCondenser
condenser_config = NoOpCondenserConfig()
logger.debug('No Condenser config provided via EVAL_CONDENSER, using NoOpCondenser.')
details = {'mode': args.mode}
_agent_cls = openhands.agenthub.Agent.get_cls(args.agent_cls)
@@ -822,7 +806,6 @@ if __name__ == '__main__':
args.eval_note,
args.eval_output_dir,
details=details,
condenser_config=condenser_config,
)
output_file = os.path.join(metadata.eval_output_dir, 'output.jsonl')
@@ -1,713 +0,0 @@
import asyncio
import json
import os
import tempfile
from typing import Any
import pandas as pd
import toml
from datasets import load_dataset
import openhands.agenthub
from evaluation.benchmarks.swe_bench.resource.mapping import (
get_instance_resource_factor,
)
from evaluation.utils.shared import (
EvalException,
EvalMetadata,
EvalOutput,
assert_and_raise,
codeact_user_response,
get_default_sandbox_config_for_eval,
get_metrics,
is_fatal_evaluation_error,
make_metadata,
prepare_dataset,
reset_logger_for_multiprocessing,
run_evaluation,
update_llm_config_for_completions_logging,
)
from openhands.controller.state.state import State
from openhands.core.config import (
AgentConfig,
AppConfig,
get_llm_config_arg,
get_parser,
)
from openhands.core.logger import openhands_logger as logger
from openhands.core.main import create_runtime, run_controller
from openhands.events.action import CmdRunAction, MessageAction
from openhands.events.observation import CmdOutputObservation, ErrorObservation
from openhands.events.serialization.event import event_to_dict
from openhands.runtime.base import Runtime
from openhands.utils.async_utils import call_async_from_sync
from openhands.utils.shutdown_listener import sleep_if_should_continue
USE_HINT_TEXT = os.environ.get('USE_HINT_TEXT', 'false').lower() == 'true'
RUN_WITH_BROWSING = os.environ.get('RUN_WITH_BROWSING', 'false').lower() == 'true'
INDEX_BASE_DIR = os.environ.get('INDEX_BASE_DIR', '')
AGENT_CLS_TO_FAKE_USER_RESPONSE_FN = {
'CodeActAgent': codeact_user_response,
'LocAgent': codeact_user_response,
}
def _get_swebench_workspace_dir_name(instance: pd.Series) -> str:
return f'{instance.repo}__{instance.version}'.replace('/', '__')
def get_instruction(instance: pd.Series, metadata: EvalMetadata):
workspace_dir_name = _get_swebench_workspace_dir_name(instance)
instruction = f"""
Consider the following issue description:
<issue_description>
{instance.problem_statement}
</issue_description>
Your objective is to localize the specific files, classes or functions, and lines of code that need modification or contain key information to resolve the issue.
Follow these steps to localize the issue:
## Step 1: Categorize and Extract Key Problem Information
- Classify the problem statement into the following categories:
Problem description, error trace, code to reproduce the bug, and additional context.
- Identify modules in the "{instance.instance_id.split('_')[0]}" package mentioned in each category.
- Use extracted keywords and line numbers to search for relevant code references for additional context.
## Step 2: Locate Referenced Modules
- Accurately determine specific modules
- Explore the repo to familiarize yourself with its structure.
- Analyze the described execution flow to identify specific modules or components being referenced.
- Pay special attention to distinguishing between modules with similar names using context and described execution flow.
- Output Format for collected relevant modules:
- Use the format: 'file_path:QualifiedName'
- E.g., for a function `calculate_sum` in the `MathUtils` class located in `src/helpers/math_helpers.py`, represent it as: 'src/helpers/math_helpers.py:MathUtils.calculate_sum'.
## Step 3: Analyze and Reproducing the Problem
- Clarify the Purpose of the Issue
- If expanding capabilities: Identify where and how to incorporate new behavior, fields, or modules.
- If addressing unexpected behavior: Focus on localizing modules containing potential bugs.
- Reconstruct the execution flow
- Identify main entry points triggering the issue.
- Trace function calls, class interactions, and sequences of events.
- Identify potential breakpoints causing the issue.
Important: Keep the reconstructed flow focused on the problem, avoiding irrelevant details.
## Step 4: Locate Areas for Modification
- Locate specific files, functions, or lines of code requiring changes or containing critical information for resolving the issue.
- Consider upstream and downstream dependencies that may affect or be affected by the issue.
- If applicable, identify where to introduce new fields, functions, or variables.
- Think Thoroughly: List multiple potential solutions and consider edge cases that could impact the resolution.
## Output Format for Final Results:
Your final output should list the locations requiring modification, wrapped with triple backticks ```
Each location should include the file path, class name (if applicable), function name, or line numbers, ordered by importance.
Your answer would better include about 5 files.
### Examples:
```
full_path1/file1.py
line: 10
class: MyClass1
function: my_function1
full_path2/file2.py
line: 76
function: MyClass2.my_function2
full_path3/file3.py
line: 24
line: 156
function: my_function3
```
Return just the location(s)
Note: Your thinking should be thorough and so it's fine if it's very long.
"""
instruction += (
'IMPORTANT: You should ONLY interact with the environment provided to you AND NEVER ASK FOR HUMAN HELP.\n'
"Don't include any lambda functions!\n"
'You should NOT modify any files!\n'
)
if RUN_WITH_BROWSING:
instruction += """
<IMPORTANT!>
You SHOULD NEVER attempt to browse the web.
</IMPORTANT!>
"""
return instruction
# TODO: migrate all swe-bench docker to ghcr.io/openhands
DEFAULT_DOCKER_IMAGE_PREFIX = os.environ.get(
'EVAL_DOCKER_IMAGE_PREFIX', 'docker.io/xingyaoww/'
)
logger.info(f'Default docker image prefix: {DEFAULT_DOCKER_IMAGE_PREFIX}')
def get_instance_docker_image(instance_id: str, official_image: bool = False) -> str:
if official_image:
# Official SWE-Bench image
# swebench/sweb.eval.x86_64.django_1776_django-11333:v1
docker_image_prefix = 'docker.io/swebench/'
repo, name = instance_id.split('__')
image_name = f'sweb.eval.x86_64.{repo}_1776_{name}:latest'
logger.warning(f'Using official SWE-Bench image: {image_name}')
else:
# OpenHands version of the image
docker_image_prefix = DEFAULT_DOCKER_IMAGE_PREFIX
image_name = 'sweb.eval.x86_64.' + instance_id
image_name = image_name.replace(
'__', '_s_'
) # to comply with docker image naming convention
return (docker_image_prefix.rstrip('/') + '/' + image_name).lower()
def get_config(
instance: pd.Series,
metadata: EvalMetadata,
) -> AppConfig:
# We use a different instance image for the each instance of swe-bench eval
use_official_image = bool(
'verified' in metadata.dataset.lower() or 'lite' in metadata.dataset.lower()
)
base_container_image = get_instance_docker_image(
instance['instance_id'], use_official_image
)
logger.info(
f'Using instance container image: {base_container_image}. '
f'Please make sure this image exists. '
f'Submit an issue on https://github.com/All-Hands-AI/OpenHands if you run into any issues.'
)
sandbox_config = get_default_sandbox_config_for_eval()
sandbox_config.base_container_image = base_container_image
sandbox_config.enable_auto_lint = True
sandbox_config.use_host_network = False
# Add platform to the sandbox config to solve issue 4401
sandbox_config.platform = 'linux/amd64'
sandbox_config.remote_runtime_resource_factor = get_instance_resource_factor(
dataset_name=metadata.dataset,
instance_id=instance['instance_id'],
)
workspace_dir_name = _get_swebench_workspace_dir_name(instance)
sandbox_config.runtime_startup_env_vars = {
'REPO_PATH': f'/workspace/{workspace_dir_name}/',
}
config = AppConfig(
default_agent=metadata.agent_class,
run_as_openhands=False,
max_iterations=metadata.max_iterations,
runtime=os.environ.get('RUNTIME', 'docker'),
sandbox=sandbox_config,
# do not mount workspace
workspace_base=None,
workspace_mount_path=None,
)
config.set_llm_config(
update_llm_config_for_completions_logging(
metadata.llm_config, metadata.eval_output_dir, instance['instance_id']
)
)
agent_config = AgentConfig(
enable_jupyter=False,
enable_browsing=RUN_WITH_BROWSING,
enable_llm_editor=False,
condenser=metadata.condenser_config,
enable_prompt_extensions=False,
)
config.set_agent_config(agent_config)
return config
def initialize_runtime(
runtime: Runtime,
instance: pd.Series, # this argument is not required
):
"""Initialize the runtime for the agent.
This function is called before the runtime is used to run the agent.
"""
logger.info('-' * 30)
logger.info('BEGIN Runtime Initialization Fn')
logger.info('-' * 30)
workspace_dir_name = _get_swebench_workspace_dir_name(instance)
obs: CmdOutputObservation
# Set instance id
action = CmdRunAction(
command=f"""echo 'export SWE_INSTANCE_ID={instance['instance_id']}' >> ~/.bashrc && echo 'export PIP_CACHE_DIR=~/.cache/pip' >> ~/.bashrc && echo "alias git='git --no-pager'" >> ~/.bashrc"""
)
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
assert_and_raise(
obs.exit_code == 0, f'Failed to export SWE_INSTANCE_ID: {str(obs)}'
)
action = CmdRunAction(command="""export USER=$(whoami); echo USER=${USER} """)
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
assert_and_raise(obs.exit_code == 0, f'Failed to export USER: {str(obs)}')
# inject the init script
script_dir = os.path.dirname(__file__)
# inject the instance info
action = CmdRunAction(command='mkdir -p /swe_util/eval_data/instances')
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
assert_and_raise(
obs.exit_code == 0,
f'Failed to create /swe_util/eval_data/instances: {str(obs)}',
)
swe_instance_json_name = 'swe-bench-instance.json'
with tempfile.TemporaryDirectory() as temp_dir:
# Construct the full path for the desired file name within the temporary directory
temp_file_path = os.path.join(temp_dir, swe_instance_json_name)
# Write to the file with the desired name within the temporary directory
with open(temp_file_path, 'w') as f:
if not isinstance(instance, dict):
json.dump([instance.to_dict()], f)
else:
json.dump([instance], f)
# Copy the file to the desired location
runtime.copy_to(temp_file_path, '/swe_util/eval_data/instances/')
# inject the instance swe entry
runtime.copy_to(
str(os.path.join(script_dir, 'scripts/setup/instance_swe_entry.sh')),
'/swe_util/',
)
action = CmdRunAction(command='cat ~/.bashrc')
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
assert_and_raise(obs.exit_code == 0, f'Failed to cat ~/.bashrc: {str(obs)}')
action = CmdRunAction(command='source ~/.bashrc')
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
if isinstance(obs, ErrorObservation):
logger.error(f'Failed to source ~/.bashrc: {str(obs)}')
assert_and_raise(obs.exit_code == 0, f'Failed to source ~/.bashrc: {str(obs)}')
action = CmdRunAction(command='source /swe_util/instance_swe_entry.sh')
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
assert_and_raise(
obs.exit_code == 0,
f'Failed to source /swe_util/instance_swe_entry.sh: {str(obs)}',
)
action = CmdRunAction(command=f'cd /workspace/{workspace_dir_name}')
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
assert_and_raise(
obs.exit_code == 0,
f'Failed to cd to /workspace/{workspace_dir_name}: {str(obs)}',
)
action = CmdRunAction(command='git reset --hard')
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
assert_and_raise(obs.exit_code == 0, f'Failed to git reset --hard: {str(obs)}')
action = CmdRunAction(
command='for remote_name in $(git remote); do git remote remove "${remote_name}"; done'
)
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
assert_and_raise(obs.exit_code == 0, f'Failed to remove git remotes: {str(obs)}')
# Copy the processed indexes if available
action = CmdRunAction(command='mkdir _index_data/graph_index_v2.3')
obs = runtime.run_action(action)
# Check if an existing graph index file is available
graph_index_file_path = os.path.join(
INDEX_BASE_DIR, 'graph_index_v2.3', f"{instance['instance_id']}.pkl"
)
if INDEX_BASE_DIR and os.path.exists(graph_index_file_path):
logger.info(
f"Copying graph index from {graph_index_file_path} to /workspace/{workspace_dir_name}/_index_data/graph_index_v2.3"
)
runtime.copy_to(
graph_index_file_path,
f'/workspace/{workspace_dir_name}/_index_data/graph_index_v2.3',
)
action = CmdRunAction(
command=f'mv _index_data/graph_index_v2.3/{instance["instance_id"]}.pkl _index_data/graph_index_v2.3/code_graph.pkl'
)
obs = runtime.run_action(action)
bm25_index_dir = os.path.join(INDEX_BASE_DIR, 'BM25_index', instance['instance_id'])
runtime.copy_to(
bm25_index_dir, f'/workspace/{workspace_dir_name}/_index_data', recursive=True
)
action = CmdRunAction(
command=f'mv _index_data/{instance["instance_id"]} _index_data/bm25_index'
)
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
assert_and_raise(obs.exit_code == 0, f'Failed to mv file: {str(obs)}')
action = CmdRunAction(command='which python')
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
assert_and_raise(
obs.exit_code == 0 and 'testbed' in obs.content,
f'Expected to find python interpreter from testbed, but got: {str(obs)}',
)
logger.info('-' * 30)
logger.info('END Runtime Initialization Fn')
logger.info('-' * 30)
def complete_runtime(
runtime: Runtime,
instance: pd.Series, # this argument is not required, but it is used to get the workspace_dir_name
) -> dict[str, Any]:
"""Complete the runtime for the agent.
This function is called before the runtime is used to run the agent.
If you need to do something in the sandbox to get the correctness metric after
the agent has run, modify this function.
"""
logger.info('-' * 30)
logger.info('BEGIN Runtime Completion Fn')
logger.info('-' * 30)
obs: CmdOutputObservation
workspace_dir_name = _get_swebench_workspace_dir_name(instance)
action = CmdRunAction(command=f'cd /workspace/{workspace_dir_name}')
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
if obs.exit_code == -1:
# The previous command is still running
# We need to kill previous command
logger.info('The previous command is still running, trying to kill it...')
action = CmdRunAction(command='C-c')
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
# Then run the command again
action = CmdRunAction(command=f'cd /workspace/{workspace_dir_name}')
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
assert_and_raise(
isinstance(obs, CmdOutputObservation) and obs.exit_code == 0,
f'Failed to cd to /workspace/{workspace_dir_name}: {str(obs)}',
)
action = CmdRunAction(command='git config --global core.pager ""')
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
assert_and_raise(
isinstance(obs, CmdOutputObservation) and obs.exit_code == 0,
f'Failed to git config --global core.pager "": {str(obs)}',
)
# First check for any git repositories in subdirectories
action = CmdRunAction(command='find . -type d -name .git -not -path "./.git"')
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
assert_and_raise(
isinstance(obs, CmdOutputObservation) and obs.exit_code == 0,
f'Failed to find git repositories: {str(obs)}',
)
git_dirs = [p for p in obs.content.strip().split('\n') if p]
if git_dirs:
# Remove all .git directories in subdirectories
for git_dir in git_dirs:
action = CmdRunAction(command=f'rm -rf "{git_dir}"')
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
assert_and_raise(
isinstance(obs, CmdOutputObservation) and obs.exit_code == 0,
f'Failed to remove git directory {git_dir}: {str(obs)}',
)
# add all files
action = CmdRunAction(command='git add -A')
action.set_hard_timeout(600)
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
assert_and_raise(
isinstance(obs, CmdOutputObservation) and obs.exit_code == 0,
f'Failed to git add -A: {str(obs)}',
)
n_retries = 0
git_patch = None
while n_retries < 5:
action = CmdRunAction(
command=f'git diff --no-color --cached {instance["base_commit"]}'
)
action.set_hard_timeout(max(300 + 100 * n_retries, 600))
logger.info(action, extra={'msg_type': 'ACTION'})
obs = runtime.run_action(action)
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
n_retries += 1
if isinstance(obs, CmdOutputObservation):
if obs.exit_code == 0:
git_patch = obs.content.strip()
break
else:
logger.info('Failed to get git diff, retrying...')
sleep_if_should_continue(10)
elif isinstance(obs, ErrorObservation):
logger.error(f'Error occurred: {obs.content}. Retrying...')
sleep_if_should_continue(10)
else:
assert_and_raise(False, f'Unexpected observation type: {str(obs)}')
assert_and_raise(git_patch is not None, 'Failed to get git diff (None)')
logger.info('-' * 30)
logger.info('END Runtime Completion Fn')
logger.info('-' * 30)
return {'git_patch': git_patch}
def process_instance(
instance: pd.Series,
metadata: EvalMetadata,
reset_logger: bool = True,
runtime_failure_count: int = 0,
) -> EvalOutput:
config = get_config(instance, metadata)
# Setup the logger properly, so you can run multi-processing to parallelize the evaluation
if reset_logger:
log_dir = os.path.join(metadata.eval_output_dir, 'infer_logs')
reset_logger_for_multiprocessing(logger, instance.instance_id, log_dir)
else:
logger.info(f'Starting evaluation for instance {instance.instance_id}.')
# Increase resource_factor with increasing attempt_id
if runtime_failure_count > 0:
config.sandbox.remote_runtime_resource_factor = min(
config.sandbox.remote_runtime_resource_factor * (2**runtime_failure_count),
8,
)
logger.warning(
f'This is the {runtime_failure_count + 1}th attempt for instance {instance.instance_id}, setting resource factor to {config.sandbox.remote_runtime_resource_factor}'
)
runtime = create_runtime(config)
call_async_from_sync(runtime.connect)
try:
initialize_runtime(runtime, instance)
instruction = get_instruction(instance, metadata)
# Here's how you can run the agent (similar to the `main` function) and get the final task state
state: State | None = asyncio.run(
run_controller(
config=config,
initial_user_action=MessageAction(content=instruction),
runtime=runtime,
fake_user_response_fn=AGENT_CLS_TO_FAKE_USER_RESPONSE_FN[
metadata.agent_class
],
)
)
# if fatal error, throw EvalError to trigger re-run
if is_fatal_evaluation_error(state.last_error):
raise EvalException('Fatal error detected: ' + state.last_error)
# ======= THIS IS SWE-Bench specific =======
# Get git patch
return_val = complete_runtime(runtime, instance)
git_patch = return_val['git_patch']
logger.info(
f'Got git diff for instance {instance.instance_id}:\n--------\n{git_patch}\n--------'
)
finally:
runtime.close()
# ==========================================
# ======= Attempt to evaluate the agent's edits =======
# we use eval_infer.sh to evaluate the agent's edits, not here
# because the agent may alter the environment / testcases
test_result = {
'git_patch': git_patch,
}
# If you are working on some simpler benchmark that only evaluates the final model output (e.g., in a MessageAction)
# You can simply get the LAST `MessageAction` from the returned `state.history` and parse it for evaluation.
if state is None:
raise ValueError('State should not be None.')
# NOTE: this is NO LONGER the event stream, but an agent history that includes delegate agent's events
histories = [event_to_dict(event) for event in state.history]
metrics = get_metrics(state)
# Save the output
output = EvalOutput(
instance_id=instance.instance_id,
instruction=instruction,
instance=instance.to_dict(), # SWE Bench specific
test_result=test_result,
metadata=metadata,
history=histories,
metrics=metrics,
error=state.last_error if state and state.last_error else None,
)
return output
def filter_dataset(dataset: pd.DataFrame, filter_column: str) -> pd.DataFrame:
file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'config.toml')
if os.path.exists(file_path):
with open(file_path, 'r') as file:
data = toml.load(file)
if 'selected_ids' in data:
selected_ids = data['selected_ids']
logger.info(
f'Filtering {len(selected_ids)} tasks from "selected_ids"...'
)
subset = dataset[dataset[filter_column].isin(selected_ids)]
logger.info(f'Retained {subset.shape[0]} tasks after filtering')
return subset
skip_ids = os.environ.get('SKIP_IDS', '').split(',')
if len(skip_ids) > 0:
logger.info(f'Filtering {len(skip_ids)} tasks from "SKIP_IDS"...')
return dataset[~dataset[filter_column].isin(skip_ids)]
return dataset
# A list of instances that are known to be tricky to infer
# (will cause runtime failure even with resource factor = 8)
SWEGYM_EXCLUDE_IDS = [
'dask__dask-10422',
'pandas-dev__pandas-50548',
'pandas-dev__pandas-53672',
'pandas-dev__pandas-54174',
'pandas-dev__pandas-55518',
'pandas-dev__pandas-58383',
'pydata__xarray-6721',
'pytest-dev__pytest-10081',
'pytest-dev__pytest-7236',
]
if __name__ == '__main__':
parser = get_parser()
parser.add_argument(
'--dataset',
type=str,
default='princeton-nlp/SWE-bench',
help='data set to evaluate on, either full-test or lite-test',
)
parser.add_argument(
'--split',
type=str,
default='test',
help='split to evaluate on',
)
args, _ = parser.parse_known_args()
# NOTE: It is preferable to load datasets from huggingface datasets and perform post-processing
# so we don't need to manage file uploading to OpenHands's repo
dataset = load_dataset(args.dataset, split=args.split)
swe_bench_tests = filter_dataset(dataset.to_pandas(), 'instance_id')
logger.info(
f'Loaded dataset {args.dataset} with split {args.split}: {len(swe_bench_tests)} tasks'
)
if 'SWE-Gym' in args.dataset:
swe_bench_tests = swe_bench_tests[
~swe_bench_tests['instance_id'].isin(SWEGYM_EXCLUDE_IDS)
]
logger.info(
f'{len(swe_bench_tests)} tasks left after excluding SWE-Gym excluded tasks'
)
llm_config = None
if args.llm_config:
llm_config = get_llm_config_arg(args.llm_config)
llm_config.log_completions = True
# modify_params must be False for evaluation purpose, for reproducibility and accurancy of results
llm_config.modify_params = False
if llm_config is None:
raise ValueError(f'Could not find LLM config: --llm_config {args.llm_config}')
details = {}
_agent_cls = openhands.agenthub.Agent.get_cls(args.agent_cls)
dataset_descrption = (
args.dataset.replace('/', '__') + '-' + args.split.replace('/', '__')
)
metadata = make_metadata(
llm_config,
dataset_descrption,
args.agent_cls,
args.max_iterations,
args.eval_note,
args.eval_output_dir,
details=details,
)
output_file = os.path.join(metadata.eval_output_dir, 'output.jsonl')
print(f'### OUTPUT FILE: {output_file} ###')
instances = prepare_dataset(swe_bench_tests, output_file, args.eval_n_limit)
if len(instances) > 0 and not isinstance(
instances['PASS_TO_PASS'][instances['PASS_TO_PASS'].index[0]], str
):
for col in ['PASS_TO_PASS', 'FAIL_TO_PASS']:
instances[col] = instances[col].apply(lambda x: str(x))
run_evaluation(
instances,
metadata,
output_file,
args.eval_num_workers,
process_instance,
timeout_seconds=8 * 60 * 60, # 8 hour PER instance should be more than enough
max_retries=5,
)
@@ -16,19 +16,11 @@ fi
INSTANCE_ID=$2
DATASET_NAME=${3:-"princeton-nlp/SWE-bench_Lite"}
SPLIT=${4:-"test"}
ENVIRONMENT=${5:-"local"}
echo "INSTANCE_ID: $INSTANCE_ID"
echo "DATASET_NAME: $DATASET_NAME"
echo "SPLIT: $SPLIT"
if [[ "$ENVIRONMENT" != "local" && "$ENVIRONMENT" != "modal" ]]; then
echo "Error: ENVIRONMENT must be either 'local' or 'modal'"
exit 1
fi
echo "ENVIRONMENT: $ENVIRONMENT"
PROCESS_FILEPATH=$(realpath $PROCESS_FILEPATH)
FILE_DIR=$(dirname $PROCESS_FILEPATH)
FILE_NAME=$(basename $PROCESS_FILEPATH)
@@ -86,12 +78,6 @@ echo "=============================================================="
RUN_ID=$(date +"%Y%m%d_%H%M%S")
N_PROCESS=4
MODAL_FLAG=""
if [[ "$ENVIRONMENT" == "modal" ]]; then
MODAL_FLAG="--modal true"
fi
if [ -z "$INSTANCE_ID" ]; then
echo "Running SWE-bench evaluation on the whole input file..."
# Default to SWE-Bench-lite
@@ -104,8 +90,7 @@ if [ -z "$INSTANCE_ID" ]; then
--timeout 3600 \
--cache_level instance \
--max_workers $N_PROCESS \
--run_id $RUN_ID \
$MODAL_FLAG
--run_id $RUN_ID
# get the "model_name_or_path" from the first line of the SWEBENCH_FORMAT_JSONL
MODEL_NAME_OR_PATH=$(jq -r '.model_name_or_path' $SWEBENCH_FORMAT_JSONL | head -n 1)
@@ -152,6 +137,5 @@ else
--instance_ids $INSTANCE_ID \
--cache_level instance \
--max_workers $N_PROCESS \
--run_id $RUN_ID \
$MODAL_FLAG
--run_id $RUN_ID
fi
@@ -14,7 +14,6 @@ SPLIT=$8
N_RUNS=$9
MODE=${10}
if [ -z "$NUM_WORKERS" ]; then
NUM_WORKERS=1
echo "Number of workers not specified, use default $NUM_WORKERS"
@@ -52,12 +51,6 @@ if [ -z "$MODE" ]; then
echo "MODE not specified, use default $MODE"
fi
if [ -n "$EVAL_CONDENSER" ]; then
echo "Using Condenser Config: $EVAL_CONDENSER"
else
echo "No Condenser Config provided via EVAL_CONDENSER, use default (NoOpCondenser)."
fi
export RUN_WITH_BROWSING=$RUN_WITH_BROWSING
echo "RUN_WITH_BROWSING: $RUN_WITH_BROWSING"
@@ -72,7 +65,6 @@ echo "MAX_ITER: $MAX_ITER"
echo "NUM_WORKERS: $NUM_WORKERS"
echo "COMMIT_HASH: $COMMIT_HASH"
echo "MODE: $MODE"
echo "EVAL_CONDENSER: $EVAL_CONDENSER"
# Default to NOT use Hint
if [ -z "$USE_HINT_TEXT" ]; then
@@ -96,10 +88,6 @@ fi
if [ "$MODE" != "swe" ]; then
EVAL_NOTE="${EVAL_NOTE}-${MODE}"
fi
# Add condenser config to eval note if provided
if [ -n "$EVAL_CONDENSER" ]; then
EVAL_NOTE="${EVAL_NOTE}-${EVAL_CONDENSER}"
fi
function run_eval() {
local eval_note="${1}"
@@ -113,8 +101,6 @@ function run_eval() {
--split $SPLIT \
--mode $MODE"
if [ -n "$EVAL_LIMIT" ]; then
echo "EVAL_LIMIT: $EVAL_LIMIT"
COMMAND="$COMMAND --eval-n-limit $EVAL_LIMIT"
@@ -1,117 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail
source "evaluation/utils/version_control.sh"
MODEL_CONFIG=$1
COMMIT_HASH=$2
AGENT=$3
EVAL_LIMIT=$4
MAX_ITER=$5
NUM_WORKERS=$6
DATASET=$7
SPLIT=$8
N_RUNS=$9
if [ -z "$NUM_WORKERS" ]; then
NUM_WORKERS=1
echo "Number of workers not specified, use default $NUM_WORKERS"
fi
checkout_eval_branch
if [ -z "$AGENT" ]; then
echo "Agent not specified, use default CodeActAgent"
AGENT="CodeActAgent"
fi
if [ -z "$MAX_ITER" ]; then
echo "MAX_ITER not specified, use default 100"
MAX_ITER=100
fi
if [ -z "$RUN_WITH_BROWSING" ]; then
echo "RUN_WITH_BROWSING not specified, use default false"
RUN_WITH_BROWSING=false
fi
if [ -z "$DATASET" ]; then
echo "DATASET not specified, use default princeton-nlp/SWE-bench_Lite"
DATASET="princeton-nlp/SWE-bench_Lite"
fi
if [ -z "$SPLIT" ]; then
echo "SPLIT not specified, use default test"
SPLIT="test"
fi
export RUN_WITH_BROWSING=$RUN_WITH_BROWSING
echo "RUN_WITH_BROWSING: $RUN_WITH_BROWSING"
get_openhands_version
echo "AGENT: $AGENT"
echo "OPENHANDS_VERSION: $OPENHANDS_VERSION"
echo "MODEL_CONFIG: $MODEL_CONFIG"
echo "DATASET: $DATASET"
echo "SPLIT: $SPLIT"
# Default to NOT use Hint
if [ -z "$USE_HINT_TEXT" ]; then
export USE_HINT_TEXT=false
fi
echo "USE_HINT_TEXT: $USE_HINT_TEXT"
EVAL_NOTE="$OPENHANDS_VERSION"
# if not using Hint, add -no-hint to the eval note
if [ "$USE_HINT_TEXT" = false ]; then
EVAL_NOTE="$EVAL_NOTE-no-hint"
fi
if [ "$RUN_WITH_BROWSING" = true ]; then
EVAL_NOTE="$EVAL_NOTE-with-browsing"
fi
if [ -n "$EXP_NAME" ]; then
EVAL_NOTE="$EVAL_NOTE-$EXP_NAME"
fi
function run_eval() {
local eval_note=$1
COMMAND="poetry run python evaluation/benchmarks/swe_bench/run_localize.py \
--agent-cls $AGENT \
--llm-config $MODEL_CONFIG \
--max-iterations $MAX_ITER \
--eval-num-workers $NUM_WORKERS \
--eval-note $eval_note \
--dataset $DATASET \
--split $SPLIT"
if [ -n "$EVAL_LIMIT" ]; then
echo "EVAL_LIMIT: $EVAL_LIMIT"
COMMAND="$COMMAND --eval-n-limit $EVAL_LIMIT"
fi
# Run the command
eval $COMMAND
}
unset SANDBOX_ENV_GITHUB_TOKEN # prevent the agent from using the github token to push
if [ -z "$N_RUNS" ]; then
N_RUNS=1
echo "N_RUNS not specified, use default $N_RUNS"
fi
# Skip runs if the run number is in the SKIP_RUNS list
# read from env variable SKIP_RUNS as a comma separated list of run numbers
SKIP_RUNS=(${SKIP_RUNS//,/ })
for i in $(seq 1 $N_RUNS); do
if [[ " ${SKIP_RUNS[@]} " =~ " $i " ]]; then
echo "Skipping run $i"
continue
fi
current_eval_note="$EVAL_NOTE-run_$i"
echo "EVAL_NOTE: $current_eval_note"
run_eval $current_eval_note
done
checkout_original_branch
@@ -4,6 +4,7 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { ActionSuggestions } from "#/components/features/chat/action-suggestions";
import OpenHands from "#/api/open-hands";
import { MOCK_DEFAULT_USER_SETTINGS } from "#/mocks/handlers";
import { ConversationProvider } from "#/context/conversation-context";
// Mock dependencies
vi.mock("posthog-js", () => ({
@@ -47,9 +48,11 @@ vi.mock("react-router", () => ({
const renderActionSuggestions = () =>
render(<ActionSuggestions onSuggestionsClick={() => {}} />, {
wrapper: ({ children }) => (
<QueryClientProvider client={new QueryClient()}>
{children}
</QueryClientProvider>
<ConversationProvider>
<QueryClientProvider client={new QueryClient()}>
{children}
</QueryClientProvider>
</ConversationProvider>
),
});
@@ -56,15 +56,15 @@ function TestComponent() {
describe("WsClientProvider", () => {
beforeEach(() => {
vi.clearAllMocks();
vi.mock("#/hooks/query/use-active-conversation", () => ({
useActiveConversation: () => {
vi.mock("#/hooks/query/use-user-conversation", () => ({
useUserConversation: () => {
return { data: {
conversation_id: "1",
title: "Conversation 1",
selected_repository: null,
last_updated_at: "2021-10-01T12:00:00Z",
created_at: "2021-10-01T12:00:00Z",
status: "RUNNING" as const,
status: "STOPPED" as const,
url: null,
session_api_key: null,
}}},
@@ -48,7 +48,7 @@ describe("Content", () => {
await waitFor(() => {
expect(provider).toHaveValue("Anthropic");
expect(model).toHaveValue("claude-sonnet-4-20250514");
expect(model).toHaveValue("claude-3-7-sonnet-20250219");
expect(apiKey).toHaveValue("");
expect(apiKey).toHaveProperty("placeholder", "");
@@ -105,7 +105,7 @@ describe("Content", () => {
within(advancedForm).getByTestId("llm-custom-model-input");
within(advancedForm).getByTestId("base-url-input");
within(advancedForm).getByTestId("llm-api-key-input");
within(advancedForm).getByTestId("llm-api-key-help-anchor-advanced");
within(advancedForm).getByTestId("llm-api-key-help-anchor");
within(advancedForm).getByTestId("agent-input");
within(advancedForm).getByTestId("enable-confirmation-mode-switch");
within(advancedForm).getByTestId("enable-memory-condenser-switch");
@@ -135,7 +135,7 @@ describe("Content", () => {
);
const condensor = screen.getByTestId("enable-memory-condenser-switch");
expect(model).toHaveValue("anthropic/claude-sonnet-4-20250514");
expect(model).toHaveValue("anthropic/claude-3-7-sonnet-20250219");
expect(baseUrl).toHaveValue("");
expect(apiKey).toHaveValue("");
expect(apiKey).toHaveProperty("placeholder", "");
@@ -542,7 +542,7 @@ describe("Form submission", () => {
// select model
await userEvent.click(model);
const modelOption = screen.getByText("claude-sonnet-4-20250514");
const modelOption = screen.getByText("claude-3-7-sonnet-20250219");
await userEvent.click(modelOption);
const submitButton = screen.getByTestId("submit-button");
@@ -550,7 +550,7 @@ describe("Form submission", () => {
expect(saveSettingsSpy).toHaveBeenCalledWith(
expect.objectContaining({
llm_model: "anthropic/claude-sonnet-4-20250514",
llm_model: "anthropic/claude-3-7-sonnet-20250219",
llm_base_url: "",
confirmation_mode: false,
}),
@@ -71,18 +71,6 @@ describe("extractModelAndProvider", () => {
separator: "/",
});
expect(extractModelAndProvider("claude-sonnet-4-20250514")).toEqual({
provider: "anthropic",
model: "claude-sonnet-4-20250514",
separator: "/",
});
expect(extractModelAndProvider("claude-opus-4-20250514")).toEqual({
provider: "anthropic",
model: "claude-opus-4-20250514",
separator: "/",
});
expect(extractModelAndProvider("claude-3-haiku-20240307")).toEqual({
provider: "anthropic",
model: "claude-3-haiku-20240307",
+508 -1164
View File
File diff suppressed because it is too large Load Diff
+15 -15
View File
@@ -1,6 +1,6 @@
{
"name": "openhands-frontend",
"version": "0.39.2",
"version": "0.39.1",
"private": true,
"type": "module",
"engines": {
@@ -10,28 +10,28 @@
"@heroui/react": "2.7.8",
"@microlink/react-json-view": "^1.26.2",
"@monaco-editor/react": "^4.7.0-rc.0",
"@react-router/node": "^7.6.1",
"@react-router/serve": "^7.6.1",
"@react-types/shared": "^3.29.1",
"@react-router/node": "^7.6.0",
"@react-router/serve": "^7.6.0",
"@react-types/shared": "^3.29.0",
"@reduxjs/toolkit": "^2.8.2",
"@stripe/react-stripe-js": "^3.7.0",
"@stripe/stripe-js": "^7.3.0",
"@tanstack/react-query": "^5.77.2",
"@tanstack/react-query": "^5.76.1",
"@vitejs/plugin-react": "^4.4.0",
"@xterm/addon-fit": "^0.10.0",
"@xterm/xterm": "^5.4.0",
"axios": "^1.9.0",
"clsx": "^2.1.1",
"eslint-config-airbnb-typescript": "^18.0.0",
"framer-motion": "^12.14.0",
"i18next": "^25.2.1",
"framer-motion": "^12.12.1",
"i18next": "^25.1.3",
"i18next-browser-languagedetector": "^8.1.0",
"i18next-http-backend": "^3.0.2",
"isbot": "^5.1.28",
"jose": "^6.0.11",
"lucide-react": "^0.511.0",
"monaco-editor": "^0.52.2",
"posthog-js": "^1.245.2",
"posthog-js": "^1.242.2",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-highlight": "^0.15.0",
@@ -40,7 +40,7 @@
"react-icons": "^5.5.0",
"react-markdown": "^10.1.0",
"react-redux": "^9.2.0",
"react-router": "^7.6.1",
"react-router": "^7.6.0",
"react-syntax-highlighter": "^15.6.1",
"react-textarea-autosize": "^8.5.9",
"remark-gfm": "^4.0.1",
@@ -83,22 +83,22 @@
"@babel/types": "^7.27.0",
"@mswjs/socket.io-binding": "^0.1.1",
"@playwright/test": "^1.52.0",
"@react-router/dev": "^7.6.1",
"@react-router/dev": "^7.6.0",
"@tailwindcss/typography": "^0.5.16",
"@tanstack/eslint-plugin-query": "^5.78.0",
"@tanstack/eslint-plugin-query": "^5.74.7",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.1",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/node": "^22.15.21",
"@types/react": "^19.1.5",
"@types/node": "^22.15.18",
"@types/react": "^19.1.4",
"@types/react-dom": "^19.1.5",
"@types/react-highlight": "^0.12.8",
"@types/react-syntax-highlighter": "^15.5.13",
"@types/ws": "^8.18.1",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@vitest/coverage-v8": "^3.1.4",
"@vitest/coverage-v8": "^3.1.3",
"autoprefixer": "^10.4.21",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
@@ -117,7 +117,7 @@
"msw": "^2.6.6",
"postcss": "^8.5.2",
"prettier": "^3.5.3",
"stripe": "^18.1.1",
"stripe": "^18.1.0",
"tailwindcss": "^3.4.17",
"typescript": "^5.8.3",
"vite-plugin-svgr": "^4.2.0",
+1 -1
View File
@@ -8,7 +8,7 @@
* - Please do NOT serve this file on production.
*/
const PACKAGE_VERSION = '2.8.4'
const PACKAGE_VERSION = '2.7.6'
const INTEGRITY_CHECKSUM = '00729d72e3b82faf54ca8b9621dbb96f'
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
const activeClientIds = new Set()
@@ -113,7 +113,6 @@ const EXCLUDED_TECHNICAL_STRINGS = [
"GitHub API", // Git provider specific terminology
"add-secret-form", // Test ID for secret form
"edit-secret-form", // Test ID for secret form
"search-api-key-input", // Input name for search API key
];
function isExcludedTechnicalString(str) {
@@ -3,7 +3,7 @@ import { useSelector, useDispatch } from "react-redux";
import { RootState } from "#/store";
import { BrowserSnapshot } from "./browser-snapshot";
import { EmptyBrowserMessage } from "./empty-browser-message";
import { useConversationId } from "#/hooks/use-conversation-id";
import { useConversation } from "#/context/conversation-context";
import {
initialState as browserInitialState,
setUrl,
@@ -14,7 +14,7 @@ export function BrowserPanel() {
const { url, screenshotSrc } = useSelector(
(state: RootState) => state.browser,
);
const { conversationId } = useConversationId();
const { conversationId } = useConversation();
const dispatch = useDispatch();
useEffect(() => {
@@ -4,7 +4,8 @@ import { useTranslation } from "react-i18next";
import { SuggestionItem } from "#/components/features/suggestions/suggestion-item";
import { I18nKey } from "#/i18n/declaration";
import { useUserProviders } from "#/hooks/use-user-providers";
import { useActiveConversation } from "#/hooks/query/use-active-conversation";
import { useConversation } from "#/context/conversation-context";
import { useUserConversation } from "#/hooks/query/use-user-conversation";
interface ActionSuggestionsProps {
onSuggestionsClick: (value: string) => void;
@@ -15,7 +16,9 @@ export function ActionSuggestions({
}: ActionSuggestionsProps) {
const { t } = useTranslation();
const { providers } = useUserProviders();
const { data: conversation } = useActiveConversation();
const { conversationId } = useConversation();
const { data: conversation } = useUserConversation(conversationId);
const [hasPullRequest, setHasPullRequest] = React.useState(false);
const providersAreSet = providers.length > 0;
@@ -153,13 +153,11 @@ export function ChatInterface() {
/>
)}
{isWaitingForUserInput &&
events.length > 0 &&
!optimisticUserMessage && (
<ActionSuggestions
onSuggestionsClick={(value) => handleSendMessage(value, [])}
/>
)}
{isWaitingForUserInput && (
<ActionSuggestions
onSuggestionsClick={(value) => handleSendMessage(value, [])}
/>
)}
</div>
<div className="flex flex-col gap-[6px] px-4 pb-4">
@@ -28,58 +28,39 @@ export const getEventContent = (
let details: string = "";
if (isOpenHandsAction(event)) {
const actionKey = `ACTION_MESSAGE$${event.action.toUpperCase()}`;
// If translation key exists, use Trans component
if (i18n.exists(actionKey)) {
title = (
<Trans
i18nKey={actionKey}
values={{
path: hasPathProperty(event.args) && event.args.path,
command:
hasCommandProperty(event.args) &&
trimText(event.args.command, 80),
mcp_tool_name: event.action === "call_tool_mcp" && event.args.name,
}}
components={{
path: <PathComponent />,
cmd: <MonoComponent />,
}}
/>
);
} else {
// For generic actions, just use the uppercase type
title = event.action.toUpperCase();
}
title = (
<Trans
i18nKey={`ACTION_MESSAGE$${event.action.toUpperCase()}`}
values={{
path: hasPathProperty(event.args) && event.args.path,
command:
hasCommandProperty(event.args) && trimText(event.args.command, 80),
}}
components={{
path: <PathComponent />,
cmd: <MonoComponent />,
}}
/>
);
details = getActionContent(event);
}
if (isOpenHandsObservation(event)) {
const observationKey = `OBSERVATION_MESSAGE$${event.observation.toUpperCase()}`;
// If translation key exists, use Trans component
if (i18n.exists(observationKey)) {
title = (
<Trans
i18nKey={observationKey}
values={{
path: hasPathProperty(event.extras) && event.extras.path,
command:
hasCommandProperty(event.extras) &&
trimText(event.extras.command, 80),
mcp_tool_name: event.observation === "mcp" && event.extras.name,
}}
components={{
path: <PathComponent />,
cmd: <MonoComponent />,
}}
/>
);
} else {
// For generic observations, just use the uppercase type
title = event.observation.toUpperCase();
}
title = (
<Trans
i18nKey={`OBSERVATION_MESSAGE$${event.observation.toUpperCase()}`}
values={{
path: hasPathProperty(event.extras) && event.extras.path,
command:
hasCommandProperty(event.extras) &&
trimText(event.extras.command, 80),
}}
components={{
path: <PathComponent />,
cmd: <MonoComponent />,
}}
/>
);
details = getObservationContent(event);
}
@@ -46,6 +46,14 @@ const getBrowseObservationContent = (event: BrowseObservation) => {
return contentDetails;
};
const getMcpObservationContent = (event: OpenHandsObservation): string => {
let { content } = event;
if (content.length > MAX_CONTENT_LENGTH) {
content = `${content.slice(0, MAX_CONTENT_LENGTH)}...`;
}
return `**Output:**\n\`\`\`\n${content.trim() || i18n.t("OBSERVATION$MCP_NO_OUTPUT")}\n\`\`\``;
};
const getRecallObservationContent = (event: RecallObservation): string => {
let content = "";
@@ -116,6 +124,8 @@ export const getObservationContent = (event: OpenHandsObservation): string => {
return getCommandObservationContent(event);
case "browse":
return getBrowseObservationContent(event);
case "mcp":
return getMcpObservationContent(event);
case "recall":
return getRecallObservationContent(event);
default:
@@ -1,4 +1,5 @@
import { ConfirmationButtons } from "#/components/shared/buttons/confirmation-buttons";
import { I18nKey } from "#/i18n/declaration";
import { OpenHandsAction } from "#/types/core/actions";
import {
isUserMessage,
@@ -8,15 +9,14 @@ import {
isOpenHandsObservation,
isFinishAction,
isRejectObservation,
isMcpObservation,
} from "#/types/core/guards";
import { OpenHandsObservation } from "#/types/core/observations";
import { ImageCarousel } from "../images/image-carousel";
import { ChatMessage } from "./chat-message";
import { ErrorMessage } from "./error-message";
import { MCPObservationContent } from "./mcp-observation-content";
import { getObservationResult } from "./event-content-helpers/get-observation-result";
import { getEventContent } from "./event-content-helpers/get-event-content";
import { ExpandableMessage } from "./expandable-message";
import { GenericEventMessage } from "./generic-event-message";
const hasThoughtProperty = (
@@ -26,6 +26,7 @@ const hasThoughtProperty = (
interface EventMessageProps {
event: OpenHandsAction | OpenHandsObservation;
hasObservationPair: boolean;
isFirstMessageWithResolverTrigger: boolean;
isAwaitingUserConfirmation: boolean;
isLastMessage: boolean;
}
@@ -33,12 +34,32 @@ interface EventMessageProps {
export function EventMessage({
event,
hasObservationPair,
isFirstMessageWithResolverTrigger,
isAwaitingUserConfirmation,
isLastMessage,
}: EventMessageProps) {
const shouldShowConfirmationButtons =
isLastMessage && event.source === "agent" && isAwaitingUserConfirmation;
const isFirstUserMessageWithResolverTrigger =
isFirstMessageWithResolverTrigger && isUserMessage(event);
// Special case: First user message with resolver trigger
if (isFirstUserMessageWithResolverTrigger) {
return (
<div>
<ExpandableMessage
type="action"
message={event.args.content}
id={I18nKey.CHAT$RESOLVER_INSTRUCTIONS}
/>
{event.args.image_urls && event.args.image_urls.length > 0 && (
<ImageCarousel size="small" images={event.args.image_urls} />
)}
</div>
);
}
if (isErrorObservation(event)) {
return (
<ErrorMessage
@@ -48,11 +69,12 @@ export function EventMessage({
);
}
if (hasObservationPair && isOpenHandsAction(event)) {
if (hasThoughtProperty(event.args)) {
return <ChatMessage type="agent" message={event.args.thought} />;
}
return null;
if (
hasObservationPair &&
isOpenHandsAction(event) &&
hasThoughtProperty(event.args)
) {
return <ChatMessage type="agent" message={event.args.thought} />;
}
if (isFinishAction(event)) {
@@ -79,19 +101,6 @@ export function EventMessage({
return <ChatMessage type="agent" message={event.content} />;
}
if (isMcpObservation(event)) {
return (
<div>
<GenericEventMessage
title={getEventContent(event).title}
details={<MCPObservationContent event={event} />}
success={getObservationResult(event)}
/>
{shouldShowConfirmationButtons && <ConfirmationButtons />}
</div>
);
}
return (
<div>
{isOpenHandsAction(event) && hasThoughtProperty(event.args) && (
@@ -10,7 +10,7 @@ import { ObservationResultStatus } from "./event-content-helpers/get-observation
interface GenericEventMessageProps {
title: React.ReactNode;
details: string | React.ReactNode;
details: string;
success?: ObservationResultStatus;
}
@@ -44,21 +44,18 @@ export function GenericEventMessage({
{success && <SuccessIndicator status={success} />}
</div>
{showDetails &&
(typeof details === "string" ? (
<Markdown
components={{
code,
ul,
ol,
}}
remarkPlugins={[remarkGfm]}
>
{details}
</Markdown>
) : (
details
))}
{showDetails && (
<Markdown
components={{
code,
ul,
ol,
}}
remarkPlugins={[remarkGfm]}
>
{details}
</Markdown>
)}
</div>
);
}
@@ -1,73 +0,0 @@
import React from "react";
import ReactJsonView from "@microlink/react-json-view";
import { useTranslation } from "react-i18next";
import { MCPObservation } from "#/types/core/observations";
import { JSON_VIEW_THEME } from "#/utils/constants";
interface MCPObservationContentProps {
event: MCPObservation;
}
export function MCPObservationContent({ event }: MCPObservationContentProps) {
const { t } = useTranslation();
// Parse the content as JSON if possible
let outputData: unknown;
try {
outputData = JSON.parse(event.content);
} catch (e) {
// If parsing fails, use the raw content
outputData = event.content;
}
const hasArguments =
event.extras.arguments && Object.keys(event.extras.arguments).length > 0;
return (
<div className="flex flex-col gap-4">
{/* Arguments section */}
{hasArguments && (
<div className="flex flex-col gap-2">
<div className="flex items-center justify-between">
<h3 className="text-sm font-semibold text-gray-300">
{t("MCP_OBSERVATION$ARGUMENTS")}
</h3>
</div>
<div className="p-3 bg-gray-900 rounded-md overflow-auto text-gray-300 max-h-[200px] shadow-inner">
<ReactJsonView
name={false}
src={event.extras.arguments}
theme={JSON_VIEW_THEME}
collapsed={1}
displayDataTypes={false}
/>
</div>
</div>
)}
{/* Output section */}
<div className="flex flex-col gap-2">
<div className="flex items-center justify-between">
<h3 className="text-sm font-semibold text-gray-300">
{t("MCP_OBSERVATION$OUTPUT")}
</h3>
</div>
<div className="p-3 bg-gray-900 rounded-md overflow-auto text-gray-300 max-h-[300px] shadow-inner">
{typeof outputData === "object" && outputData !== null ? (
<ReactJsonView
name={false}
src={outputData}
theme={JSON_VIEW_THEME}
collapsed={1}
displayDataTypes={false}
/>
) : (
<pre className="whitespace-pre-wrap">
{event.content.trim() || t("OBSERVATION$MCP_NO_OUTPUT")}
</pre>
)}
</div>
</div>
</div>
);
}
@@ -1,4 +1,6 @@
import React from "react";
import { useUserConversation } from "#/hooks/query/use-user-conversation";
import { useConversation } from "#/context/conversation-context";
import { OpenHandsAction } from "#/types/core/actions";
import { OpenHandsObservation } from "#/types/core/observations";
import { isOpenHandsAction, isOpenHandsObservation } from "#/types/core/guards";
@@ -36,9 +38,14 @@ interface MessagesProps {
export const Messages: React.FC<MessagesProps> = React.memo(
({ messages, isAwaitingUserConfirmation }) => {
const { getOptimisticUserMessage } = useOptimisticUserMessage();
const { conversationId } = useConversation();
const { data: conversation } = useUserConversation(conversationId || null);
const optimisticUserMessage = getOptimisticUserMessage();
// Check if conversation metadata has trigger=resolver
const isResolverTrigger = conversation?.trigger === "resolver";
const actionHasObservationPair = React.useCallback(
(event: OpenHandsAction | OpenHandsObservation): boolean => {
if (isOpenHandsAction(event)) {
@@ -49,7 +56,7 @@ export const Messages: React.FC<MessagesProps> = React.memo(
return false;
},
[],
[messages],
);
return (
@@ -59,6 +66,7 @@ export const Messages: React.FC<MessagesProps> = React.memo(
key={index}
event={message}
hasObservationPair={actionHasObservationPair(message)}
isFirstMessageWithResolverTrigger={index === 0 && isResolverTrigger}
isAwaitingUserConfirmation={isAwaitingUserConfirmation}
isLastMessage={messages.length - 1 === index}
/>
@@ -70,14 +78,6 @@ export const Messages: React.FC<MessagesProps> = React.memo(
</>
);
},
(prevProps, nextProps) => {
// Prevent re-renders if messages are the same length
if (prevProps.messages.length !== nextProps.messages.length) {
return false;
}
return true;
},
);
Messages.displayName = "Messages";
@@ -15,7 +15,6 @@ import {
} from "#/context/ws-client-provider";
import { useNotification } from "#/hooks/useNotification";
import { browserTab } from "#/utils/browser-tab";
import { useActiveConversation } from "#/hooks/query/use-active-conversation";
const notificationStates = [
AgentState.AWAITING_USER_INPUT,
@@ -29,7 +28,6 @@ export function AgentStatusBar() {
const { curStatusMessage } = useSelector((state: RootState) => state.status);
const { status } = useWsClient();
const { notify } = useNotification();
const { data: conversation } = useActiveConversation();
const [statusMessage, setStatusMessage] = React.useState<string>("");
@@ -80,10 +78,7 @@ export function AgentStatusBar() {
);
React.useEffect(() => {
if (conversation?.status === "STARTING") {
setStatusMessage(t(I18nKey.STATUS$STARTING_RUNTIME));
setIndicatorColor(IndicatorColor.RED);
} else if (status === WsClientProviderStatus.DISCONNECTED) {
if (status === WsClientProviderStatus.DISCONNECTED) {
setStatusMessage(t(I18nKey.STATUS$CONNECTED)); // Using STATUS$CONNECTED instead of STATUS$CONNECTING
setIndicatorColor(IndicatorColor.RED);
} else {
@@ -102,7 +97,7 @@ export function AgentStatusBar() {
}
}
}
}, [curAgentState, status, notify, t, conversation?.status]);
}, [curAgentState, status, notify, t]);
return (
<div className="flex flex-col items-center">
@@ -1,8 +1,9 @@
import { useParams } from "react-router";
import React from "react";
import { AgentControlBar } from "./agent-control-bar";
import { AgentStatusBar } from "./agent-status-bar";
import { SecurityLock } from "./security-lock";
import { useActiveConversation } from "#/hooks/query/use-active-conversation";
import { useUserConversation } from "#/hooks/query/use-user-conversation";
import { ConversationCard } from "../conversation-panel/conversation-card";
interface ControlsProps {
@@ -11,7 +12,10 @@ interface ControlsProps {
}
export function Controls({ setSecurityOpen, showSecurityLock }: ControlsProps) {
const { data: conversation } = useActiveConversation();
const params = useParams();
const { data: conversation } = useUserConversation(
params.conversationId ?? null,
);
return (
<div className="flex flex-col gap-2 md:items-center md:justify-between md:flex-row">
@@ -2,12 +2,11 @@ import ColdIcon from "./state-indicators/cold.svg?react";
import RunningIcon from "./state-indicators/running.svg?react";
type SVGIcon = React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
export type ProjectStatus = "RUNNING" | "STOPPED" | "STARTING";
export type ProjectStatus = "RUNNING" | "STOPPED";
const INDICATORS: Record<ProjectStatus, SVGIcon> = {
STOPPED: ColdIcon,
RUNNING: RunningIcon,
STARTING: ColdIcon,
};
interface ConversationStateIndicatorProps {
@@ -6,7 +6,26 @@ import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/b
import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";
import { ModalBody } from "#/components/shared/modals/modal-body";
import { cn } from "#/utils/utils";
import { JSON_VIEW_THEME } from "#/utils/constants";
// Custom JSON viewer theme that matches our application theme
const jsonViewTheme = {
base00: "transparent", // background
base01: "#2d2d2d", // lighter background
base02: "#4e4e4e", // selection background
base03: "#6c6c6c", // comments, invisibles
base04: "#969896", // dark foreground
base05: "#d9d9d9", // default foreground
base06: "#e8e8e8", // light foreground
base07: "#ffffff", // light background
base08: "#ff5370", // variables, red
base09: "#f78c6c", // integers, orange
base0A: "#ffcb6b", // booleans, yellow
base0B: "#c3e88d", // strings, green
base0C: "#89ddff", // support, cyan
base0D: "#82aaff", // functions, blue
base0E: "#c792ea", // keywords, purple
base0F: "#ff5370", // deprecated, red
};
interface SystemMessageModalProps {
isOpen: boolean;
@@ -188,9 +207,8 @@ export function SystemMessageModal({
</h4>
<div className="text-sm mt-2 p-3 bg-gray-900 rounded-md overflow-auto text-gray-300 max-h-[400px] shadow-inner">
<ReactJsonView
name={false}
src={parameters}
theme={JSON_VIEW_THEME}
theme={jsonViewTheme}
/>
</div>
</div>
@@ -16,7 +16,6 @@ interface FeedbackFormProps {
export function FeedbackForm({ onClose, polarity }: FeedbackFormProps) {
const { t } = useTranslation();
const copiedToClipboardToast = () => {
hotToast(t(I18nKey.FEEDBACK$PASSWORD_COPIED_MESSAGE), {
icon: "📋",
@@ -128,9 +127,7 @@ export function FeedbackForm({ onClose, polarity }: FeedbackFormProps) {
className="grow"
isDisabled={isPending}
>
{isPending
? t(I18nKey.FEEDBACK$SUBMITTING_LABEL) || "Submitting..."
: t(I18nKey.FEEDBACK$SHARE_LABEL)}
{t(I18nKey.FEEDBACK$SHARE_LABEL)}
</BrandButton>
<BrandButton
type="button"
@@ -142,12 +139,6 @@ export function FeedbackForm({ onClose, polarity }: FeedbackFormProps) {
{t(I18nKey.FEEDBACK$CANCEL_LABEL)}
</BrandButton>
</div>
{isPending && (
<p className="text-sm text-center text-neutral-400">
{t(I18nKey.FEEDBACK$SUBMITTING_MESSAGE) ||
"Submitting your feedback, please wait..."}
</p>
)}
</form>
);
}
@@ -84,7 +84,7 @@ export function RepositorySelectionForm({
const allRepositories = repositories?.concat(searchedRepos || []);
const repositoriesItems = allRepositories?.map((repo) => ({
key: repo.id,
label: decodeURIComponent(repo.full_name),
label: repo.full_name,
}));
const branchesItems = branches?.map((branch) => ({
@@ -28,7 +28,7 @@ export function TaskSuggestions({ filterFor }: TaskSuggestionsProps) {
{suggestedTasks?.map((taskGroup, index) => (
<TaskGroup
key={index}
title={decodeURIComponent(taskGroup.title)}
title={taskGroup.title}
tasks={taskGroup.tasks}
/>
))}
@@ -68,7 +68,7 @@ export function ModelSelector({
const { t } = useTranslation();
return (
<div className="flex flex-col md:flex-row w-[full] md:w-[680px] justify-between gap-4 md:gap-[46px]">
<div className="flex w-[680px] justify-between gap-[46px]">
<fieldset className="flex flex-col gap-2.5 w-full">
<label className="text-sm">{t(I18nKey.LLM$PROVIDER)}</label>
<Autocomplete
@@ -42,7 +42,6 @@ export function SettingsForm({ settings, models, onClose }: SettingsFormProps) {
posthog.capture("settings_saved", {
LLM_MODEL: newSettings.LLM_MODEL,
LLM_API_KEY_SET: newSettings.LLM_API_KEY_SET ? "SET" : "UNSET",
SEARCH_API_KEY_SET: newSettings.SEARCH_API_KEY ? "SET" : "UNSET",
REMOTE_RUNTIME_RESOURCE_FACTOR:
newSettings.REMOTE_RUNTIME_RESOURCE_FACTOR,
});
@@ -87,7 +86,7 @@ export function SettingsForm({ settings, models, onClose }: SettingsFormProps) {
name="llm-api-key-input"
label={t(I18nKey.SETTINGS_FORM$API_KEY)}
type="password"
className="w-full"
className="w-[680px]"
placeholder={isLLMKeySet ? "<hidden>" : ""}
startContent={isLLMKeySet && <KeyStatusIcon isSet={isLLMKeySet} />}
/>
@@ -21,7 +21,7 @@ export function SettingsModal({ onClose, settings }: SettingsModalProps) {
<ModalBackdrop>
<div
data-testid="ai-config-modal"
className="bg-base-secondary min-w-[384px] m-4 p-6 rounded-xl flex flex-col gap-2 border border-tertiary"
className="bg-base-secondary min-w-[384px] p-6 rounded-xl flex flex-col gap-2 border border-tertiary"
>
{aiConfigOptions.error && (
<p className="text-danger text-xs">{aiConfigOptions.error.message}</p>
@@ -0,0 +1,42 @@
import React, { useMemo } from "react";
import { useParams } from "react-router";
interface ConversationContextType {
conversationId: string;
}
const ConversationContext = React.createContext<ConversationContextType | null>(
null,
);
export function ConversationProvider({
children,
}: {
children: React.ReactNode;
}) {
const { conversationId } = useParams<{ conversationId: string }>();
if (!conversationId) {
throw new Error(
"ConversationProvider must be used within a route that has a conversationId parameter",
);
}
const value = useMemo(() => ({ conversationId }), [conversationId]);
return (
<ConversationContext.Provider value={value}>
{children}
</ConversationContext.Provider>
);
}
export function useConversation() {
const context = React.useContext(ConversationContext);
if (!context) {
throw new Error(
"useConversation must be used within a ConversationProvider",
);
}
return context;
}

Some files were not shown because too many files have changed in this diff Show More