Compare commits

..

602 Commits

Author SHA1 Message Date
openhands ac07afbb3c fix: make LLM response handling more robust for deepseek and other providers
- Replace type-based checks with dictionary-based checks
- Update message access to use dictionary syntax
- Remove unused imports
2025-03-25 06:28:34 +00:00
openhands b9f330db1b Merge main into fix/llm-mypy-errors (keeping our poetry.lock) 2025-03-24 23:35:44 +00:00
Caique 23e775b1e0 docs: add pt-BR translation for official docs (#7416) 2025-03-24 23:13:52 +00:00
Boxuan Li f7d3516dec Trajectory replay on web app (under feature flag) (#6348) 2025-03-24 14:40:07 -07:00
Engel Nyst de05ea898e Make the conversation title a little longer (#7477)
Co-authored-by: Robert Brennan <accounts@rbren.io>
2025-03-24 20:47:33 +00:00
Engel Nyst 94cb91947d Don't set seed for users (#7474) 2025-03-24 19:38:45 +00:00
Xingyao Wang b1470a1ac4 (frontend): only show "download via vscode" in conversation card (#7471) 2025-03-24 18:44:17 +00:00
மனோஜ்குமார் பழனிச்சாமி 2518901e6e feat: Support seed parameter (#7441) 2025-03-24 19:18:00 +01:00
tofarr e639283ac9 Fix for overflow (#7470) 2025-03-24 17:32:38 +00:00
dependabot[bot] 28cc04908c chore(deps-dev): bump pre-commit from 4.1.0 to 4.2.0 in the pre-commit group (#7345)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-24 17:19:25 +00:00
tofarr 1a3354404e Fix text wrap on context menu (#7468) 2025-03-24 16:44:04 +00:00
Ryan H. Tran 80279f9d36 Upgrade openhands-aci to 0.2.7 (#7462) 2025-03-25 00:15:59 +08:00
Zach 0b3d15a4d7 Fix missing 'fi' statement in GAIA benchmark scripts/run_infer.sh (#7465) 2025-03-24 16:04:25 +00:00
Marco Dalalba 8b68d086f0 fix #7267: adding base url to axios (#7267) 2025-03-24 09:25:52 -04:00
Engel Nyst 0f143a43c9 Add support for .openhands/setup.sh script in all entry points (#7459)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-24 13:37:08 +01:00
Engel Nyst e61e4d57d9 Fix #7451: Add guidance to use git add . in system prompt (#7458)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
Co-authored-by: Robert Brennan <accounts@rbren.io>
2025-03-24 13:33:45 +01:00
Xingyao Wang 4e86bdf3d9 (frontend): Implement BrowseInteractiveAction in frontend (#7452)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-23 22:17:56 -04:00
Robert Brennan 3cef499b81 Fix conversation list: remove GitHub link and show created_at date (#7435)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-23 20:08:02 -06:00
Xingyao Wang e2a0884ecd Update repo.md to remind the agent about PR template (#7456) 2025-03-24 02:03:56 +00:00
Robert Brennan 2849974729 [WIP] better code display (#7453)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-23 18:10:07 -07:00
Kento Sugita daa4af18d1 fix timeout to impove stability (#7443) 2025-03-23 15:06:05 -07:00
Xingyao Wang 1ec1076fee [microagent] Add pdflatex microagent (#7444)
Co-authored-by: Robert Brennan <accounts@rbren.io>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-03-24 03:08:22 +08:00
tofarr 65bd4be607 Fix for broken vscode url (#7442) 2025-03-23 10:17:12 -06:00
Robert Brennan 306188817f Remove upload functionality and add tooltip for Code not in GitHub link (#7431)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-23 02:03:05 +00:00
Robert Brennan 99aa9bef70 Refactor runtime documentation and add hardened Docker installation guide (#7429)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-03-23 01:35:47 +00:00
Robert Brennan 9e975ba566 Add logo color (#CFB755) for tab icons (#7433)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-23 01:19:14 +00:00
Robert Brennan 782e143c22 update placeholder text for credits (#7430) 2025-03-22 18:18:43 -07:00
Robert Brennan e0a3b4b822 Move documentation link above settings gear in sidebar (#7432)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-22 18:18:31 -07:00
Robert Brennan b53a5e7528 Optimize file_editor pattern with prefix check (#7428)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-22 17:31:18 -07:00
Robert Brennan 8dda45bf99 Change API key placeholder to <hidden> when key is set (#7427)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-22 16:30:54 -07:00
Robert Brennan 0a0ed3f606 Add "Setting up workspace..." status message during repo cloning and setup (#7424)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-22 23:52:59 +01:00
Xingyao Wang 01e0e29a9f Reduce bash SOFT timeout from 30 to 10 seconds (#7423)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-22 22:42:24 +00:00
Robert Brennan e57305ee0c Remove continue button and associated logic (#7425)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-22 22:22:53 +00:00
Robert Brennan 3c43d3d154 Auto-generate conversation titles from first user message (#7390)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com>
2025-03-22 22:07:33 +00:00
Robert Brennan fd7c2780f5 Add support for .openhands/setup.sh script (#5985)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-22 14:46:35 -07:00
Xingyao Wang 6f9ced1c23 [Observability] add metadata to track llm request for sessions (#7381)
Co-authored-by: Robert Brennan <accounts@rbren.io>
2025-03-23 04:20:38 +08:00
Paige Bailey e255aa95fe Updated to reference the new Gemini 2.0 flash model. (#7420) 2025-03-22 19:50:04 +01:00
Rohit Malhotra f2a742130d (Chore): Use OH logger instead of prints for resolver (#7407) 2025-03-22 13:28:02 -04:00
Boxuan Li d343e4ed9a Config to save screenshots in trajectory (#7284) 2025-03-22 05:43:01 +00:00
Engel Nyst 0fec237ead Remove unused event_to_memory function from serialization code (#7412)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-21 22:13:59 -07:00
sp.wack 4c103761f9 Fix flaky test (#7408) 2025-03-21 23:33:53 +00:00
Engel Nyst a03ad1079c Rename oh_action to oh_user_action for clarity (#7368)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-21 22:23:15 +00:00
sp.wack 7d0e2265f7 chore: Feature flag refactor (#7393) 2025-03-21 21:45:59 +00:00
mamoodi 8532c94d8e Remove additional prompt for the app feature (#7406)
Co-authored-by: Robert Brennan <accounts@rbren.io>
2025-03-21 21:43:00 +00:00
Jason Burt 838e3d5ae4 Add comprehensive frontend testing documentation with example links (#7327)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com>
2025-03-21 21:03:40 +00:00
AutoLTX 3bc52cad7b [FrontEnd] Display API cost and token usage in frontend (#7099)
Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
2025-03-21 20:43:53 +00:00
sp.wack ce26f1c6d3 fix(frontend): Remove settings context (#7378) 2025-03-21 19:55:16 +04:00
Robert Brennan 37188c7606 Clean up conversation joining (#7379) 2025-03-21 09:18:37 -04:00
Rohit Malhotra d9926d2491 (hotfix): Pass git providers object for only remote runtimes (#7387) 2025-03-20 23:28:28 +00:00
Rohit Malhotra 41efa100f0 [Fix]: Plumb provider tokens to runtime (#7247)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-03-20 22:43:27 +00:00
Engel Nyst 6f204fd557 Fix stream iterator (#7384)
Co-authored-by: Rohit Malhotra <rohitvinodmalhotra@gmail.com>
2025-03-20 23:25:28 +01:00
Xingyao Wang 9bd1992738 Remove download workspace and download files buttons (#7333)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-21 03:26:30 +08:00
diwu-sf 3856a896ea fix file chunking corruption (#7338) 2025-03-20 15:21:36 -04:00
Rohit Malhotra b0030d3a2b [Bug]: Use json dumps instead of str repr to prevent escape character mismatches (#7369) 2025-03-20 10:33:15 -04:00
sp.wack d76477099c chore(frontend): Hardcode feature flag values (#7360)
Co-authored-by: Robert Brennan <accounts@rbren.io>
2025-03-20 13:36:49 +00:00
tawago 3e3b2aaa5c Rename --repo argument to --selected-repo to avoid confusion in the resolver workflow (#7287)
Co-authored-by: Rohit Malhotra <rohitvinodmalhotra@gmail.com>
2025-03-20 05:01:00 +00:00
Robert Brennan 1f8aa93843 revert runtime for resolver (#7365) 2025-03-20 04:52:43 +00:00
Engel Nyst 34920ea04e Save agent state (#7372) 2025-03-20 05:16:49 +01:00
Graham Neubig f5aeb47a72 Fix homepage internationalization (Issue #7355) (#7359)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-19 17:48:30 -04:00
Engel Nyst c830177207 Move security.md to the global microagents (#7361) 2025-03-20 05:40:05 +08:00
Xingyao Wang e4ccd4057d misc: tweak frontend prompt to prevent agent push to a different branch & update app prompt (#7357) 2025-03-20 05:09:51 +08:00
chuckbutkus c3d60b31d1 All-1465 Move user conversations (#7340) 2025-03-19 16:03:09 -04:00
mamoodi 35b70ca915 Release 0.29.1 (#7350) 2025-03-19 16:01:16 -04:00
Ivan Dagelic a8d65c11e0 fix: daytona runtime action execution handling (#7100)
Signed-off-by: Ivan Dagelic <dagelic.ivan@gmail.com>
2025-03-19 15:27:41 -04:00
Xingyao Wang a4746a53d8 Update prompt for runtime additional info (#7349) 2025-03-19 16:35:20 +00:00
Zaid Sheikh 13bb474623 feat(Session): add sandbox base, runtime container image to session settings (#7329) 2025-03-19 16:08:43 +00:00
blacksmith-sh[bot] 09aa62f1c3 blacksmith.sh: Migrate workflows to Blacksmith (#7148)
Co-authored-by: blacksmith-sh[bot] <157653362+blacksmith-sh[bot]@users.noreply.github.com>
2025-03-19 15:10:17 +00:00
Robert Brennan cbc26a5e40 Pass litellm error types to user and update error message (#7344)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-19 14:44:30 +00:00
Graham Neubig 6824d14ed8 Update config.template.toml to match current codebase (#7314)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-19 15:37:49 +01:00
Engel Nyst d9e40f721c (chore) Fix linting issues across the codebase (#7336)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-19 04:42:26 +00:00
Jason Burt 8a73184801 Docs : adding in github fine grained tokens documentation and settings link to documentation … (#7192)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-18 22:04:52 -04:00
Rohit Malhotra 06e8c4dad4 [Debug]: Add logs to runtime to assess root cause of expired github token (#7331) 2025-03-18 22:40:00 +00:00
Rohit Malhotra e2521743b6 [Bug]: Refresh runtime gh token when agent calls gh apis (#7330) 2025-03-18 21:24:57 +00:00
Xingyao Wang f2a54f4e23 Implement asynchronous browser initialization (#7328)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-19 03:34:57 +08:00
Graham Neubig a594595fea docs: fix broken links in LLM documentation (#7322)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-18 18:45:12 +01:00
Joseph Turian 0620679d11 fix: Correct JavaScript syntax in GitHub Actions workflow (#7194) 2025-03-18 13:42:37 -04:00
Nick 78708efbf1 feat(microagents): Add security microagent (#7323) 2025-03-18 17:13:06 +00:00
Jason Burt cf06f20a0e docs: Add development overview and documentation resources (#7220)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-18 17:09:37 +00:00
dependabot[bot] c68fba01a8 chore(deps): bump the version-all group with 4 updates (#7325)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-18 16:55:43 +00:00
mamoodi f2c7f8a6da Release 0.29 (#7236) 2025-03-18 11:52:31 -04:00
Engel Nyst 259140ffc9 Add tests for NullObservation with cause > 0 and clarify event flow (#7315)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-18 15:21:09 +00:00
Rohit Malhotra 3150af1ad7 [Fix]: Make provider tokens immutable (#7317) 2025-03-18 10:50:13 -04:00
Xingyao Wang dde90fc636 chore: update remote runtime docs (#7319) 2025-03-18 11:08:22 +08:00
Engel Nyst 83458f5146 Fix style issues with pre-commit (#7318)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-18 01:34:27 +00:00
mamoodi f1149defc9 Remove python api docs from docs (#7316) 2025-03-17 19:55:46 -04:00
kjain14 507afd7f06 Add TestGenEval benchmark (#5534)
Co-authored-by: Kush Dave Jain <kdjain@pit.isri.cmu.edu>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Graham Neubig <neubig@gmail.com>
2025-03-17 20:16:45 +00:00
chuckbutkus 1a755c3fdb Fix reading of old conversations (#7309) 2025-03-17 15:08:48 -04:00
dependabot[bot] 41c8c9230b chore(deps): bump the version-all group with 4 updates (#7308)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-17 18:57:56 +00:00
Xingyao Wang 9b9e728cf6 Iterative evaluation with rule-based critic (#7293) 2025-03-17 18:37:35 +00:00
Engel Nyst a4b836b5f9 Don't try to send the new events in the UI (#7277) 2025-03-17 14:50:22 +01:00
Xingyao Wang a4d632498c SWE-Gym rollout stability fix & using a validated SWE-Gym set (#7182)
Co-authored-by: Robert Brennan <accounts@rbren.io>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
Co-authored-by: Graham Neubig <neubig@gmail.com>
2025-03-17 21:15:01 +08:00
Engel Nyst 4f017081fc Quick fix docs (#7299)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-17 05:50:05 +00:00
Engel Nyst 51fb1fae88 RecallObservations (#7292) 2025-03-17 03:18:22 +01:00
Graham Neubig 106b230fea Update Slack invitation links (#7296)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-17 02:06:48 +00:00
Xingyao Wang 9b262dd057 fix retry on ConnectionError & retry on remote runtime by default (#7294) 2025-03-17 01:18:54 +00:00
chuckbutkus 8074b261d3 Move current user_id to github_user_id and create a new user_id field (#7231)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Rohit Malhotra <rohitvinodmalhotra@gmail.com>
2025-03-16 16:32:27 -04:00
dependabot[bot] 999a59f938 chore(deps): bump the version-all group with 5 updates (#7253)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-16 19:51:08 +00:00
chuckbutkus fbba57d3b5 Fix saving of settings (#7282) 2025-03-16 19:06:46 +00:00
Engel Nyst 3f6c8a2338 Fix visual browsing (#7278)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-16 16:50:25 +01:00
Engel Nyst dd09d46ccb Remove DelegatorAgent (fix #7280)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-16 16:49:28 +01:00
tofarr 8897b45eeb Fix for too much reaction in logs (#7276) 2025-03-16 08:21:30 -06:00
Ryan H. Tran 30109e8f20 Separate tool descriptions to support models with limited description length (#7258) 2025-03-16 09:48:13 +01:00
Engel Nyst cc45f5d9c3 Add RecallActions and observations for retrieval of prompt extensions (#6909)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Calvin Smith <email@cjsmith.io>
2025-03-15 21:48:37 +01:00
tofarr e34a771e66 Fix for issue where initial command fails (#7254) 2025-03-14 14:49:57 -06:00
tofarr ec763f8105 Fix for error where credits is accessed even when billing is disabled (#7250) 2025-03-14 15:10:54 +00:00
Ryan H. Tran 165c0cc42e Add doc for local runtime (#7234)
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
2025-03-14 22:09:33 +08:00
dependabot[bot] 1b4f15235e chore(deps): bump the version-all group with 4 updates (#7241)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-13 22:15:47 +01:00
Calvin Smith 303b7ab180 (fix): Conditional imports resolved in SWE-bench eval script while multiprocessing enabled (#7244)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
2025-03-13 13:29:11 -06:00
Rohit Malhotra 78d185b102 [Feat]: Support Gitlab PAT (#7064)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-13 14:44:49 -04:00
Ryan H. Tran 300bfbdf2d Upgrade openhands-aci to 0.2.6 (#7233) 2025-03-14 02:10:59 +08:00
Xingyao Wang e2f414bf26 chore: update doc for allhands doc (#7242)
Co-authored-by: mamoodi <mamoodiha@gmail.com>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-03-14 00:32:17 +08:00
Calvin Smith 3b955dd9d5 (fix): Improve formatting of summarizing LLM inputs (#7239)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
2025-03-13 10:21:29 -06:00
sp.wack f1eb1f59c3 hotfix(frontend): Fix overriding tailwind animation classes (#7243) 2025-03-13 16:03:54 +00:00
sp.wack e1f6929d98 feat: saas new user modal (#7098)
Co-authored-by: Tim O'Farrell <tofarr@gmail.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-13 19:15:57 +04:00
Engel Nyst 2a7f926591 Detect condensation loops at 10 repetitions, not 3 (#7237) 2025-03-13 14:32:01 +00:00
Xingyao Wang b8daab721d Update agent message to use first-person perspective (#7197)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-13 04:39:24 +08:00
Robert Brennan b3cac69121 remove old microagents (#6964)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-12 16:18:19 -04:00
Boxuan Li 49a29c19cb Remove mention of non-existent config micro_agent_name (#7209) 2025-03-13 03:33:59 +08:00
Robert Brennan 7084b0238c Fix HTTPException not callable error in action_execution_server middleware (#7215)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-13 03:10:13 +08:00
Elena Chistova 38e866cde4 Fix official SWE-Bench docker image prefix (#7214) 2025-03-12 18:23:19 +00:00
sp.wack 6ec4bc74bf chore(frontend): Turn off query caching by default (#7222) 2025-03-12 17:52:11 +00:00
juanmichelini b36deca265 Added link to paper in commit0 README (#7221) 2025-03-12 17:17:22 +00:00
Engel Nyst 09d73d96c8 Add troubleshooting note for GitHub token in microagent (#7208)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-12 04:45:58 +01:00
dependabot[bot] 966c11f205 chore(deps): bump the version-all group across 1 directory with 17 updates (#7203)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-12 00:15:52 +00:00
Robert Brennan 5128377baa remove llamaindex (#7151)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-03-11 22:28:56 +00:00
Engel Nyst 924acb182b Add Swift Linux Installation Microagent (#7195)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-11 19:45:50 +00:00
tofarr 8043612420 Feat user settings (#7190) 2025-03-11 12:57:44 -06:00
Calvin Smith 637a1d5c17 Adds unit test for the interaction between agent controller truncation and condenser (#7186)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
2025-03-11 09:57:15 -06:00
AutoLTX 5e521a4a6e Expose accumulate and llm_metric from eventstream (backend) (#7082)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-03-11 12:18:08 +01:00
chuckbutkus 2cb5b91300 Change names to prepare for moving to keycloak User ID (#7178) 2025-03-10 19:23:57 -04:00
answer-huang d6e601ea2e bugfix: selected_repository may includes more then two parts, could b… (#7114) 2025-03-10 19:47:33 +00:00
Rohit Malhotra ac680e7688 [Fix]: Remove remaining hard coded refs to sessions store (#7176)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-10 15:07:01 -04:00
mamoodi 4b04f09035 Update Cloud docs (#7158)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-03-10 14:00:06 -04:00
mamoodi e99f503e0f Release 0.28.1 (#7170) 2025-03-10 13:22:34 -04:00
Rohit Malhotra f51eb93d3e Add error logs to API response from GH Service (#7165) 2025-03-09 21:45:13 +00:00
mamoodi 7c2a98d1ce Change back the runtime binding address to 0.0.0.0 (#7161) 2025-03-09 11:37:10 -04:00
Ray Myers dc9489ddcd Include metadata like session_id in logs (#7145) 2025-03-08 00:28:51 +01:00
sp.wack 83851c398d chore(frontend): Restyle toasts and replace all current instances with new one (#6854) 2025-03-08 01:23:50 +04:00
Xingyao Wang a4908f9a75 [agent] system message + SWE-Bench instruction improvements (#7018) 2025-03-08 00:27:02 +08:00
Robert Brennan 366fd7ab8a Improve agent loop tracking and make concurrent limit configurable (#6945)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Tim O'Farrell <tofarr@gmail.com>
2025-03-07 09:19:50 -07:00
dependabot[bot] 318fcbcfc7 chore(deps): bump the version-all group across 1 directory with 21 updates (#7146)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
2025-03-07 15:58:54 +00:00
sp.wack 521492f8f9 chore: Prevent user from modifying basic LLM settings in saas mode (#7137) 2025-03-07 19:14:06 +04:00
mamoodi 71f6b0b4a9 Release 0.28.0 (#7127)
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
2025-03-07 09:17:01 -05:00
Xingyao Wang b146b63380 chore: temporary fix to get sonnet 3.7 working again (#7140) 2025-03-06 20:30:35 +00:00
Engel Nyst 22064d5555 Add condensation observation to history and detect its loop (#7132) 2025-03-06 18:52:45 +01:00
sp.wack 08735a9b72 Fix loading spinner (#7134) 2025-03-06 17:40:13 +00:00
tofarr 54f982589a Fix annoying Avatar flicker when loading (#7129) 2025-03-06 15:59:28 +00:00
Nan Jiang ec087993f1 rename commit0_bench to commit0 (#7124) 2025-03-06 02:55:39 +00:00
chuckbutkus f12e9e94f7 Offline session login (#7086)
Changes to allow the resolver to access keycloak and retrieve an offline token.
2025-03-05 21:58:34 +00:00
Xingyao Wang 9f720a9d69 [eval] SWE-Gym Integration (#6651)
Co-authored-by: Robert Brennan <accounts@rbren.io>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
Co-authored-by: Graham Neubig <neubig@gmail.com>
2025-03-05 20:15:02 +00:00
Xingyao Wang bbf40c6576 docs: cleanup and update SWE-Bench documentation; and remove the support of non-instance-level image (#7118)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-03-06 03:18:40 +08:00
Ivan Dagelic 1ffee80dcb feat: prompt instructions for runtimes (#6943)
Signed-off-by: Ivan Dagelic <dagelic.ivan@gmail.com>
2025-03-05 17:45:55 +01:00
dependabot[bot] 43bc944ac4 chore(deps-dev): bump typescript from 5.7.3 to 5.8.2 in /docs in the version-all group (#7116)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-05 15:09:49 +00:00
Xingyao Wang 4be33a079b Update SWE-Bench README.md about RemoteRuntime (#7108) 2025-03-05 23:00:54 +08:00
Aditya Bharat Soni c76a659cde Condenser for Browser Output Observations (#6578)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Rick van Hattem <wolph@wol.ph>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
Co-authored-by: Boxuan Li <liboxuan@connect.hku.hk>
Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com>
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
Co-authored-by: tofarr <tofarr@gmail.com>
Co-authored-by: Xingyao Wang <xingyao6@illinois.edu>
Co-authored-by: Rohit Malhotra <rohitvinodmalhotra@gmail.com>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Akim Tsvigun <36672861+Aktsvigun@users.noreply.github.com>
Co-authored-by: Akim Tsvigun <aktsvigun@nebius.com>
Co-authored-by: mamoodi <mamoodiha@gmail.com>
Co-authored-by: OpenHands <opendevin@all-hands.dev>
Co-authored-by: Calvin Smith <email@cjsmith.io>
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
Co-authored-by: Graham Neubig <neubig@gmail.com>
Co-authored-by: Peter Dave Hello <hsu@peterdavehello.org>
Co-authored-by: Ray Myers <ray.myers@gmail.com>
2025-03-04 16:28:33 -05:00
dependabot[bot] 0f68a18cbb chore(deps): bump docker/setup-qemu-action from 3.4.0 to 3.6.0 (#7075)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-04 20:57:14 +00:00
Robert Brennan c9ebabd82d Add contact link to runtime settings label (#6880)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-05 00:49:53 +04:00
mamoodi ad932e45e8 Checkout HEAD instead of Merge Commit for builds (#7085) 2025-03-04 15:32:59 -05:00
sp.wack 3278caf3c2 Always enable GET /settings (#7101) 2025-03-04 14:54:26 -05:00
He Du 896d7b8b96 Openhands fix issue 7091 (#7092)
Co-authored-by: 杜贺 <duhe@duhedeMacBook-Pro-2.local>
2025-03-04 18:39:28 +01:00
Ryan H. Tran cb61282c39 Improve error detection for read and edit observations (#7090) 2025-03-04 15:05:15 +01:00
Graham Neubig 7a235ce6ff Fix/mypy routes (#6900)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-04 03:43:09 +00:00
Rohit Malhotra 5ffb1ef704 Fix typing (#7083)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-03 20:41:11 +00:00
chuckbutkus 4e4f4d64f8 Fix runtime to call new token refresh (#7084) 2025-03-03 20:36:27 +00:00
openhands 096b259694 Replace partial() with proper type hints
- Remove partial() since we're not using its argument binding functionality
- Add proper type hints for class attributes and variables
- Fix mypy errors with proper type annotations
2025-03-03 20:00:53 +00:00
openhands 7f3202d0e0 Replace partial() with direct function wrappers
- Replace partial() with direct function wrappers to make the code clearer
- Keep type hints using cast() to satisfy mypy
- Add proper type hints for all functions
2025-03-03 19:56:30 +00:00
openhands e63dfca517 Replace partial() with cast() for type hints
- Replace partial() with cast() since we're not using partial's argument binding
- Add proper type hints for the cast() calls
- Add missing imports for type hints
2025-03-03 19:50:30 +00:00
Engel Nyst 3d38a105cf Add loading from toml for condensers (#6974)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Calvin Smith <email@cjsmith.io>
2025-03-03 20:32:46 +01:00
chuckbutkus b1ab4d342e Add offline_access scope (#7059) 2025-03-03 19:06:08 +00:00
openhands cb705b736f Remove duplicate default values in retry_mixin.py
- Remove hardcoded default values for retry parameters in retry_mixin.py
  since they are already defined in LLMConfig
- Add comment explaining where the default values come from
- Keep partial() usage to maintain type compatibility
2025-03-03 18:50:33 +00:00
Graham Neubig 1e5c4da0fc Merge branch 'main' into fix/llm-mypy-errors 2025-03-03 13:46:18 -05:00
Rohit Malhotra 3e91899720 [Experimental]: Attach convo id to initial user instructions (#7062) 2025-03-03 13:46:09 -05:00
dependabot[bot] 959fa3ed64 chore(deps): bump the version-all group across 1 directory with 28 updates (#7077)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
2025-03-03 18:32:27 +00:00
tofarr c51f07bd1f Fixes for keycloak in localhost (#7079) 2025-03-03 10:36:57 -07:00
tofarr b8ef68dc60 Upgrade default version of claude (#7072) 2025-03-03 11:31:12 -05:00
Ivan Dagelic d21bd49f08 docs: daytona runtime configuration (#7073)
Signed-off-by: Ivan Dagelic <dagelic.ivan@gmail.com>
2025-03-03 11:30:58 -05:00
Engel Nyst 4c265515d2 (chore) Fix linting issues in openhands directory (#7068)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-03 16:52:25 +01:00
Engel Nyst e4acfa68ec Fix #7060: Remove obsolete micro_agent_name attribute from test_long_term_memory.py (#7061)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-03 16:51:36 +01:00
mamoodi d395b5e11f Add more information to the main docs page (#7074) 2025-03-03 10:18:20 -05:00
tawago 6d75647c40 [Bugfix] Add github_token verification in resolver utils (#7065) 2025-03-03 09:59:16 -05:00
Engel Nyst 285010b48f OpenAI models fixes (#7045) 2025-03-03 15:53:18 +01:00
Engel Nyst 395c1ea9e3 [Refactor] split runtime initialization (create, connect, init) in cli scripts (#7036) 2025-03-03 00:19:25 +01:00
Graham Neubig 91ad59dc24 More explicit feedback message about how to report errors to developers (#7063) 2025-03-02 22:21:07 +00:00
Engel Nyst 62750c07e5 Fix GitLab CI environment variable check (issue #7050) (#7052)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-02 21:33:07 +01:00
Ivan Dagelic cf439fa89c chore: daytona readme quick start verbosity (#7056)
Signed-off-by: Ivan Dagelic <dagelic.ivan@gmail.com>
2025-03-02 20:17:35 +01:00
Ivan Dagelic 85c0864802 chore: update daytona readme (#7053)
Signed-off-by: Ivan Dagelic <dagelic.ivan@gmail.com>
2025-03-02 17:43:38 +01:00
mamoodi ff5d8094de Updates to the ISSUE TRIAGE (#7043) 2025-03-02 10:35:47 -05:00
Engel Nyst 660d1d1e64 Fix argument in swe-bench grading scripts (#7046) 2025-03-02 12:37:15 +08:00
David Thompson 78cc27a18f Update docker.py to support podman (#6778) 2025-03-01 23:10:03 +01:00
Engel Nyst 2db7a50e43 Separate microagent template (#7041) 2025-03-01 17:46:04 +01:00
きわみざむらい f3702cec35 Create CITATION.cff (#7037) 2025-03-01 13:21:31 +00:00
Robert Brennan d0cde6baf2 Remove hard error on session reuse (#7026)
Co-authored-by: Tim O'Farrell <tofarr@gmail.com>
2025-03-01 07:58:01 -05:00
Ray Myers 2e4911dc59 Structured logging mode (#7034) 2025-03-01 04:17:56 +00:00
chuckbutkus 5378932017 Fix URL for staging stack (#7030) 2025-02-28 22:32:52 +00:00
Xingyao Wang 4502b009c2 Add Kubernetes microagent (#7028)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
Co-authored-by: Robert Brennan <accounts@rbren.io>
2025-02-28 21:50:21 +00:00
Xingyao Wang d3ef98bb4e Add Docker microagent for installation and usage (#7027)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-03-01 05:46:33 +08:00
Christopher Pereira 06cc1ef297 Bug fixes (#6460)
Co-authored-by: OH <openhands@example.com>
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
2025-02-28 20:35:58 +00:00
chuckbutkus 17644fedd7 Keycloak changes (#6986) 2025-02-28 15:29:15 -05:00
Christopher Pereira de4cf07d4d Support docker_runtime_kwargs dict (#7025) 2025-02-28 20:19:36 +00:00
Calvin Smith 2eec4cea6f Fix: Update context window exceeded detection (#7024)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-28 13:08:24 -07:00
Ryan H. Tran 32ee6a5a64 Add diff for edit observation and display in UI (#7014) 2025-02-28 16:36:32 +00:00
Fredy Sierra 2b3c38d061 feat: Adding sandbox property runtime_binding_address to specify whic… (#6992) 2025-02-28 10:50:26 -05:00
Xingyao Wang 7810d8c4a0 [agent] improve finish tool for sonnet 3.7 (#7002) 2025-02-28 15:43:13 +00:00
dependabot[bot] a8f1feee5d chore(deps-dev): bump llama-index from 0.12.20 to 0.12.21 in the llama group (#7015)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-28 15:24:14 +00:00
Engel Nyst 0f07805a1b Refactor to a helper class for the agent's history (ConversationMemory) (#7008)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Calvin Smith <email@cjsmith.io>
2025-02-28 03:22:33 +01:00
Magic Mai 8a58e724c6 fix: Remove nested git repositories before adding files in SWE-bench (#6536)
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
2025-02-28 01:19:33 +00:00
Engel Nyst 996757f4f5 Separate additional_info template (#6996) 2025-02-28 00:53:45 +01:00
Xingyao Wang 02bc7de36d Add Memory Monitor VSCode Extension (#6951)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-27 22:02:33 +00:00
Xingyao Wang 42332294a1 [agent] Add "thinking" tool only (#6977) 2025-02-28 05:47:39 +08:00
Engel Nyst 6e3e9e397e Re-add separators between user messages (#7004) 2025-02-27 22:47:15 +01:00
dependabot[bot] fb8de1f98c chore(deps): bump the version-all group across 1 directory with 7 updates (#7005)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-27 22:44:48 +01:00
jaybutera 9e5f767571 add add_agent.md (#6891)
Co-authored-by: smd <>
2025-02-27 20:51:09 +00:00
tofarr ce30d63510 Page Refresh now restarts agent loop if status is STOPPED or ERROR (#6829) 2025-02-27 12:34:16 -07:00
Xingyao Wang 616ff49787 feat: add sound and browser notifications for agent state changes (#6530)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
2025-02-27 18:40:26 +00:00
mamoodi 0aa508c382 Release 0.27.0 (#6993) 2025-02-27 13:40:05 -05:00
tofarr f32f683f92 Refactor: Moving ConversationInfo to server module (#6981) 2025-02-27 11:04:38 -07:00
zchn fd5e1e0b0b Fix image tag inconsistency in forked-PR workflows (#6998) 2025-02-27 12:42:31 -05:00
sp.wack f02d55ae8b hotfix(frontend): Truncate long conversation card titles (#7001) 2025-02-27 17:21:43 +00:00
tofarr be73792230 Feat out of credits msg (#6969)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-27 16:02:31 +00:00
tofarr f437d06e81 Fix for error cleaning stale (#6971) 2025-02-27 08:04:37 -07:00
Engel Nyst 9e0fee1890 Refactor sandbox and security configurations (#6973) 2025-02-27 14:38:51 +01:00
Xingyao Wang 33780f97d0 [eval] Upgrade SWE-Bench to use official image and latest harness (#6838)
Co-authored-by: Robert Brennan <accounts@rbren.io>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
Co-authored-by: Graham Neubig <neubig@gmail.com>
2025-02-27 08:15:05 -05:00
dependabot[bot] 0137600988 chore(deps): bump react-icons from 5.4.0 to 5.5.0 in /docs in the version-all group (#6962)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-27 17:00:26 +04:00
Xingyao Wang 6b1a937024 [agent] System message update (#6787)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-27 10:06:01 +08:00
Ray Myers 34febafae4 Add system event listeners for monitoring (#6929) 2025-02-26 20:37:21 -05:00
Engel Nyst 8b234ae57c Azure completion_tokens fix (take two) (#6975) 2025-02-27 02:28:01 +01:00
dependabot[bot] 7ea418d020 chore(deps): bump the version-all group across 1 directory with 11 updates (#6966)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-26 23:47:23 +00:00
Xingyao Wang c4ba54122e refactor: codeact tools into separate files (#6978) 2025-02-26 22:57:14 +00:00
Engel Nyst 4b7cca9bdf Refactor agent_config loading from toml (#6967) 2025-02-26 22:06:10 +00:00
Engel Nyst 544e756f5f Fix microagent matching to the user message, not previous enhancements (#6963) 2025-02-26 20:46:24 +01:00
sp.wack d5f7dde7c9 hotfix(frontend): Consistent buttons and their styles throughout the app (#6835)
Co-authored-by: Robert Brennan <accounts@rbren.io>
2025-02-26 19:43:58 +00:00
Engel Nyst 4f98bce6df Add selected_repo to command line (#6949) 2025-02-26 20:42:59 +01:00
tofarr b38039e626 Fix fd leak (#6950) 2025-02-26 09:35:38 -07:00
Ray Myers db1f5a8df2 Add ability to define custom runtime classes (#6955)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-26 16:22:47 +01:00
Engel Nyst f8045784b6 Refactor llm config from toml and clean up (#6923) 2025-02-26 15:20:58 +01:00
Ryan H. Tran 34fa9ed4db fix: task_str validation not required for trajectory replay (#6957) 2025-02-26 14:17:03 +01:00
Rohit Malhotra e49b9243af [Feat]: Adding endpoint for suggested tasks Openhands could tackle (#6844)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-25 22:10:24 -05:00
Robert Brennan ef62ccde36 Add pause_closed_runtimes config to pause instead of stop runtimes (#6885)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-25 13:43:51 -05:00
Graham Neubig 6ba79c454b feat(llm): Add Claude 3.7 backend configurations (#6937)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-25 16:46:53 +00:00
sp.wack fbc06f42aa chore(frontend): Claude 3.7 is visible in dropdown for selection (#6931) 2025-02-25 08:17:33 -05:00
mamoodi f35ed5e277 Add documentation checkbox to PR template (#6924) 2025-02-24 16:03:10 -05:00
mamoodi 6787a3adf7 Release 0.26.0 (#6915) 2025-02-24 15:34:34 -05:00
celek fa50e0c9b9 add extended generic section (#5932)
Co-authored-by: Christophe Elek <christophe.elek@gmail.com>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-24 20:31:02 +01:00
tofarr f4c5bbda19 Revert "Fix file descriptor leak (#6897)" (#6921) 2025-02-24 13:47:13 -05:00
Mateusz Kwiatkowski 6562297615 Replace shebang with /usr/bin/env bash for improved portability (#6876)
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
2025-02-24 18:07:28 +00:00
Xingyao Wang 0217a7cfbd chore: Make remote runtime class default to None (#6919) 2025-02-24 17:51:48 +00:00
Christopher Pereira aa15c9d385 Handle Docker version string with +dfsg1 (#6732)
Co-authored-by: Christoper Pereira <kripper@gmail.com>
2025-02-24 15:36:55 +00:00
Engel Nyst 8ad89e368a Small rename to long term memory (#6914) 2025-02-24 23:35:16 +08:00
tofarr 29ba94fc0f Fix file descriptor leak (#6897)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-24 08:35:10 -07:00
Graham Neubig 8956f92f6a Fix mypy errors in core directory (#6901)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-24 10:00:57 -05:00
Graham Neubig 753e3c4205 Fix mypy errors in security/invariant directory (#6908)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-24 10:00:43 -05:00
Ivan Dagelic ecd573febc Daytona Runtime (#6863)
Signed-off-by: jsrzic <josip.srzic@gmail.com>
Signed-off-by: Ivan Dagelic <dagelic.ivan@gmail.com>
Co-authored-by: jsrzic <65179822+jsrzic@users.noreply.github.com>
2025-02-24 13:09:30 +01:00
sp.wack 325a558fbc hotfix: Fix switch color regression (#6881) 2025-02-24 16:01:47 +04:00
Engel Nyst 666c186826 Display session ID in CLI mode
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-24 03:18:28 +01:00
Engel Nyst 2d2dbf1561 Use LLM APIs responses in token counting (#5604)
Co-authored-by: Calvin Smith <email@cjsmith.io>
2025-02-23 17:58:47 +01:00
Engel Nyst abac25cc4c Keep the first user message by default in condensers (#6888) 2025-02-23 17:20:31 +01:00
Graham Neubig 526618753d Update .github/workflows/py-unit-tests.yml 2025-02-22 23:40:37 -05:00
openhands e25e6766fb Fix ruff and ruff-format issues 2025-02-22 23:27:10 +00:00
Graham Neubig 1b9a2b43c3 Merge branch 'main' into fix/llm-mypy-errors 2025-02-22 17:27:14 -05:00
tofarr 70b21d16bd Fix for regression where conversations are not clickable (#6886) 2025-02-22 13:19:18 +00:00
Engel Nyst bf82f75ae4 Revert "Fix: File Descriptor leak" (#6887) 2025-02-22 11:21:02 +00:00
tofarr a8bce3724f Fix: Increase Entropy Requirement for Secret Redaction to Reduce False Positives (#6875) 2025-02-22 01:44:28 -07:00
openhands 7886c1f920 Fix litellm type imports to use OpenAI types directly 2025-02-21 22:21:40 +00:00
Dai Dao e109f7e58e refactor : Improve frontend setup doc and locale error (#6850)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-21 23:14:44 +01:00
tofarr a20f299579 Fix: File Descriptor leak (#6883) 2025-02-21 14:47:59 -07:00
Robert Brennan bf77da7849 Add info logs for microagent loading and triggering (#6882)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-21 15:07:52 -05:00
openhands 4b49ffb01d Fix litellm type imports to use OpenAI types directly 2025-02-21 17:30:43 +00:00
openhands f74ce56a35 Fix litellm import path for Choices and StreamingChoices 2025-02-21 17:29:12 +00:00
openhands 9ccf680c38 Remove parallel test execution to fix failing tests 2025-02-21 17:25:59 +00:00
Calvin Smith 869ea59ecd (feat): Enable memory condensation from settings page (#6868)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
2025-02-21 10:15:31 -07:00
Graham Neubig f093c14ad3 Fix mypy errors in agenthub directory (#6811)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-21 13:55:27 +00:00
Graham Neubig 9d3a0a02b8 fix: Add missing type annotations in utils/ directory (#6687)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-21 08:27:57 -05:00
Graham Neubig 41068f6ea1 Merge branch 'main' into fix/llm-mypy-errors 2025-02-21 08:22:40 -05:00
sp.wack 35bab5070d chore(frontend): Remove latest conversation text in home screen (#6851) 2025-02-21 15:45:51 +04:00
tofarr d03b9775b5 Fix jumpy conversation panel (#6874) 2025-02-21 04:44:38 -07:00
Boxuan Li fab4532f6b Save complete trajectory in presence of history truncation (#6751)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-21 00:14:30 -08:00
Boxuan Li d33913e036 Add enable_history_truncation option to disable history truncation (#6820)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-21 06:43:02 +00:00
Xingyao Wang e52aee168e Docs: Clarify config.toml usage in evaluation harness (#6828)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-20 22:16:17 -08:00
dependabot[bot] c27b191358 chore(deps): bump the version-all group across 1 directory with 10 updates (#6870)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-21 06:10:35 +00:00
Engel Nyst 22c5ad85d9 Fix: Simplify prompt caching for new Anthropic API (#6860)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-20 23:38:55 +01:00
Rohit Malhotra 0180ce77b1 [Bug]: Fix workflow definition for installation phase of resolver (#6861) 2025-02-20 16:40:23 +00:00
sp.wack 2f14e53746 chore(frontend): Standardize custom colors used throughout the app (#6833) 2025-02-20 16:13:50 +00:00
Robert Brennan 52723061b1 Add conversation age limit configuration (#6763)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-20 10:50:17 -05:00
tofarr 42f1fc92fa Fix: Less squashed logo (#6853) 2025-02-20 07:56:20 -07:00
sp.wack 3f8bc8a7ea hotfix: Set proper minimum and maximum defaults that can be entered in billing input (#6842) 2025-02-20 17:58:23 +04:00
sp.wack f869ad995c hotfix: Remove external link in billing settings UI (#6841) 2025-02-20 17:58:09 +04:00
Calvin Smith 74c942c911 fix: LLM summarization prompt handles user messages (#6837)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
2025-02-19 14:17:48 -07:00
Engel Nyst eed7e2dd6e Refactor I/O utils; allow 'task' command line parameter in cli.py (#6187)
Co-authored-by: OpenHands Bot <openhands@all-hands.dev>
2025-02-19 22:10:14 +01:00
Engel Nyst 663e36109c Clean up NullObservations from the stream (#6260) 2025-02-19 20:40:40 +01:00
mamoodi e92e4a1cbc Update documentation with new settings page (#6716)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-19 14:30:36 -05:00
mamoodi 61ce673400 Release 0.25.0 (#6782) 2025-02-19 14:30:05 -05:00
Engel Nyst 5b1c8bc2e8 Merge branch 'main' into fix/llm-mypy-errors 2025-02-19 19:28:48 +01:00
Engel Nyst b95840db0c hotfix azure (#6806) 2025-02-19 19:24:35 +01:00
Xingyao Wang 003ebc0ded feat: better error logging for remote runtime (#6805) 2025-02-19 17:54:34 +00:00
Xingyao Wang 5b8db983b7 Merge branch 'main' into fix/llm-mypy-errors 2025-02-19 12:19:39 -05:00
Ryan H. Tran df8bbc2b67 Update openhands-aci to 0.2.5 (#6834)
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
2025-02-19 16:27:14 +00:00
diwu-sf eb5be2ab63 Fix download workspace zip file event loop hanging (#6722) 2025-02-19 10:51:52 -05:00
Calvin Smith 81f2b08a89 fix: Avoid infinite loop with rolling condensers and history truncation (#6795)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
2025-02-19 07:45:33 -07:00
Graham Neubig cb72a06ca3 Fix mypy errors in storage directory (#6809)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-19 10:52:49 +00:00
Graham Neubig 18543a2efa Merge branch 'main' into fix/llm-mypy-errors 2025-02-19 05:22:06 -05:00
Ryan H. Tran 340c2310d1 Fix diskcache breaking CI & eval intermittently (#6817) 2025-02-19 05:20:44 -05:00
openhands 63d9c3d668 Revert changes outside openhands/llm directory 2025-02-19 02:43:02 +00:00
openhands 2589b13815 Fix mypy errors in openhands/llm directory 2025-02-19 02:42:17 +00:00
Graham Neubig 592aca05e1 Merge branch 'main' into feature/strict-mypy-checks 2025-02-18 20:14:17 -05:00
Graham Neubig f4e5fb2873 Fix type checking errors in resolver directory (#6738)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-18 20:13:33 -05:00
Xingyao Wang 1a7003a705 Add sysbox support to remote runtime for eval; Add memory monitor, stress tests to help debug memory issue (#6684)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
Co-authored-by: Graham Neubig <neubig@gmail.com>
2025-02-18 20:02:28 +00:00
Calvin Smith 8d097efb4f enh: Refactor Event -> Message pipeline outside of CodeActAgent (#6715)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-18 11:23:06 -07:00
sp.wack 2e98fc8fb3 feat(SaaS): Billing settings screen (#6495)
Co-authored-by: Tim O'Farrell <tofarr@gmail.com>
2025-02-18 18:56:10 +01:00
sp.wack e3e00ed70a fix(frontend): Hide modal when in settings page if first time (#6792) 2025-02-18 21:28:59 +04:00
sp.wack 96d1992823 hotfix: Conversation panel toggle should change color given state (#6791) 2025-02-18 11:38:26 -05:00
dependabot[bot] 7a3a0d8c0c chore(deps): bump the version-all group across 1 directory with 9 updates (#6783)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
2025-02-18 16:09:30 +00:00
sp.wack fdffca18e0 hotfix(frontend): Input set/unset state and disable runtime input (#6788) 2025-02-18 20:01:39 +04:00
sp.wack b10416e0a3 hotfix: Consistent background color (#6786) 2025-02-18 19:38:01 +04:00
nottherealironman 1f462d2417 docs: add guide for minimum computing and storage requirements (#6575) 2025-02-18 14:20:35 +00:00
tofarr 0a6ff463db CSS Fixes (#6770) 2025-02-18 12:10:07 +00:00
Rohit Malhotra 9ff15bf94f Add selected branch to convo metadata (#6773) 2025-02-17 17:27:13 -05:00
mamoodi 6c48013601 Update OpenHands Cloud docs with correct permissions and instructions (#6774) 2025-02-17 21:48:57 +00:00
Graham Neubig 07fcb786af Upgrade tree sitter (#6740)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-17 20:14:26 +01:00
Rohit Malhotra ce42e22105 [Docs]: Cloud Openhands (#6747)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: mamoodi <mamoodiha@gmail.com>
2025-02-17 18:39:49 +00:00
Rohit Malhotra 14ee6d7afe hotfix(Secrets): Add event stream filter for refreshed secret (#6764) 2025-02-17 18:27:32 +00:00
tofarr 57391d6e66 Enable the multi conversation UI for all users (#6374) 2025-02-17 11:07:47 -07:00
Xingyao Wang a7bb73ded2 fix: disable prlimit since limiting --vm breaks nodejs (#6765) 2025-02-17 17:53:02 +00:00
tofarr f4b123f73b Improve SensitiveDataFilter and add comprehensive tests (#6755)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-17 10:23:43 -07:00
Robert Brennan ae31a24c29 Fix caps in status message (#6761) 2025-02-17 16:14:19 +00:00
Robert Brennan 3a478c2303 Better LLM retry behavior (#6557)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-17 10:36:59 -05:00
tofarr 82b5325792 Added iterate method and additional tests for search functions (#6756) 2025-02-17 08:11:13 -07:00
tofarr 265e8ae5f4 feat: implement optimistic updates for conversation deletion (#6745)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com>
2025-02-17 07:33:36 -07:00
李师胡 0cbf50576d docs(runtime): fix broken links of benchmarks (#6744)
Co-authored-by: jianhao1 <jianhao1@taobao.com>
2025-02-17 14:11:32 +00:00
dependabot[bot] 745038b394 chore(deps): bump the version-all group in /frontend with 4 updates (#6725)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
2025-02-17 11:35:50 +00:00
Arpan Koirala b018567d53 fix: no interaction when clearing poetry cache (#6752) 2025-02-17 12:18:27 +01:00
Christopher Pereira 30e39e85d0 Show docker build errors (#6695) 2025-02-15 06:58:16 +01:00
Boxuan Li 4443417c75 A few fixes for TAC evaluation harness (#6586) 2025-02-14 21:01:57 -08:00
Boxuan Li efbff2e655 Add a sanity test for load_app_config and get_agent_config_arg (#6723) 2025-02-14 21:01:42 -08:00
Cheng Yang 63565982aa docs: improve docstrings for CLI and config utils (#5398)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-15 01:51:59 +00:00
dependabot[bot] b07fddcb71 chore(deps): bump the version-all group across 1 directory with 12 updates (#6736)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-15 01:17:17 +00:00
Ryan H. Tran 99b50d038e chore: upgrade openhands-aci to 0.2.2 (#6731) 2025-02-15 03:21:40 +08:00
Rohit Malhotra 1ddfa99c57 [Resolver]: Prep env in expectation of release (#6735) 2025-02-14 19:11:01 +00:00
sp.wack 0c03e257b7 feat(frontend): Settings screen (#6550) 2025-02-14 15:11:18 +04:00
Rohit Malhotra 85e3a00d9d hotfix(Resolver): Workflow definition is out of sync with released package (#6719) 2025-02-14 04:31:22 +00:00
Rohit Malhotra edd51102ad fix: Simplify nested f-string to fix pydoc-markdown parsing (#6717) 2025-02-13 19:29:51 -05:00
wtiger9218 f5fccab1f6 feat(resolver): implement gitlab resolver (#6458)
Signed-off-by: José Luis Di Biase <josx@interorganic.com.ar>
Co-authored-by: José Luis Di Biase <josx@interorganic.com.ar>
Co-authored-by: Oriana <oriana@camba.coop>
Co-authored-by: Charlie <charlie@camba.coop>
Co-authored-by: Juan Manuel Daza <61162223+juanmanueldaza@users.noreply.github.com>
Co-authored-by: Juan Manuel Daza <juandaza@camba.coop>
Co-authored-by: Cody Kociemba <cody@symbaventures.com>
Co-authored-by: Rohit Malhotra <rohitvinodmalhotra@gmail.com>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-13 18:21:23 -05:00
Boxuan Li ef12bc5381 Evaluation harness: Add agent config option (#6662) 2025-02-13 15:05:03 -05:00
dependabot[bot] b197e0af47 chore(deps): bump the version-all group across 1 directory with 5 updates (#6712)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
2025-02-13 19:09:50 +00:00
Calvin Smith 341b695ad3 fix: Filter AgentCondensationObservation events from agent state (#6705)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
2025-02-13 11:50:05 -07:00
tofarr d46d99a35e More effective remote runtime identification (#6714) 2025-02-13 09:39:22 -07:00
mamoodi 653168fc3d Release 0.24.0 (#6689) 2025-02-13 10:22:05 -05:00
tofarr cb5e7f0130 Agent session no longer stuck in starting on raised exception (#6703) 2025-02-13 05:24:44 -07:00
Rohit Malhotra 312b9fbfb1 Feat: Add selected branch param to backend (#6508) 2025-02-12 15:39:10 -05:00
sp.wack ba599c7dd6 chore: Throw a 404 instead of returning defaults if settings does not exist (#6704) 2025-02-12 22:46:15 +04:00
tofarr 7e359eda4a Fix log formatting error (#6699) 2025-02-12 08:28:10 -07:00
Xingyao Wang f7c806c119 using all available system memory when RUNTIME_MAX_MEMORY_GB is not set (#6691) 2025-02-12 09:18:34 -05:00
sp.wack ff25e794ef Revert "Only show start project button in conversations" (#6698) 2025-02-12 17:57:13 +04:00
Xingyao Wang a371562d94 refactor: do not add DEBUG env var when it is not set (#6690) 2025-02-11 22:30:40 +00:00
dependabot[bot] 425ccc9b1f chore(deps-dev): bump @tanstack/eslint-plugin-query from 5.66.0 to 5.66.1 in /frontend in the eslint group (#6682)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-11 23:53:51 +04:00
Robert Brennan 1afe7f1058 Fix debug in remote runtime (#6688) 2025-02-11 17:43:46 +00:00
Xingyao Wang 3188646195 refactor(runtime): Use openhands-aci file editor directly in runtime instead of execute it through ipython (#6671)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Graham Neubig <neubig@gmail.com>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-12 01:37:44 +08:00
Eric Zhang 6772227c9d fix(frontend): fix public github repo cannot be selected (#6680) 2025-02-11 16:46:53 +00:00
Graham Neubig d309455733 Merge branch 'main' into feature/strict-mypy-checks 2025-02-11 10:19:36 -05:00
Xingyao Wang 6a6dc93e03 feat(runtime): use prlimit to limit resource usage of command to avoid OOM Runtime Kill (#6338)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
Co-authored-by: Graham Neubig <neubig@gmail.com>
2025-02-11 11:21:11 +08:00
Engel Nyst 1a715d2ec4 Clean up global in llm.py (we figured it's not needed) (#6675) 2025-02-11 00:00:46 +01:00
Xingyao Wang 4615548477 Bump OpenHands ACI to 0.2.1 (#6678) 2025-02-10 21:54:23 +00:00
sp.wack b12b426e3d hotfix: Typecheck routes during frontend build (#6676) 2025-02-10 20:52:59 +00:00
dependabot[bot] a1107a2c30 chore(deps): bump the version-all group across 1 directory with 9 updates (#6667)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-10 20:58:00 +01:00
dependabot[bot] af0becd65b chore(deps): bump docker/setup-qemu-action from 3.3.0 to 3.4.0 (#6666)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-10 19:58:37 +01:00
Fredy Sierra 13839b4273 fix: adding support for environment variables type dict (#6672)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-10 18:56:58 +00:00
Graham Neubig 7860055f8c fix: Normalize whitespace when comparing patch context lines (#6541)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-10 18:53:39 +00:00
tofarr 2b40a92943 Fix for issue where temp file is empty (#6669) 2025-02-10 11:07:40 -07:00
Graham Neubig 66a7920539 Merge branch 'main' into feature/strict-mypy-checks 2025-02-10 13:06:49 -05:00
Graham Neubig 6c88b10c59 Fix issue #6262: Add success/failure indicators for file read/edit operations (#6653)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-10 12:58:31 -05:00
Rohit Malhotra 8688634950 [Resolver]: Add target branch param (#6668) 2025-02-10 17:28:38 +00:00
dependabot[bot] 6e35ac49c1 chore(deps): bump the version-all group in /frontend with 4 updates (#6665)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
2025-02-10 16:52:20 +00:00
Rohit Malhotra 9bdc8dda6c [Enhancement]: Handle GH token refresh inside runtime (#6632) 2025-02-10 11:12:12 -05:00
Robert Brennan 75f3f282af Add comprehensive OpenHands glossary (#6310)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
2025-02-10 10:13:39 -05:00
Rohit Malhotra 4a5891cbea [Bug fix]: Standardize SecretStr use (#6660)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-10 08:03:56 -05:00
tofarr 707cb07f4f Removed in page callback (#6657) 2025-02-10 05:34:58 -07:00
dependabot[bot] 61c709b7c7 chore(deps): bump the version-all group across 1 directory with 3 updates (#6648)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
2025-02-10 09:02:02 +00:00
zchn 1c72676483 fix(6223): More properly add 'pyproject.toml' and 'poetry.lock' to the pip package (#6658) 2025-02-08 01:23:42 +01:00
Xingyao Wang 52ac2729f7 fix: set tool_choice to none for non-fncall models (#6652) 2025-02-07 12:49:08 -05:00
sp.wack 5fa2634d60 chore(frontend): Take into account other error message types (#6647) 2025-02-07 20:52:02 +04:00
Xingyao Wang 478b225d11 feat: Add LocalRuntime (#5284)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-07 16:35:14 +00:00
tofarr ce82545437 fix: handle SAAS mode properly in useSettings hook (#6646)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-07 09:24:15 -07:00
Graham Neubig 93d2e4a338 Optimize memory usage in FileEditObservation (#6622)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Xingyao Wang <xingyao6@illinois.edu>
2025-02-07 08:19:32 -05:00
mamoodi ff48f8beba Add o1 to verfied models (#6642) 2025-02-06 16:38:08 -05:00
Graham Neubig e930cd0aef Better error logging in posthog (#6346)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Ray Myers <ray.myers@gmail.com>
2025-02-06 20:16:37 +00:00
sp.wack 6655ec0731 chore(frontend): Migrate from NextUI to HeroUI via codemod (#6635) 2025-02-06 19:24:54 +04:00
mamoodi 669e284dc5 Only show start project button in conversations (#6626)
Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com>
2025-02-06 09:57:54 -05:00
dependabot[bot] 8140d2e05a chore(deps): bump the version-all group across 1 directory with 15 updates (#6617)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
2025-02-06 12:29:12 +00:00
Peter Dave Hello ed68034427 Update and Improve zh-TW Traditional Chinese locale (#6621) 2025-02-05 13:37:31 -05:00
Graham Neubig 2832dba27a Fix memory leak in JSON encoder (#6620)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Xingyao Wang <xingyao6@illinois.edu>
2025-02-05 17:39:04 +00:00
Graham Neubig 5491ad3318 Remove free disk space steps from workflows to test if they are necessary (#6618)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-05 12:28:57 -05:00
Calvin Smith e47aaba4ca Improve performance of LLM summarizing condenser (#6597)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-05 03:26:15 +00:00
OpenHands fe8b92743b Fix issue #6531: [Bug]: GITHUB_TOKEN would missing when the runtime resume (#6533) 2025-02-04 17:48:25 -05:00
Engel Nyst 0d312a645a Simplify fn calling usage (#6596) 2025-02-04 22:54:38 +01:00
mamoodi f564939780 Release 0.23.0 (#6598) 2025-02-04 15:54:09 -05:00
Akim Tsvigun be7007bcca Fix/llm prompt fn converter (#6610)
Co-authored-by: Akim Tsvigun <aktsvigun@nebius.com>
2025-02-04 20:24:31 +00:00
sp.wack 240d1c972c hotfix(frontend): Make conversation title clickable (#6609) 2025-02-04 19:49:35 +00:00
Rohit Malhotra a7239ce799 Move GH Token retrieval to GitHubService class (#6605)
Co-authored-by: tofarr <tofarr@gmail.com>
2025-02-04 18:39:42 +00:00
dependabot[bot] 7c16ca8f27 chore(deps): bump the version-all group with 4 updates (#6604)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-04 17:39:42 +00:00
Rohit Malhotra 7151f75340 Use user_id as token set indicator for settings (#6595)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-03 20:36:47 -05:00
tofarr f24fbec165 Fix: re-add github token middleware (#6594) 2025-02-03 19:55:09 +00:00
dependabot[bot] 4dbe831d42 chore(deps): bump the version-all group across 1 directory with 7 updates (#6591)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-03 19:15:49 +00:00
Xingyao Wang 90bbd4edbe fix: initialize default metadata with all required fields (#6583)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-04 02:52:11 +08:00
tofarr cc104b2e44 Fix for typo (#6592) 2025-02-03 18:37:09 +00:00
Rohit Malhotra 4adef574c0 Refactor: Github Service (#6580)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-02-03 17:21:36 +00:00
Rohit Malhotra 7d09a158c3 Fix Github service bugs (#6571)
Co-authored-by: tofarr <tofarr@gmail.com>
2025-02-03 16:44:32 +00:00
tofarr bbfdc62139 Fix for issue where retries continue on a closed runtime (#6564)
Co-authored-by: Xingyao Wang <xingyao6@illinois.edu>
2025-02-03 08:44:09 -07:00
Xingyao Wang 622fc5213d [feat] support o3-mini (#6570) 2025-02-03 23:26:35 +08:00
sp.wack 6d62be518b hotfix(frontend): Only show settings error toast when there is an error (#6587) 2025-02-03 18:29:55 +04:00
Boxuan Li e487008e74 Trajectory replay: Fix a few corner cases (#6380) 2025-02-02 00:27:22 -08:00
Boxuan Li 62402cd617 The-Agent-Company evaluation harness: Support splits (#6577) 2025-02-02 13:12:01 +08:00
Engel Nyst be522f1fb9 Upgrade litellm (with o3-mini) (#6581) 2025-02-02 13:06:08 +08:00
Rick van Hattem 4ef09ab897 Update llm.py (#6582) 2025-02-02 03:24:46 +00:00
Ryan Peach 32c5fde562 LLM_API_VERSION in openhands resolver (#6507) 2025-02-02 00:01:56 +01:00
Aditya Bharat Soni a593d9bc6d Visual browsing in CodeAct using set-of-marks annotated webpage screenshots (#6464) 2025-02-02 04:56:11 +08:00
Engel Nyst eb8d1600c3 Chore: clean up LLM (prompt caching, supports fn calling), leftover renames (#6095) 2025-02-01 18:14:08 +01:00
mamoodi 3b0bbce54a update custom sandbox instructions with docker method (#6566) 2025-02-01 11:06:43 -05:00
Rohit Malhotra 19e0c32eb7 Fix: RM debug print (#6569) 2025-01-31 20:57:43 +00:00
Rohit Malhotra 17a4100feb Refactor: Move Github endpoint logic to GithubService class (#6558)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-31 15:20:28 -05:00
mamoodi 47b84189a3 Update stale job workflow with operations per run (#6568) 2025-01-31 14:24:27 -05:00
Robert Brennan 7f4b5476dc Add VSCode Hello World extension (#6463)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-01-31 11:48:59 -05:00
Xingyao Wang 0c84fe58dd Update ACI to 0.2.0 to fix Memory Leak (#6559) 2025-01-31 16:09:38 +00:00
sp.wack 575f4fd347 chore(frontend): Better error toast handling mechanism (#6561) 2025-01-31 15:16:46 +00:00
sp.wack f7934bed80 chore(backend): GitHub token should be a SecretStr (#6494) 2025-01-31 19:15:19 +04:00
sp.wack e01fdf2a11 hotfix(frontend): Show error toast if settings errors (#6554) 2025-01-31 18:55:21 +04:00
Ray Myers fd73f4210e Show LLM retries and allow resume from rate-limit state (#6438)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-01-30 21:51:47 +00:00
Robert Brennan 1bccfb3492 fix gh middleware (#6556) 2025-01-30 16:17:49 -05:00
Robert Brennan 27fdae6ecc Refactor: move middleware definition (#6552) 2025-01-30 15:32:26 -05:00
mamoodi 5dd4810f58 Add note to Windows that docker command must be run in WSL terminal (#6553) 2025-01-30 20:15:32 +00:00
Ray Myers 83724100e5 fix: Don't close runtime on error (#6549) 2025-01-30 19:09:24 +00:00
sp.wack 6b243155f4 hotfix(frontend): Only open consent form if user truly did not make a choice (#6551) 2025-01-30 18:45:55 +00:00
tofarr 173f824704 Filtering lost+found directory from root of workspace (#6487) 2025-01-30 10:24:12 -07:00
dependabot[bot] 8f881c4df1 chore(deps): bump the version-all group across 1 directory with 5 updates (#6547)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-30 17:52:20 +01:00
Engel Nyst d0276d1925 Quick fix log leak (#6545) 2025-01-30 17:32:35 +01:00
mamoodi 6e90c30be4 Remove python unit tests on Mac (#6546) 2025-01-30 11:16:58 -05:00
Graham Neubig 8ff0e027a6 Fix share label (#6474) 2025-01-30 10:25:54 -05:00
sp.wack c54911d877 chore: Move user's analytics consent to the backend (#6505) 2025-01-30 18:28:29 +04:00
sp.wack 0afe889ccd chore(frontend): Handle test warnings (#6538) 2025-01-30 18:25:24 +04:00
Boxuan Li c9f16248d0 Add tests for trajectory replay (#6513) 2025-01-30 13:56:24 +00:00
Boxuan Li 99d2d01e1a Fix condensers registration (#6537) 2025-01-30 14:32:15 +01:00
Calvin Smith 36090ad8ff enh: Organizing condenser implementations (#6529)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
2025-01-29 18:21:04 -07:00
Xingyao Wang 1a9971b1bf misc: make RemoteRuntime API timeout configurable (#6518)
Co-authored-by: Robert Brennan <accounts@rbren.io>
2025-01-30 06:30:18 +08:00
Calvin Smith 473fcae57e fix: Recover from ContextWindowExceededError (#6519)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
2025-01-29 15:25:46 -07:00
Rohit Malhotra a6eed5b7e9 Remove unused event search route (#6510) 2025-01-29 16:45:24 -05:00
Robert Brennan b64d130a6e remove old manager (#6525) 2025-01-29 16:45:07 -05:00
mamoodi a253713ce2 Release 0.22.0 (#6522) 2025-01-29 14:50:22 -05:00
sp.wack 94d833cb5f fix: Update config.template.toml to have empty api keys (#6521) 2025-01-29 18:54:28 +00:00
dependabot[bot] 6909075be8 chore(deps): bump the version-all group in /frontend with 3 updates (#6515)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
2025-01-29 17:40:19 +00:00
sp.wack 28d7127257 hotfix(frontend): Return DEFAULT_SETTINGS if GET /settings is 404 (#6517) 2025-01-29 17:24:17 +00:00
dependabot[bot] 1509f4ce56 chore(deps): bump the version-all group with 6 updates (#6516)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-29 16:36:47 +01:00
sp.wack a7bb6720ba feat: Better error message handling (#6502) 2025-01-29 15:25:31 +00:00
sp.wack b987f33a67 chore: Remove settings local storage logic (#6504) 2025-01-29 15:42:20 +04:00
Rohit Malhotra eb760f32c7 Refactor: Don't serialize matching events when searching event stream (#6509) 2025-01-28 18:17:44 -05:00
sp.wack 35346068d1 chore: Remove root level package.json (#6498) 2025-01-29 00:31:48 +04:00
Chriest Yu 8ae5655157 fix(frontend): make chat message content wrappable (#6421) 2025-01-28 19:03:11 +00:00
dependabot[bot] de786f930d chore(deps): bump the version-all group across 1 directory with 21 updates (#6493)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
2025-01-28 18:10:09 +00:00
Xingyao Wang 7bf354be53 chore: typo fix for for add_openhands_repo_instruction.md (#6501) 2025-01-28 17:50:11 +00:00
Rohit Malhotra f18729f5f8 Remove unused refresh func (#6499) 2025-01-28 17:09:29 +00:00
Robert Brennan f3b8bad09f Fix file descriptor leak in S3FileStore (#6486)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-28 11:47:37 -05:00
Robert Brennan 41e5d12f63 update slack link (#6497) 2025-01-28 11:37:33 -05:00
dependabot[bot] fa009f0a57 chore(deps): bump the version-all group with 10 updates (#6496)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-28 16:11:50 +00:00
Xingyao Wang 391200510c fix: revert #5506 for SWE-Bench performance regression (#6491)
Co-authored-by: Robert Brennan <accounts@rbren.io>
2025-01-28 22:52:57 +08:00
sp.wack 36c2abadc2 chore: Move GitHub logic out of the frontend (#6307)
Co-authored-by: Robert Brennan <accounts@rbren.io>
2025-01-28 13:14:32 +00:00
dependabot[bot] d6655f3470 chore(deps): bump the version-all group in /docs with 3 updates (#6288)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-28 16:57:22 +04:00
Engel Nyst f2427d7ffa Add the resolver to the bug_template (#6490) 2025-01-28 02:45:24 +00:00
Rohit Malhotra 94a64a47f2 Feat: Filter matching events in reverse order (#6485) 2025-01-27 22:53:16 +00:00
Rohit Malhotra 0ba96ce69e Feat: Ability to filter events by multiple types (#6484) 2025-01-27 22:09:16 +00:00
Engel Nyst 89c7bf59a7 Fix first user message (#6471) 2025-01-27 22:09:03 +01:00
Rohit Malhotra 604534905f Refactor: Use type[Event] instead of str to filter events (#6480)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-27 13:58:09 -05:00
Xingyao Wang 4bde644fab Improve function call validation with better error handling (#6453)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-28 02:42:45 +08:00
tofarr ffdab28abc Fix Docker runtimes not stopping (#6470)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-27 11:09:09 -07:00
Calvin Smith 12dd23ba1c Enable memory condensation from the frontend (#6333)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
2025-01-27 11:02:35 -07:00
Robert Brennan 9611093458 allow http session reuse (#6478) 2025-01-27 12:29:49 -05:00
tofarr 8a65df6bce refactor: Update get_github_installation_ids to use httpx (#6451)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-27 09:59:50 -07:00
tofarr c997495200 Fix S3FileStore / GoogleCloudFileStore directory list & deletion (#6449)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-27 08:40:08 -07:00
Calvin Smith 23348af431 Add test for context window truncation in agent controller (#6477)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
2025-01-27 08:35:43 -07:00
dependabot[bot] 5b53dbd85c chore(deps-dev): bump llama-index from 0.12.13 to 0.12.14 in the llama group (#6476)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-27 15:30:53 +00:00
Ray Myers e619929909 Log restart reason if runtime reports it (#6455) 2025-01-25 07:20:18 +01:00
Ryan H. Tran 93753ac2e0 Upgrade openhands-aci to 0.1.9 (#6450) 2025-01-24 19:03:00 +00:00
Robert Brennan 38e19d214d Fix up conversation initialization (#6430)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-24 18:43:02 +00:00
dependabot[bot] 19a4f1c3ec chore(deps-dev): bump llama-index from 0.12.12 to 0.12.13 in the llama group (#6448)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-24 16:16:53 +00:00
Rohit Malhotra 45a048f9e3 NIT: Remove unused param (#6446) 2025-01-24 14:51:09 +00:00
sp.wack 358d9cb3f4 hotfix(frontend): Logout and clear token if retrieving user fails (#6436) 2025-01-24 09:49:50 -05:00
Xingyao Wang e6a2fd3fd4 feat: add prompt to prevent agent execute multiple bash command at the same time (#6428) 2025-01-24 22:43:34 +08:00
OpenHands c2f308f397 Fix issue #5620: [Bug]: Resolver fails when the existing requirements.txt does not end in a newline character (#6327) 2025-01-24 09:36:59 -05:00
Rohit Malhotra a1f1c802d9 [Fix]: Fix bugs for target_branch param on resolver (#5745)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-23 21:36:20 -05:00
Xiaohua Zhang ad2237d7dd feat: vscode support for modal runtime (#6442)
Co-authored-by: Xiaohua Zhang <xiaohua.dev@gmail.com>
2025-01-24 01:39:07 +00:00
Xiaohua Zhang aa0cd51967 fix(frontend): display confirmation buttons for explandable messages (#6426)
Co-authored-by: Xiaohua Zhang <xiaohua.dev@gmail.com>
2025-01-23 20:14:52 -05:00
Graham Neubig 081a1305f0 Fix resolver linting issues (#6401)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-23 18:21:11 -05:00
Xiaohua Zhang 9912e28576 chore: update config template to use docker runtime by default (#6435)
Co-authored-by: Xiaohua Zhang <xiaohua.dev@gmail.com>
2025-01-23 22:24:00 +00:00
tofarr b19a33ccad Fix: Filtering conversations with no created at (#6414) 2025-01-23 15:09:57 -07:00
tofarr 21e912d6fb Feat remove redis (#6278)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-23 14:33:16 -07:00
Robert Brennan 0dd9b95dbe change message to connecting (#6433) 2025-01-23 20:42:41 +00:00
Aditya Bharat Soni aebb583779 Support for VisualWebArena evaluation in OpenHands (#4773)
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Graham Neubig <neubig@gmail.com>
2025-01-23 20:18:30 +00:00
chuckbutkus 2ff9ba1229 AWS necessary changes only (#6375)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-01-23 13:10:11 -05:00
Michael Jewell a7e6068ba8 build: add required dependencies to package.json (#6423) 2025-01-23 10:07:12 -05:00
dependabot[bot] 24adcee9e3 chore(deps-dev): bump the llama group with 2 updates (#6411)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-23 14:54:27 +00:00
tofarr 21d4ba0bbd Feat: Stop runtimes rather than delete them (#6403)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-23 07:43:02 -07:00
tofarr 5ba9a6d321 Feat: Better mechanism for attaching middleware (#6365) 2025-01-23 07:31:43 -07:00
tofarr aa223734d4 One more SecretStr fix (#6419) 2025-01-22 18:21:14 -07:00
sp.wack 053723a4d4 fix(frontend): Refetch conversations when toggling the conversation panel (#6190) 2025-01-22 18:19:01 +00:00
mamoodi 5a6dbac5a3 Release 0.21.0 (#6392)
Co-authored-by: Calvin Smith <email@cjsmith.io>
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
2025-01-22 11:26:12 -05:00
Robert Brennan 93d74e9b41 make export button more stylistically consistent (#6412) 2025-01-22 11:18:43 -05:00
tofarr 1337d03816 Example usage of httpx (#6325) 2025-01-22 16:06:43 +00:00
Robert Brennan 04e36df4d7 remove dead code (#6386) 2025-01-22 10:26:59 -05:00
Boxuan Li f9ba16b648 Edit tool prompt tweaking: only plain-text format is supported (#6067)
Co-authored-by: Graham Neubig <neubig@gmail.com>
Co-authored-by: mamoodi <mamoodiha@gmail.com>
2025-01-21 18:22:01 -08:00
Engel Nyst f0dbb02ee1 Adjust prompt to use view command (#5506)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-21 23:50:39 +01:00
tofarr 318c811817 Added check to shutdown hook (#6402) 2025-01-21 22:32:46 +00:00
Xingyao Wang b468150f2a fix(codeact): make sure agent sees the prefix/suffix as part of observation (#6400) 2025-01-21 21:54:57 +00:00
Engel Nyst b9a3f1c753 Fix eval on remote runtime (#6398) 2025-01-21 20:49:30 +00:00
Graham Neubig 64ebef3646 Update .github/workflows/lint.yml 2025-01-21 14:52:56 -05:00
Graham Neubig 7a259915c1 Update .github/workflows/lint.yml 2025-01-21 14:47:51 -05:00
tofarr 09e8a1eeba Fix: Keeping runtimes alive again (For now) (#6395) 2025-01-21 19:20:35 +00:00
openhands 66bd8fdbcd Enable strict type checking with mypy
- Update mypy configuration with stricter type checking rules
- Add more type stubs to pre-commit configuration
- Run mypy both through pre-commit and directly in CI
- Install project in editable mode for better type checking
- Set correct PYTHONPATH in CI environment
2025-01-21 19:12:09 +00:00
Xingyao Wang ff3880c76d fix(remote_runtime): define runtime_id first to fix attrbute error (#6393) 2025-01-21 18:13:43 +00:00
Calvin Smith 8bd7613724 fix: Settings modal properly tracks if an API key is set (#6394)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
2025-01-21 11:04:30 -07:00
Engel Nyst 5b7fcfbe1a Disable prompt extensions in SWE-bench (#6391) 2025-01-21 17:18:30 +00:00
Robert Brennan 8ae36481df Fix API key again (#6390) 2025-01-21 17:00:59 +00:00
Robert Brennan 25fdb0c3bf fix api key value (#6388) 2025-01-21 16:15:28 +00:00
louria 7f57dbebda Update MiniWoB README (#6385) 2025-01-21 16:26:47 +01:00
dependabot[bot] 54589d7e83 chore(deps-dev): bump pre-commit from 4.0.1 to 4.1.0 in the pre-commit group (#6384)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-21 15:10:20 +00:00
Boxuan Li b7f34c3f8d (feat) Add button to export trajectory on chat panel (#6378) 2025-01-21 22:10:00 +08:00
dependabot[bot] 210eeee94a chore(deps-dev): bump the eslint group in /frontend with 2 updates (#6358)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-21 13:46:56 +04:00
Robert Brennan 509892cf0e Revert changes to config defaults (#6370) 2025-01-21 04:23:21 +01:00
Engel Nyst 89963e93d8 Re-add reasoning effort (#6371) 2025-01-21 04:22:48 +01:00
tofarr b6804f9e1e Fix: Static assets should not have the same rate limit (#6360)
Co-authored-by: Robert Brennan <accounts@rbren.io>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-01-20 21:55:49 +00:00
mamoodi d30211da18 Update running OpenHands guide with detailed prerequisites (#6366) 2025-01-20 13:53:14 -05:00
Boxuan Li 06121bf20f chore(deps): Revert vite upgrade (#6349) 2025-01-20 19:11:32 +01:00
tofarr 541a445dfc Fix: API meta for OpenHands (#6295) 2025-01-20 09:47:57 -07:00
dependabot[bot] 03e496fb60 chore(deps): bump the version-all group with 7 updates (#6359)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 17:04:22 +01:00
Xingyao Wang 1b6e444ecb feat(remote runtime): do not resume runtime if not keep_runtime_alive (#6355)
Co-authored-by: Robert Brennan <accounts@rbren.io>
2025-01-19 21:42:00 +00:00
Xingyao Wang 2b04ee2e62 feat(eval): reliability improvement for SWE-Bench eval_infer (#6347) 2025-01-18 14:02:59 -05:00
Boxuan Li 4383be1ab4 (feat) Add trajectory replay for headless mode (#6215) 2025-01-18 05:48:22 +00:00
tofarr b4d20e3e18 Feat: settings default (#6328)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-17 20:17:18 -07:00
mamoodi 532c7cdf02 Attempt to fix doc deploy (#6337) 2025-01-18 00:16:47 +00:00
mamoodi 987861b5e7 Remove broken browser counter logic (#6334)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-17 22:41:31 +00:00
Calvin Smith f07ec7a09c fix: Conversation creation accessing secret without unwrapping (#6335)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
2025-01-17 22:16:57 +00:00
Xingyao Wang b1fa6301f0 feat: add prompt for generating repo.md for an arbiratry repo (#6034)
Co-authored-by: Graham Neubig <neubig@gmail.com>
2025-01-17 21:47:27 +00:00
Graham Neubig 62fbe4c622 docs: improve custom sandbox guide with more configuration options (#5589)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-18 05:05:41 +08:00
dependabot[bot] a1a87af69d chore(deps): bump the version-all group across 1 directory with 18 updates (#6332)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
2025-01-17 23:46:57 +04:00
Calvin Smith a12087243a Pydantic-based configuration and setting objects (#6321)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
Co-authored-by: Graham Neubig <neubig@gmail.com>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-01-17 12:33:22 -07:00
Xingyao Wang 899c1f8360 fix(bash): also show timeout reminder when no_change_timeout is triggered (#6318)
Co-authored-by: Robert Brennan <accounts@rbren.io>
2025-01-18 03:31:23 +08:00
manna_and_poem c5d7caf01f remove useless axtree str (#6315) 2025-01-17 17:50:40 +00:00
Engel Nyst 85a760e561 Simplify draft llm (#6281)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-17 17:38:02 +00:00
dependabot[bot] 8e9c315729 chore(deps): bump the version-all group with 8 updates (#6331)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-17 15:19:45 +00:00
Rohit Malhotra 000055ba73 Add initial user msg to /new_conversation route (#6314) 2025-01-17 14:43:03 +00:00
Aleksandr Kadykov 2edb2337c2 Fix typo in Development.md (#6330) 2025-01-17 13:51:53 +00:00
Amaechi-Okorie Onyedikachi Hope 7c8a0162ae feat: add slack etiquettes (#6178) 2025-01-17 01:28:23 +00:00
Robert Brennan c10f18b3bd Better message when trying to reconnect (#6323) 2025-01-16 22:10:48 +00:00
tofarr 313c8eca20 Fix closing sessions (again) (#6322)
Co-authored-by: Robert Brennan <accounts@rbren.io>
2025-01-16 15:03:38 -07:00
tofarr eff9e07272 Fix for issue with user id (#6320) 2025-01-16 20:33:36 +00:00
Xingyao Wang f8a3aeccd6 fix: Restore missing translation keys (#6317)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-16 19:21:46 +00:00
Robert Brennan 9375e0d756 fix browser async lock (#6316) 2025-01-16 19:17:17 +00:00
Xingyao Wang 72af7bbba2 feat(eval): misc SWE-Bench improvement - use different resources for different instances (#6313)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-17 02:48:41 +08:00
OpenHands 0661c69bd3 Fix issue #6273: [Feature]: Disable LitLLM Print Message (#6274)
Co-authored-by: Xingyao Wang <xingyao6@illinois.edu>
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
2025-01-17 02:43:55 +08:00
Xingyao Wang 0c961bfd8b refactor(prompt): move runtime/repo info to user message and disable them in eval (#6291) 2025-01-16 17:53:10 +00:00
Xingyao Wang 0bed17758f fix: incorrect soft-timeout implementation & fix hard-timeout follow-up command (#6280) 2025-01-17 01:27:00 +08:00
Ryan H. Tran da1a6035ac Enable runtime build in openhands-resolver.yml (#6312) 2025-01-16 11:42:22 -05:00
Rohit Malhotra df050e4786 Separate data extraction and convo creation logic (#6298) 2025-01-16 11:40:03 -05:00
Xingyao Wang e211647eba fix: llm-proxy response_cost being 0 (#6293) 2025-01-16 15:33:22 +00:00
Alejandro Cuadron Lafuente 8579710c82 [Fix] Restored FC default for GPT-4o (#6311) 2025-01-16 15:27:57 +00:00
dependabot[bot] 8c35150c3e chore(deps-dev): bump llama-index from 0.12.10 to 0.12.11 in the llama group (#6308)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-16 16:18:37 +01:00
Alejandro Cuadron Lafuente 578291e961 Enabled native function calling for O1 + added support for reasoning_effort config in the config. (#6256)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-01-16 14:53:11 +00:00
Xingyao Wang efe04baf34 Revert "Fix closing sessions" (#6300) 2025-01-16 09:14:56 -05:00
dependabot[bot] 6e089619e0 chore(deps-dev): bump chromadb from 0.6.2 to 0.6.3 in the chromadb group (#6289)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-16 00:37:42 +01:00
Xingyao Wang 179a89a211 Fix microagent loading with trailing slashes and nested directories (#6239)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-15 17:07:40 +00:00
tofarr 8795ee6c6e Fix closing sessions (#6114) 2025-01-15 10:04:22 -07:00
Engel Nyst 97e938d545 Fix French doc (#6283) 2025-01-15 04:25:47 +00:00
Engel Nyst b9a70c8d5c Delegation fixes (#6165) 2025-01-15 03:24:39 +00:00
Ray Myers 082d0b25c5 Send status message on runtime restart (#6275) 2025-01-15 03:21:06 +01:00
Engel Nyst c5797d1d5a Fix llm_config fallback (#4415)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-15 01:17:37 +00:00
Xingyao Wang 7ce1fb85ff chore: remove repo info from initial query for #6057 (#6279) 2025-01-15 00:40:54 +00:00
Robert Brennan fa6792e5a6 Add GitHub repository information to system prompt (#6057)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-15 08:02:07 +08:00
dependabot[bot] 3d9b4c4af6 chore(deps): bump the version-all group with 4 updates (#6267)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-14 21:30:56 +01:00
tofarr e21cbf67ee Feat: User id should be a str (Because it will probably be a UUID) (#6251) 2025-01-14 12:39:51 -07:00
Xingyao Wang 6b2e3f938f fix: prevent runtime size deselection (#6119)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: mamoodi <mamoodiha@gmail.com>
2025-01-14 17:53:51 +00:00
Rohit Malhotra 580d7b938c Fix: Don't refresh github token on local (#5880) 2025-01-14 17:48:33 +00:00
mamoodi 28178a2940 Remove extra optional for github token (#6270) 2025-01-14 17:44:28 +00:00
sp.wack 04382b2b19 hotfix(backend): Remove GH header token middleware (#6269) 2025-01-14 12:07:13 -05:00
Robert Brennan 4da812c781 Better handling of stack traces and exc_info (#6253) 2025-01-14 10:22:39 -05:00
mamoodi 37b7173481 Update landing page examples (#6254) 2025-01-14 15:09:30 +00:00
Graham Neubig f0ebf3eba8 Improve i18n support and add missing translations (#6070)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-01-14 13:46:22 +00:00
Boxuan Li 92b8d55c2d Rename trajectories_path config to save_trajectory_path (#6216)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-01-14 04:32:45 +00:00
dependabot[bot] a125b6cd43 chore(deps): bump the version-all group across 1 directory with 6 updates (#6248)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 23:33:09 +01:00
tofarr 01ac207b92 Fix remove dead code (#6249) 2025-01-13 14:15:13 -07:00
Ray Myers 6d015a5dca Don't start conversation runtime without valid API key (#6181) 2025-01-13 22:03:37 +01:00
dependabot[bot] 275512305d chore(deps): bump docker/setup-qemu-action from 3.2.0 to 3.3.0 (#6229)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 21:31:01 +01:00
mamoodi 3a4bc10b29 Release 0.20.0 (#6234)
Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com>
2025-01-13 14:58:20 -05:00
sp.wack bbd31b32f3 chore: Move GH requests to the server (#6217) 2025-01-13 23:12:50 +04:00
Joseph O'Connor 295c6fd629 fix(issue_definitions, issue-success-check.jinja): pass git-patch to issue-success-check (#6243)
Co-authored-by: Graham Neubig <neubig@gmail.com>
2025-01-13 18:40:15 +00:00
tofarr 5a809c9b53 Feature: User id propagation (#6233) 2025-01-13 18:10:45 +00:00
sp.wack 0b74fd71d9 fix(frontend): Prevent from send a SET API key (#6235) 2025-01-13 17:50:37 +00:00
tofarr 4fa5c329d6 Fix : minor updates to log messages (#6232) 2025-01-13 17:19:51 +00:00
tofarr 5b1dcf83a6 Fix for issue where S3FileStore does not delete directory objects (#6231) 2025-01-13 16:50:58 +00:00
tofarr b9884f7609 Fixes for minor cases where FDs were not closed (#6228) 2025-01-13 09:15:23 -07:00
dependabot[bot] 99eda0e571 chore(deps-dev): bump the eslint group in /frontend with 2 updates (#6227)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 19:44:10 +04:00
Ryan H. Tran 5832463088 Revert openhands-resolver.yml change in #5972 (#6222) 2025-01-13 15:39:54 +00:00
tofarr 045ec2b95d Fix: Timezone should be UTC (#6225) 2025-01-13 08:24:26 -07:00
tofarr 23473070b9 Revert "Config objects as Pydantic BaseModels (#6176)" (#6214) 2025-01-13 07:36:25 -07:00
mamoodi 63133c0ba9 Document changes for Micro-Agents and some formatting changes (#6155)
Co-authored-by: Robert Brennan <accounts@rbren.io>
2025-01-13 09:24:10 -05:00
dependabot[bot] 2023fb767f chore(deps): bump the version-all group in /frontend with 2 updates (#6192)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com>
2025-01-13 11:09:11 +00:00
Ryan H. Tran 23f40a1c01 Enable runtime image build for resolver's experimental feature (#5972) 2025-01-12 17:21:34 -05:00
Calvin Smith 873dddb4e8 Config objects as Pydantic BaseModels (#6176)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
Co-authored-by: Graham Neubig <neubig@gmail.com>
2025-01-12 15:09:45 -05:00
906 changed files with 83804 additions and 26676 deletions
+1
View File
@@ -30,6 +30,7 @@ body:
description: How are you running OpenHands?
options:
- Docker command in README
- GitHub resolver
- Development workflow
- app.all-hands.dev
- Other
-6
View File
@@ -10,12 +10,6 @@ updates:
pre-commit:
patterns:
- "pre-commit"
llama:
patterns:
- "llama*"
chromadb:
patterns:
- "chromadb"
browsergym:
patterns:
- "browsergym*"
+8 -7
View File
@@ -1,11 +1,12 @@
**End-user friendly description of the problem this fixes or functionality that this introduces**
- [ ] Include this change in the Release Notes. If checked, you must provide an **end-user friendly** description for your change below
---
**Give a summary of what the PR does, explaining any non-trivial design decisions**
- [ ] This change is worth documenting at https://docs.all-hands.dev/
- [ ] Include this change in the Release Notes. If checked, you **must** provide an **end-user friendly** description for your change below
**End-user friendly description of the problem this fixes or functionality that this introduces.**
---
**Link of any specific issues this addresses**
**Give a summary of what the PR does, explaining any non-trivial design decisions.**
---
**Link of any specific issues this addresses.**
+1 -1
View File
@@ -46,7 +46,7 @@ on:
jobs:
del_runs:
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
permissions:
actions: write
contents: read
+4 -6
View File
@@ -24,22 +24,20 @@ jobs:
build:
if: github.repository == 'All-Hands-AI/OpenHands'
name: Build Docusaurus
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
- uses: useblacksmith/setup-node@v5
with:
node-version: 18
cache: npm
cache-dependency-path: docs/package-lock.json
- name: Set up Python
uses: actions/setup-python@v5
uses: useblacksmith/setup-python@v6
with:
python-version: '3.12'
- name: Generate Python Docs
run: rm -rf docs/modules/python && pip install pydoc-markdown && pydoc-markdown
- name: Install dependencies
run: cd docs && npm ci
- name: Build website
@@ -54,7 +52,7 @@ jobs:
deploy:
if: github.ref == 'refs/heads/main' && github.repository == 'All-Hands-AI/OpenHands'
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
# This job only runs on "main" so only run one of these jobs at a time
# otherwise it will fail if one is already running
concurrency:
+7 -17
View File
@@ -16,37 +16,27 @@ concurrency:
jobs:
test:
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Install tmux
run: sudo apt-get update && sudo apt-get install -y tmux
- name: Setup Node.js
uses: useblacksmith/setup-node@v5
with:
node-version: '22.x'
- name: Install poetry via pipx
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
uses: useblacksmith/setup-python@v6
with:
python-version: '3.12'
cache: 'poetry'
- name: Install Python dependencies using Poetry
run: poetry install --without evaluation,llama-index
run: poetry install --without evaluation
- name: Build Environment
run: make build
- name: Run tests
-139
View File
@@ -1,139 +0,0 @@
name: Run SWE-Bench Evaluation
on:
pull_request:
types: [labeled]
workflow_dispatch:
inputs:
reason:
description: "Reason for manual trigger"
required: true
default: ""
env:
N_PROCESSES: 32 # Global configuration for number of parallel processes for evaluation
jobs:
run-evaluation:
if: github.event.label.name == 'eval-this' || github.event_name != 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
pull-requests: "write"
issues: "write"
strategy:
matrix:
python-version: ["3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install tmux
run: sudo apt-get update && sudo apt-get install -y tmux
- name: Install poetry via pipx
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Comment on PR if 'eval-this' label is present
if: github.event_name == 'pull_request' && github.event.label.name == 'eval-this'
uses: KeisukeYamashita/create-comment@v1
with:
unique: false
comment: |
Hi! I started running the evaluation on your PR. You will receive a comment with the results shortly.
- name: Install Python dependencies using Poetry
run: poetry install
- name: Configure config.toml for evaluation
env:
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_LLM_API_KEY }}
run: |
echo "[llm.eval]" > config.toml
echo "model = \"deepseek/deepseek-chat\"" >> config.toml
echo "api_key = \"$DEEPSEEK_API_KEY\"" >> config.toml
echo "temperature = 0.0" >> config.toml
- name: Run SWE-Bench evaluation
env:
ALLHANDS_API_KEY: ${{ secrets.ALLHANDS_EVAL_RUNTIME_API_KEY }}
RUNTIME: remote
SANDBOX_REMOTE_RUNTIME_API_URL: https://runtime.eval.all-hands.dev
EVAL_DOCKER_IMAGE_PREFIX: us-central1-docker.pkg.dev/evaluation-092424/swe-bench-images
run: |
poetry run ./evaluation/benchmarks/swe_bench/scripts/run_infer.sh llm.eval HEAD CodeActAgent 300 30 $N_PROCESSES "princeton-nlp/SWE-bench_Lite" test
OUTPUT_FOLDER=$(find evaluation/evaluation_outputs/outputs/princeton-nlp__SWE-bench_Lite-test/CodeActAgent -name "deepseek-chat_maxiter_50_N_*-no-hint-run_1" -type d | head -n 1)
echo "OUTPUT_FOLDER for SWE-bench evaluation: $OUTPUT_FOLDER"
poetry run ./evaluation/benchmarks/swe_bench/scripts/eval_infer_remote.sh $OUTPUT_FOLDER/output.jsonl $N_PROCESSES "princeton-nlp/SWE-bench_Lite" test
poetry run ./evaluation/benchmarks/swe_bench/scripts/eval/summarize_outputs.py $OUTPUT_FOLDER/output.jsonl > summarize_outputs.log 2>&1
echo "SWEBENCH_REPORT<<EOF" >> $GITHUB_ENV
cat summarize_outputs.log >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create tar.gz of evaluation outputs
run: |
TIMESTAMP=$(date +'%y-%m-%d-%H-%M')
tar -czvf evaluation_outputs_${TIMESTAMP}.tar.gz evaluation/evaluation_outputs/outputs
- name: Upload evaluation results as artifact
uses: actions/upload-artifact@v4
id: upload_results_artifact
with:
name: evaluation-outputs
path: evaluation_outputs_*.tar.gz
- name: Get artifact URL
run: echo "ARTIFACT_URL=${{ steps.upload_results_artifact.outputs.artifact-url }}" >> $GITHUB_ENV
- name: Authenticate to Google Cloud
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.GCP_RESEARCH_OBJECT_CREATOR_SA_KEY }}
- name: Set timestamp and trigger reason
run: |
echo "TIMESTAMP=$(date +'%Y-%m-%d-%H-%M')" >> $GITHUB_ENV
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "TRIGGER_REASON=pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
echo "TRIGGER_REASON=schedule" >> $GITHUB_ENV
else
echo "TRIGGER_REASON=manual-${{ github.event.inputs.reason }}" >> $GITHUB_ENV
fi
- name: Upload evaluation results to Google Cloud Storage
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: 'evaluation/evaluation_outputs/outputs'
destination: 'openhands-oss-eval-results/${{ env.TIMESTAMP }}-${{ env.TRIGGER_REASON }}'
- name: Comment with evaluation results and artifact link
id: create_comment
uses: KeisukeYamashita/create-comment@v1
with:
number: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || 4504 }}
unique: false
comment: |
Trigger by: ${{ github.event_name == 'pull_request' && format('Pull Request (eval-this label on PR #{0})', github.event.pull_request.number) || github.event_name == 'schedule' && 'Daily Schedule' || format('Manual Trigger: {0}', github.event.inputs.reason) }}
Commit: ${{ github.sha }}
**SWE-Bench Evaluation Report**
${{ env.SWEBENCH_REPORT }}
---
You can download the full evaluation outputs [here](${{ env.ARTIFACT_URL }}).
- name: Post to a Slack channel
id: slack
uses: slackapi/slack-github-action@v2.0.0
with:
channel-id: 'C07SVQSCR6F'
slack-message: "*Evaluation Trigger:* ${{ github.event_name == 'pull_request' && format('Pull Request (eval-this label on PR #{0})', github.event.pull_request.number) || github.event_name == 'schedule' && 'Daily Schedule' || format('Manual Trigger: {0}', github.event.inputs.reason) }}\n\nLink to summary: [here](https://github.com/${{ github.repository }}/issues/${{ github.event_name == 'pull_request' && github.event.pull_request.number || 4504 }}#issuecomment-${{ steps.create_comment.outputs.comment-id }})"
env:
SLACK_BOT_TOKEN: ${{ secrets.EVAL_NOTIF_SLACK_BOT_TOKEN }}
+2 -2
View File
@@ -21,7 +21,7 @@ jobs:
# Run frontend unit tests
fe-test:
name: FE Unit Tests
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
strategy:
matrix:
node-version: [20, 22]
@@ -30,7 +30,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
uses: useblacksmith/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
+46 -89
View File
@@ -32,7 +32,7 @@ jobs:
# Builds the OpenHands Docker images
ghcr_build_app:
name: Build App Image
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
permissions:
contents: read
packages: write
@@ -41,22 +41,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.2.0
uses: docker/setup-qemu-action@v3.6.0
with:
image: tonistiigi/binfmt:latest
- name: Login to GHCR
@@ -68,22 +56,22 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Lowercase Repository Owner
run: |
echo REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and push app image
if: "!github.event.pull_request.head.repo.fork"
run: |
./containers/build.sh -i openhands -o ${{ github.repository_owner }} --push
./containers/build.sh -i openhands -o ${{ env.REPO_OWNER }} --push
- name: Build app image
if: "github.event.pull_request.head.repo.fork"
run: |
./containers/build.sh -i openhands -o ${{ github.repository_owner }} --load
./containers/build.sh -i openhands -o ${{ env.REPO_OWNER }} --load
- name: Get hash in App Image
id: get_hash_in_app_image
run: |
# Lowercase the repository owner
export REPO_OWNER=${{ github.repository_owner }}
REPO_OWNER=$(echo $REPO_OWNER | tr '[:upper:]' '[:lower:]')
# Run the build script in the app image
docker run -e SANDBOX_USER_ID=0 -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/${REPO_OWNER}/openhands:${{ env.RELEVANT_SHA }} /bin/bash -c "mkdir -p containers/runtime; python3 openhands/runtime/utils/runtime_build.py --base_image ${{ env.BASE_IMAGE_FOR_HASH_EQUIVALENCE_TEST }} --build_folder containers/runtime --force_rebuild" 2>&1 | tee docker-outputs.txt
docker run -e SANDBOX_USER_ID=0 -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/${{ env.REPO_OWNER }}/openhands:${{ env.RELEVANT_SHA }} /bin/bash -c "mkdir -p containers/runtime; python3 openhands/runtime/utils/runtime_build.py --base_image ${{ env.BASE_IMAGE_FOR_HASH_EQUIVALENCE_TEST }} --build_folder containers/runtime --force_rebuild" 2>&1 | tee docker-outputs.txt
# Get the hash from the build script
hash_from_app_image=$(cat docker-outputs.txt | grep "Hash for docker build directory" | awk -F "): " '{print $2}' | uniq | head -n1)
echo "hash_from_app_image=$hash_from_app_image" >> $GITHUB_OUTPUT
@@ -92,7 +80,7 @@ jobs:
# Builds the runtime Docker images
ghcr_build_runtime:
name: Build Image
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
permissions:
contents: read
packages: write
@@ -104,22 +92,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.2.0
uses: docker/setup-qemu-action@v3.6.0
with:
image: tonistiigi/binfmt:latest
- name: Login to GHCR
@@ -132,11 +108,11 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v3
- name: Set up Python
uses: actions/setup-python@v5
uses: useblacksmith/setup-python@v6
with:
python-version: '3.12'
- name: Cache Poetry dependencies
uses: actions/cache@v4
uses: useblacksmith/cache@v5
with:
path: |
~/.cache/pypoetry
@@ -150,16 +126,19 @@ jobs:
run: make install-python-dependencies
- name: Create source distribution and Dockerfile
run: poetry run python3 openhands/runtime/utils/runtime_build.py --base_image ${{ matrix.base_image.image }} --build_folder containers/runtime --force_rebuild
- name: Lowercase Repository Owner
run: |
echo REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and push runtime image ${{ matrix.base_image.image }}
if: github.event.pull_request.head.repo.fork != true
run: |
./containers/build.sh -i runtime -o ${{ github.repository_owner }} --push -t ${{ matrix.base_image.tag }}
./containers/build.sh -i runtime -o ${{ env.REPO_OWNER }} --push -t ${{ matrix.base_image.tag }}
# Forked repos can't push to GHCR, so we need to upload the image as an artifact
- name: Build runtime image ${{ matrix.base_image.image }} for fork
if: github.event.pull_request.head.repo.fork
uses: docker/build-push-action@v6
with:
tags: ghcr.io/all-hands-ai/runtime:${{ env.RELEVANT_SHA }}-${{ matrix.base_image.tag }}
tags: ghcr.io/${{ env.REPO_OWNER }}/runtime:${{ env.RELEVANT_SHA }}-${{ matrix.base_image.tag }}
outputs: type=docker,dest=/tmp/runtime-${{ matrix.base_image.tag }}.tar
context: containers/runtime
- name: Upload runtime image for fork
@@ -171,7 +150,7 @@ jobs:
verify_hash_equivalence_in_runtime_and_app:
name: Verify Hash Equivalence in Runtime and Docker images
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
needs: [ghcr_build_runtime, ghcr_build_app]
strategy:
fail-fast: false
@@ -179,8 +158,10 @@ jobs:
base_image: ['nikolaik']
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Cache Poetry dependencies
uses: actions/cache@v4
uses: useblacksmith/cache@v5
with:
path: |
~/.cache/pypoetry
@@ -189,7 +170,7 @@ jobs:
restore-keys: |
${{ runner.os }}-poetry-
- name: Set up Python
uses: actions/setup-python@v5
uses: useblacksmith/setup-python@v6
with:
python-version: '3.12'
- name: Install poetry via pipx
@@ -219,31 +200,17 @@ jobs:
exit 1
fi
# Run unit tests with the EventStream runtime Docker images as root
# Run unit tests with the Docker runtime Docker images as root
test_runtime_root:
name: RT Unit Tests (Root)
needs: [ghcr_build_runtime]
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
strategy:
fail-fast: false
matrix:
base_image: ['nikolaik']
steps:
- uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
@@ -259,7 +226,7 @@ jobs:
run: |
docker load --input /tmp/runtime-${{ matrix.base_image }}.tar
- name: Cache Poetry dependencies
uses: actions/cache@v4
uses: useblacksmith/cache@v5
with:
path: |
~/.cache/pypoetry
@@ -268,14 +235,17 @@ jobs:
restore-keys: |
${{ runner.os }}-poetry-
- name: Set up Python
uses: actions/setup-python@v5
uses: useblacksmith/setup-python@v6
with:
python-version: '3.12'
- name: Install poetry via pipx
run: pipx install poetry
- name: Install Python dependencies using Poetry
run: make install-python-dependencies
- name: Run runtime tests
- name: Lowercase Repository Owner
run: |
echo REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Run docker runtime tests
run: |
# We install pytest-xdist in order to run tests across CPUs
poetry run pip install pytest-xdist
@@ -283,10 +253,9 @@ jobs:
# Install to be able to retry on failures for flaky tests
poetry run pip install pytest-rerunfailures
image_name=ghcr.io/${{ github.repository_owner }}/runtime:${{ env.RELEVANT_SHA }}-${{ matrix.base_image }}
image_name=$(echo $image_name | tr '[:upper:]' '[:lower:]')
image_name=ghcr.io/${{ env.REPO_OWNER }}/runtime:${{ env.RELEVANT_SHA }}-${{ matrix.base_image }}
TEST_RUNTIME=eventstream \
TEST_RUNTIME=docker \
SANDBOX_USER_ID=$(id -u) \
SANDBOX_RUNTIME_CONTAINER_IMAGE=$image_name \
TEST_IN_CI=true \
@@ -297,30 +266,16 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# Run unit tests with the EventStream runtime Docker images as openhands user
# Run unit tests with the Docker runtime Docker images as openhands user
test_runtime_oh:
name: RT Unit Tests (openhands)
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
needs: [ghcr_build_runtime]
strategy:
matrix:
base_image: ['nikolaik']
steps:
- uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
@@ -336,7 +291,7 @@ jobs:
run: |
docker load --input /tmp/runtime-${{ matrix.base_image }}.tar
- name: Cache Poetry dependencies
uses: actions/cache@v4
uses: useblacksmith/cache@v5
with:
path: |
~/.cache/pypoetry
@@ -345,13 +300,16 @@ jobs:
restore-keys: |
${{ runner.os }}-poetry-
- name: Set up Python
uses: actions/setup-python@v5
uses: useblacksmith/setup-python@v6
with:
python-version: '3.12'
- name: Install poetry via pipx
run: pipx install poetry
- name: Install Python dependencies using Poetry
run: make install-python-dependencies
- name: Lowercase Repository Owner
run: |
echo REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Run runtime tests
run: |
# We install pytest-xdist in order to run tests across CPUs
@@ -360,10 +318,9 @@ jobs:
# Install to be able to retry on failures for flaky tests
poetry run pip install pytest-rerunfailures
image_name=ghcr.io/${{ github.repository_owner }}/runtime:${{ env.RELEVANT_SHA }}-${{ matrix.base_image }}
image_name=$(echo $image_name | tr '[:upper:]' '[:lower:]')
image_name=ghcr.io/${{ env.REPO_OWNER }}/runtime:${{ env.RELEVANT_SHA }}-${{ matrix.base_image }}
TEST_RUNTIME=eventstream \
TEST_RUNTIME=docker \
SANDBOX_USER_ID=$(id -u) \
SANDBOX_RUNTIME_CONTAINER_IMAGE=$image_name \
TEST_IN_CI=true \
@@ -381,7 +338,7 @@ jobs:
runtime_tests_check_success:
name: All Runtime Tests Passed
if: ${{ !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
needs: [test_runtime_root, test_runtime_oh, verify_hash_equivalence_in_runtime_and_app]
steps:
- name: All tests passed
@@ -390,7 +347,7 @@ jobs:
runtime_tests_check_fail:
name: All Runtime Tests Passed
if: ${{ cancelled() || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
needs: [test_runtime_root, test_runtime_oh, verify_hash_equivalence_in_runtime_and_app]
steps:
- name: Some tests failed
@@ -401,7 +358,7 @@ jobs:
name: Update PR Description
if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]'
needs: [ghcr_build_runtime]
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- name: Checkout
uses: actions/checkout@v4
+47 -6
View File
@@ -18,7 +18,7 @@ env:
jobs:
run-integration-tests:
if: github.event.label.name == 'integration-test' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
permissions:
contents: "read"
id-token: "write"
@@ -35,11 +35,16 @@ jobs:
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
uses: useblacksmith/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Setup Node.js
uses: useblacksmith/setup-node@v5
with:
node-version: '22.x'
- name: Comment on PR if 'integration-test' label is present
if: github.event_name == 'pull_request' && github.event.label.name == 'integration-test'
uses: KeisukeYamashita/create-comment@v1
@@ -49,13 +54,14 @@ jobs:
Hi! I started running the integration tests on your PR. You will receive a comment with the results shortly.
- name: Install Python dependencies using Poetry
run: poetry install --without evaluation,llama-index
run: poetry install --without evaluation
- name: Configure config.toml for testing with Haiku
env:
LLM_MODEL: "litellm_proxy/claude-3-5-haiku-20241022"
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
MAX_ITERATIONS: 10
run: |
echo "[llm.eval]" > config.toml
echo "model = \"$LLM_MODEL\"" >> config.toml
@@ -70,7 +76,7 @@ jobs:
env:
SANDBOX_FORCE_REBUILD_RUNTIME: True
run: |
poetry run ./evaluation/integration_tests/scripts/run_infer.sh llm.eval HEAD CodeActAgent '' $N_PROCESSES '' 'haiku_run'
poetry run ./evaluation/integration_tests/scripts/run_infer.sh llm.eval HEAD CodeActAgent '' 10 $N_PROCESSES '' 'haiku_run'
# get integration tests report
REPORT_FILE_HAIKU=$(find evaluation/evaluation_outputs/outputs/integration_tests/CodeActAgent/*haiku*_maxiter_10_N* -name "report.md" -type f | head -n 1)
@@ -88,6 +94,7 @@ jobs:
LLM_MODEL: "litellm_proxy/deepseek-chat"
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
MAX_ITERATIONS: 10
run: |
echo "[llm.eval]" > config.toml
echo "model = \"$LLM_MODEL\"" >> config.toml
@@ -99,7 +106,7 @@ jobs:
env:
SANDBOX_FORCE_REBUILD_RUNTIME: True
run: |
poetry run ./evaluation/integration_tests/scripts/run_infer.sh llm.eval HEAD CodeActAgent '' $N_PROCESSES '' 'deepseek_run'
poetry run ./evaluation/integration_tests/scripts/run_infer.sh llm.eval HEAD CodeActAgent '' 10 $N_PROCESSES '' 'deepseek_run'
# get integration tests report
REPORT_FILE_DEEPSEEK=$(find evaluation/evaluation_outputs/outputs/integration_tests/CodeActAgent/deepseek*_maxiter_10_N* -name "report.md" -type f | head -n 1)
@@ -109,11 +116,42 @@ jobs:
echo >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
# -------------------------------------------------------------
# Run VisualBrowsingAgent tests for DeepSeek, limited to t05 and t06
- name: Wait a little bit (again)
run: sleep 5
- name: Configure config.toml for testing VisualBrowsingAgent (DeepSeek)
env:
LLM_MODEL: "litellm_proxy/deepseek-chat"
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
MAX_ITERATIONS: 15
run: |
echo "[llm.eval]" > config.toml
echo "model = \"$LLM_MODEL\"" >> config.toml
echo "api_key = \"$LLM_API_KEY\"" >> config.toml
echo "base_url = \"$LLM_BASE_URL\"" >> config.toml
echo "temperature = 0.0" >> config.toml
- name: Run integration test evaluation for VisualBrowsingAgent (DeepSeek)
env:
SANDBOX_FORCE_REBUILD_RUNTIME: True
run: |
poetry run ./evaluation/integration_tests/scripts/run_infer.sh llm.eval HEAD VisualBrowsingAgent '' 15 $N_PROCESSES "t05_simple_browsing,t06_github_pr_browsing.py" 'visualbrowsing_deepseek_run'
# Find and export the visual browsing agent test results
REPORT_FILE_VISUALBROWSING_DEEPSEEK=$(find evaluation/evaluation_outputs/outputs/integration_tests/VisualBrowsingAgent/deepseek*_maxiter_15_N* -name "report.md" -type f | head -n 1)
echo "REPORT_FILE_VISUALBROWSING_DEEPSEEK: $REPORT_FILE_VISUALBROWSING_DEEPSEEK"
echo "INTEGRATION_TEST_REPORT_VISUALBROWSING_DEEPSEEK<<EOF" >> $GITHUB_ENV
cat $REPORT_FILE_VISUALBROWSING_DEEPSEEK >> $GITHUB_ENV
echo >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create archive of evaluation outputs
run: |
TIMESTAMP=$(date +'%y-%m-%d-%H-%M')
cd evaluation/evaluation_outputs/outputs # Change to the outputs directory
tar -czvf ../../../integration_tests_${TIMESTAMP}.tar.gz integration_tests/CodeActAgent/* # Only include the actual result directories
tar -czvf ../../../integration_tests_${TIMESTAMP}.tar.gz integration_tests/CodeActAgent/* integration_tests/VisualBrowsingAgent/* # Only include the actual result directories
- name: Upload evaluation results as artifact
uses: actions/upload-artifact@v4
@@ -155,4 +193,7 @@ jobs:
DeepSeek LLM Test Results:
${{ env.INTEGRATION_TEST_REPORT_DEEPSEEK }}
---
**Integration Tests Report VisualBrowsing (DeepSeek)**
${{ env.INTEGRATION_TEST_REPORT_VISUALBROWSING_DEEPSEEK }}
---
Download testing outputs (includes both Haiku and DeepSeek results): [Download](${{ steps.upload_results_artifact.outputs.artifact-url }})
+4 -4
View File
@@ -9,7 +9,7 @@ jobs:
lint-fix-frontend:
if: github.event.label.name == 'lint-fix'
name: Fix frontend linting issues
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
permissions:
contents: write
pull-requests: write
@@ -22,7 +22,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Node.js 20
uses: actions/setup-node@v4
uses: useblacksmith/setup-node@v5
with:
node-version: 20
- name: Install frontend dependencies
@@ -52,7 +52,7 @@ jobs:
lint-fix-python:
if: github.event.label.name == 'lint-fix'
name: Fix Python linting issues
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
permissions:
contents: write
pull-requests: write
@@ -65,7 +65,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up python
uses: actions/setup-python@v5
uses: useblacksmith/setup-python@v6
with:
python-version: 3.12
cache: 'pip'
+6 -6
View File
@@ -19,11 +19,11 @@ jobs:
# Run lint on the frontend code
lint-frontend:
name: Lint frontend
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
- name: Install Node.js 20
uses: actions/setup-node@v4
uses: useblacksmith/setup-node@v5
with:
node-version: 20
- name: Install dependencies
@@ -39,13 +39,13 @@ jobs:
# Run lint on the python code
lint-python:
name: Lint python
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up python
uses: actions/setup-python@v5
uses: useblacksmith/setup-python@v6
with:
python-version: 3.12
cache: 'pip'
@@ -57,11 +57,11 @@ jobs:
# Check version consistency across documentation
check-version-consistency:
name: Check version consistency
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v5
uses: useblacksmith/setup-python@v6
with:
python-version: 3.12
- name: Run version consistency check
+33 -12
View File
@@ -20,6 +20,10 @@ on:
required: false
type: string
default: "anthropic/claude-3-5-sonnet-20241022"
LLM_API_VERSION:
required: false
type: string
default: ""
base_container_image:
required: false
type: string
@@ -84,8 +88,10 @@ jobs:
run: |
python -m pip index versions openhands-ai > openhands_versions.txt
OPENHANDS_VERSION=$(head -n 1 openhands_versions.txt | awk '{print $2}' | tr -d '()')
echo "openhands-ai==${OPENHANDS_VERSION}" >> requirements.txt
cat requirements.txt
# Create a new requirements.txt locally within the workflow, ensuring no reference to the repo's file
echo "openhands-ai==${OPENHANDS_VERSION}" > /tmp/requirements.txt
cat /tmp/requirements.txt
- name: Cache pip dependencies
if: |
@@ -103,15 +109,16 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}/lib/python3.12/site-packages/*
key: ${{ runner.os }}-pip-openhands-resolver-${{ hashFiles('requirements.txt') }}
key: ${{ runner.os }}-pip-openhands-resolver-${{ hashFiles('/tmp/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-openhands-resolver-${{ hashFiles('requirements.txt') }}
${{ runner.os }}-pip-openhands-resolver-${{ hashFiles('/tmp/requirements.txt') }}
- name: Check required environment variables
env:
LLM_MODEL: ${{ secrets.LLM_MODEL || inputs.LLM_MODEL }}
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
LLM_API_VERSION: ${{ inputs.LLM_API_VERSION }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
PAT_USERNAME: ${{ secrets.PAT_USERNAME }}
GITHUB_TOKEN: ${{ github.token }}
@@ -168,7 +175,7 @@ jobs:
echo "SANDBOX_ENV_BASE_CONTAINER_IMAGE=${{ inputs.base_container_image }}" >> $GITHUB_ENV
# Set branch variables
echo "TARGET_BRANCH=${{ inputs.target_branch }}" >> $GITHUB_ENV
echo "TARGET_BRANCH=${{ inputs.target_branch || 'main' }}" >> $GITHUB_ENV
- name: Comment on issue with start message
uses: actions/github-script@v7
@@ -184,6 +191,7 @@ jobs:
});
- name: Install OpenHands
id: install_openhands
uses: actions/github-script@v7
env:
COMMENT_BODY: ${{ github.event.comment.body || '' }}
@@ -196,7 +204,6 @@ jobs:
const reviewBody = process.env.REVIEW_BODY.trim();
const labelName = process.env.LABEL_NAME.trim();
const eventName = process.env.EVENT_NAME.trim();
// Check conditions
const isExperimentalLabel = labelName === "fix-me-experimental";
const isIssueCommentExperimental =
@@ -205,6 +212,9 @@ jobs:
const isReviewCommentExperimental =
eventName === "pull_request_review" && reviewBody.includes("@openhands-agent-exp");
// Set output variable
core.setOutput('isExperimental', isExperimentalLabel || isIssueCommentExperimental || isReviewCommentExperimental);
// Perform package installation
if (isExperimentalLabel || isIssueCommentExperimental || isReviewCommentExperimental) {
console.log("Installing experimental OpenHands...");
@@ -213,16 +223,18 @@ jobs:
} else {
console.log("Installing from requirements.txt...");
await exec.exec("python -m pip install --upgrade pip");
await exec.exec("pip install -r requirements.txt");
await exec.exec("pip install -r /tmp/requirements.txt");
}
- name: Attempt to resolve issue
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN || github.token }}
GITHUB_USERNAME: ${{ secrets.PAT_USERNAME || 'openhands-agent' }}
GIT_USERNAME: ${{ secrets.PAT_USERNAME || 'openhands-agent' }}
LLM_MODEL: ${{ secrets.LLM_MODEL || inputs.LLM_MODEL }}
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
LLM_API_VERSION: ${{ inputs.LLM_API_VERSION }}
PYTHONPATH: ""
run: |
cd /tmp && python -m openhands.resolver.resolve_issue \
@@ -230,7 +242,8 @@ jobs:
--issue-number ${{ env.ISSUE_NUMBER }} \
--issue-type ${{ env.ISSUE_TYPE }} \
--max-iterations ${{ env.MAX_ITERATIONS }} \
--comment-id ${{ env.COMMENT_ID }}
--comment-id ${{ env.COMMENT_ID }} \
--is-experimental ${{ steps.install_openhands.outputs.isExperimental }}
- name: Check resolution result
id: check_result
@@ -254,14 +267,17 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN || github.token }}
GITHUB_USERNAME: ${{ secrets.PAT_USERNAME || 'openhands-agent' }}
GIT_USERNAME: ${{ secrets.PAT_USERNAME || 'openhands-agent' }}
LLM_MODEL: ${{ secrets.LLM_MODEL || inputs.LLM_MODEL }}
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
LLM_API_VERSION: ${{ inputs.LLM_API_VERSION }}
PYTHONPATH: ""
run: |
if [ "${{ steps.check_result.outputs.RESOLUTION_SUCCESS }}" == "true" ]; then
cd /tmp && python -m openhands.resolver.send_pull_request \
--issue-number ${{ env.ISSUE_NUMBER }} \
--target-branch ${{ env.TARGET_BRANCH }} \
--pr-type draft \
--reviewer ${{ github.actor }} | tee pr_result.txt && \
grep "draft created" pr_result.txt | sed 's/.*\///g' > pr_number.txt
@@ -279,11 +295,12 @@ jobs:
if: always()
env:
AGENT_RESPONDED: ${{ env.AGENT_RESPONDED || 'false' }}
ISSUE_NUMBER: ${{ env.ISSUE_NUMBER }}
with:
github-token: ${{ secrets.PAT_TOKEN || github.token }}
script: |
const fs = require('fs');
const issueNumber = ${{ env.ISSUE_NUMBER }};
const issueNumber = process.env.ISSUE_NUMBER;
let logContent = '';
try {
@@ -314,13 +331,15 @@ jobs:
if: always() # Comment on issue even if the previous steps fail
env:
AGENT_RESPONDED: ${{ env.AGENT_RESPONDED || 'false' }}
ISSUE_NUMBER: ${{ env.ISSUE_NUMBER }}
RESOLUTION_SUCCESS: ${{ steps.check_result.outputs.RESOLUTION_SUCCESS }}
with:
github-token: ${{ secrets.PAT_TOKEN || github.token }}
script: |
const fs = require('fs');
const path = require('path');
const issueNumber = ${{ env.ISSUE_NUMBER }};
const success = ${{ steps.check_result.outputs.RESOLUTION_SUCCESS }};
const issueNumber = process.env.ISSUE_NUMBER;
const success = process.env.RESOLUTION_SUCCESS === 'true';
let prNumber = '';
let branchName = '';
@@ -385,10 +404,12 @@ jobs:
- name: Fallback Error Comment
uses: actions/github-script@v7
if: ${{ env.AGENT_RESPONDED == 'false' }} # Only run if no conditions were met in previous steps
env:
ISSUE_NUMBER: ${{ env.ISSUE_NUMBER }}
with:
github-token: ${{ secrets.PAT_TOKEN || github.token }}
script: |
const issueNumber = ${{ env.ISSUE_NUMBER }};
const issueNumber = process.env.ISSUE_NUMBER;
github.rest.issues.createComment({
issue_number: issueNumber,
-98
View File
@@ -1,98 +0,0 @@
# Workflow that runs python unit tests on mac
name: Run Python Unit Tests Mac
# This job is flaky so only run it nightly
on:
schedule:
- cron: '0 0 * * *'
jobs:
# Run python unit tests on macOS
test-on-macos:
name: Python Unit Tests on macOS
runs-on: macos-14
env:
INSTALL_DOCKER: '1' # Set to '0' to skip Docker installation
strategy:
matrix:
python-version: ['3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
~/.virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install tmux
run: brew install tmux
- name: Install poetry via pipx
run: pipx install poetry
- name: Install Python dependencies using Poetry
run: poetry install --without evaluation,llama-index
- name: Install & Start Docker
if: env.INSTALL_DOCKER == '1'
run: |
INSTANCE_NAME="colima-${GITHUB_RUN_ID}"
# Uninstall colima to upgrade to the latest version
if brew list colima &>/dev/null; then
brew uninstall colima
# unlinking colima dependency: go
brew uninstall go@1.21
fi
rm -rf ~/.colima ~/.lima
brew install --HEAD colima
brew install docker
start_colima() {
# Find a free port in the range 10000-20000
RANDOM_PORT=$((RANDOM % 10001 + 10000))
# Original line:
if ! colima start --network-address --arch x86_64 --cpu=1 --memory=1 --verbose --ssh-port $RANDOM_PORT; then
echo "Failed to start Colima."
return 1
fi
return 0
}
# Attempt to start Colima for 5 total attempts:
ATTEMPT_LIMIT=5
for ((i=1; i<=ATTEMPT_LIMIT; i++)); do
if start_colima; then
echo "Colima started successfully."
break
else
colima stop -f
sleep 10
colima delete -f
if [ $i -eq $ATTEMPT_LIMIT ]; then
exit 1
fi
sleep 10
fi
done
# For testcontainers to find the Colima socket
# https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- name: Build Environment
run: make build
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Run Tests
run: poetry run pytest --forked --cov=openhands --cov-report=xml ./tests/unit --ignore=tests/unit/test_memory.py
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
+8 -4
View File
@@ -19,7 +19,7 @@ jobs:
# Run python unit tests on Linux
test-on-linux:
name: Python Unit Tests on Linux
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
env:
INSTALL_DOCKER: '0' # Set to '0' to skip Docker installation
strategy:
@@ -32,19 +32,23 @@ jobs:
uses: docker/setup-buildx-action@v3
- name: Install tmux
run: sudo apt-get update && sudo apt-get install -y tmux
- name: Setup Node.js
uses: useblacksmith/setup-node@v5
with:
node-version: '22.x'
- name: Install poetry via pipx
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
uses: useblacksmith/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install Python dependencies using Poetry
run: poetry install --without evaluation,llama-index
run: poetry install --without evaluation
- name: Build Environment
run: make build
- name: Run Tests
run: poetry run pytest --forked -n auto --cov=openhands --cov-report=xml -svv ./tests/unit --ignore=tests/unit/test_memory.py
run: poetry run pytest --forked -n auto --cov=openhands --cov-report=xml -svv ./tests/unit
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
env:
+2 -2
View File
@@ -12,10 +12,10 @@ on:
jobs:
release:
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: useblacksmith/setup-python@v6
with:
python-version: 3.12
- name: Install Poetry
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
trigger-job:
name: Trigger remote eval job
if: ${{ github.event.label.name == 'run-eval-xs' || github.event.label.name == 'run-eval-s' || github.event.label.name == 'run-eval-m' }}
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- name: Checkout PR branch
+2 -1
View File
@@ -8,7 +8,7 @@ on:
jobs:
stale:
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- uses: actions/stale@v9
with:
@@ -19,3 +19,4 @@ jobs:
close-issue-message: 'This issue was closed because it has been stalled for over 30 days with no activity.'
close-pr-message: 'This PR was closed because it has been stalled for over 30 days with no activity.'
days-before-close: 7
operations-per-run: 150
+172
View File
@@ -0,0 +1,172 @@
# OpenHands Glossary
### Agent
The core AI entity in OpenHands that can perform software development tasks by interacting with tools, browsing the web, and modifying code.
#### Agent Controller
A component that manages the agent's lifecycle, handles its state, and coordinates interactions between the agent and various tools.
#### Agent Delegation
The ability of an agent to hand off specific tasks to other specialized agents for better task completion.
#### Agent Hub
A central registry of different agent types and their capabilities, allowing for easy agent selection and instantiation.
#### Agent Skill
A specific capability or function that an agent can perform, such as file manipulation, web browsing, or code editing.
#### Agent State
The current context and status of an agent, including its memory, active tools, and ongoing tasks.
#### CodeAct Agent
[A generalist agent in OpenHands](https://arxiv.org/abs/2407.16741) designed to perform tasks by editing and executing code.
### Browser
A system for web-based interactions and tasks.
#### Browser Gym
A testing and evaluation environment for browser-based agent interactions and tasks.
#### Web Browser Tool
A tool that enables agents to interact with web pages and perform web-based tasks.
### Commands
Terminal and execution related functionality.
#### Bash Session
A persistent terminal session that maintains state and history for bash command execution.
This uses tmux under the hood.
### Configuration
System-wide settings and options.
#### Agent Configuration
Settings that define an agent's behavior, capabilities, and limitations, including available tools and runtime settings.
#### Configuration Options
Settings that control various aspects of OpenHands behavior, including runtime, security, and agent settings.
#### LLM Config
Configuration settings for language models used by agents, including model selection and parameters.
#### LLM Draft Config
Settings for draft mode operations with language models, typically used for faster, lower-quality responses.
#### Runtime Configuration
Settings that define how the runtime environment should be set up and operated.
#### Security Options
Configuration settings that control security features and restrictions.
### Conversation
A sequence of interactions between a user and an agent, including messages, actions, and their results.
#### Conversation Info
Metadata about a conversation, including its status, participants, and timeline.
#### Conversation Manager
A component that handles the creation, storage, and retrieval of conversations.
#### Conversation Metadata
Additional information about conversations, such as tags, timestamps, and related resources.
#### Conversation Status
The current state of a conversation, including whether it's active, completed, or failed.
#### Conversation Store
A storage system for maintaining conversation history and related data.
### Events
#### Event
Every Conversation comprises a series of Events. Each Event is either an Action or an Observation.
#### Event Stream
A continuous flow of events that represents the ongoing activities and interactions in the system.
#### Action
A specific operation or command that an agent executes through available tools, such as running a command or editing a file.
#### Observation
The response or result returned by a tool after an agent's action, providing feedback about the action's outcome.
### Interface
Different ways to interact with OpenHands.
#### CLI Mode
A command-line interface mode for interacting with OpenHands agents without a graphical interface.
#### GUI Mode
A graphical user interface mode for interacting with OpenHands agents through a web interface.
#### Headless Mode
A mode of operation where OpenHands runs without a user interface, suitable for automation and scripting.
### Agent Memory
The system that decides which parts of the Event Stream (i.e. the conversation history) should be passed into each LLM prompt.
#### Memory Store
A storage system for maintaining agent memory and context across sessions.
#### Condenser
A component that processes and summarizes conversation history to maintain context while staying within token limits.
#### Truncation
A very simple Condenser strategy. Reduces conversation history or content to stay within token limits.
### Microagent
A specialized prompt that enhances OpenHands with domain-specific knowledge, repository-specific context, and task-specific workflows.
#### Microagent Registry
A central repository of available microagents and their configurations.
#### Public Microagent
A general-purpose microagent available to all OpenHands users, triggered by specific keywords.
#### Repository Microagent
A type of microagent that provides repository-specific context and guidelines, stored in the `.openhands/microagents/` directory.
### Prompt
Components for managing and processing prompts.
#### Prompt Caching
A system for caching and reusing common prompts to improve performance.
#### Prompt Manager
A component that handles the loading, processing, and management of prompts used by agents, including microagents.
#### Response Parsing
The process of interpreting and structuring responses from language models and tools.
### Runtime
The execution environment where agents perform their tasks, which can be local, remote, or containerized.
#### Action Execution Server
A REST API that receives agent actions (e.g. bash commands, python code, browsing actions), executes them in the runtime environment, and returns the results.
#### Action Execution Client
A component that handles the execution of actions in the runtime environment, managing the communication between the agent and the runtime.
#### Docker Runtime
A containerized runtime environment that provides isolation and reproducibility for agent operations.
#### E2B Runtime
A specialized runtime environment built on E2B for secure and isolated code execution.
#### Local Runtime
A runtime environment that executes on the local machine, suitable for development and testing.
#### Modal Runtime
A runtime environment built on Modal for scalable and distributed agent operations.
#### Remote Runtime
A sandboxed environment that executes code and commands remotely, providing isolation and security for agent operations.
#### Runtime Builder
A component that builds a Docker image for the Action Execution Server based on a user-specified base image.
### Security
Security-related components and features.
#### Security Analyzer
A component that checks agent actions for potential security risks.
+6
View File
@@ -33,6 +33,7 @@ Frontend:
- Testing:
- Run tests: `npm run test`
- To run specific tests: `npm run test -- -t "TestName"`
- Our test framework is vitest
- Building:
- Build for production: `npm run build`
- Environment Variables:
@@ -40,3 +41,8 @@ Frontend:
- Available variables: VITE_BACKEND_HOST, VITE_USE_TLS, VITE_INSECURE_SKIP_VERIFY, VITE_FRONTEND_PORT
- Internationalization:
- Generate i18n declaration file: `npm run make-i18n`
## Template for Github Pull Request
If you are starting a pull request (PR), please follow the template in `.github/pull_request_template.md`.
+5
View File
@@ -0,0 +1,5 @@
#! /bin/bash
echo "Setting up the environment..."
python -m pip install pre-commit
+55
View File
@@ -0,0 +1,55 @@
cff-version: 1.2.0
message: "If you use this software, please cite it using the following metadata."
title: "OpenHands: An Open Platform for AI Software Developers as Generalist Agents"
authors:
- family-names: Wang
given-names: Xingyao
- family-names: Li
given-names: Boxuan
- family-names: Song
given-names: Yufan
- family-names: Xu
given-names: Frank F.
- family-names: Tang
given-names: Xiangru
- family-names: Zhuge
given-names: Mingchen
- family-names: Pan
given-names: Jiayi
- family-names: Song
given-names: Yueqi
- family-names: Li
given-names: Bowen
- family-names: Singh
given-names: Jaskirat
- family-names: Tran
given-names: Hoang H.
- family-names: Li
given-names: Fuqiang
- family-names: Ma
given-names: Ren
- family-names: Zheng
given-names: Mingzhang
- family-names: Qian
given-names: Bill
- family-names: Shao
given-names: Yanjun
- family-names: Muennighoff
given-names: Niklas
- family-names: Zhang
given-names: Yizhe
- family-names: Hui
given-names: Binyuan
- family-names: Lin
given-names: Junyang
- family-names: Brennan
given-names: Robert
- family-names: Peng
given-names: Hao
- family-names: Ji
given-names: Heng
- family-names: Neubig
given-names: Graham
year: 2024
doi: "10.48550/arXiv.2407.16741"
url: "https://arxiv.org/abs/2407.16741"
+14
View File
@@ -113,6 +113,20 @@ individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
### Slack and Discord Etiquettes
These Slack and Discord etiquette guidelines are designed to foster an inclusive, respectful, and productive environment for all community members. By following these best practices, we ensure effective communication and collaboration while minimizing disruptions. Lets work together to build a supportive and welcoming community!
- Communicate respectfully and professionally, avoiding sarcasm or harsh language, and remember that tone can be difficult to interpret in text.
- Use threads for specific discussions to keep channels organized and easier to follow.
- Tag others only when their input is critical or urgent, and use @here, @channel or @everyone sparingly to minimize disruptions.
- Be patient, as open-source contributors and maintainers often have other commitments and may need time to respond.
- Post questions or discussions in the most relevant channel (e.g., for [slack - #general](https://app.slack.com/client/T06P212QSEA/C06P5NCGSFP) for general topics, [slack - #questions](https://openhands-ai.slack.com/archives/C06U8UTKSAD) for queries/questions, [discord - #general](https://discord.com/channels/1222935860639563850/1222935861386018885)).
- When asking for help or raising issues, include necessary details like links, screenshots, or clear explanations to provide context.
- Keep discussions in public channels whenever possible to allow others to benefit from the conversation, unless the matter is sensitive or private.
- Always adhere to [our standards](https://github.com/All-Hands-AI/OpenHands/blob/main/CODE_OF_CONDUCT.md#our-standards) to ensure a welcoming and collaborative environment.
- If you choose to mute a channel, consider setting up alerts for topics that still interest you to stay engaged. For Slack, Go to Settings → Notifications → My Keywords to add specific keywords that will notify you when mentioned. For example, if you're here for discussions about LLMs, mute the channel if its too busy, but set notifications to alert you only when “LLMs” appears in messages. Also for Discord, go to the channel notifications and choose the option that best describes your need.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+55 -20
View File
@@ -1,22 +1,26 @@
# Development Guide
This guide is for people working on OpenHands and editing the source code.
If you wish to contribute your changes, check out the [CONTRIBUTING.md](https://github.com/All-Hands-AI/OpenHands/blob/main/CONTRIBUTING.md) on how to clone and setup the project initially before moving on.
Otherwise, you can clone the OpenHands project directly.
## Start the Server for Development
### 1. Requirements
* Linux, Mac OS, or [WSL on Windows](https://learn.microsoft.com/en-us/windows/wsl/install) [Ubuntu <= 22.04]
* [Docker](https://docs.docker.com/engine/install/) (For those on MacOS, make sure to allow the default Docker socket to be used from advanced settings!)
* [Python](https://www.python.org/downloads/) = 3.12
* [NodeJS](https://nodejs.org/en/download/package-manager) >= 20.x
* [Poetry](https://python-poetry.org/docs/#installing-with-the-official-installer) >= 1.8
* OS-specific dependencies:
- Linux, Mac OS, or [WSL on Windows](https://learn.microsoft.com/en-us/windows/wsl/install) [Ubuntu >= 22.04]
- [Docker](https://docs.docker.com/engine/install/) (For those on MacOS, make sure to allow the default Docker socket to be used from advanced settings!)
- [Python](https://www.python.org/downloads/) = 3.12
- [NodeJS](https://nodejs.org/en/download/package-manager) >= 20.x
- [Poetry](https://python-poetry.org/docs/#installing-with-the-official-installer) >= 1.8
- OS-specific dependencies:
- Ubuntu: build-essential => `sudo apt-get install build-essential`
- WSL: netcat => `sudo apt-get install netcat`
Make sure you have all these dependencies installed before moving on to `make build`.
#### Develop without sudo access
If you want to develop without system admin/sudo access to upgrade/install `Python` and/or `NodeJs`, you can use `conda` or `mamba` to manage the packages for you:
```bash
@@ -31,6 +35,7 @@ mamba install conda-forge::poetry
```
### 2. Build and Setup The Environment
Begin by building the project which includes setting up the environment and installing dependencies. This step ensures that OpenHands is ready to run on your system:
```bash
@@ -38,54 +43,65 @@ make build
```
### 3. Configuring the Language Model
OpenHands supports a diverse array of Language Models (LMs) through the powerful [litellm](https://docs.litellm.ai) library.
By default, we've chosen Claude Sonnet 3.5 as our go-to model, but the world is your oyster! You can unleash the
potential of any other LM that piques your interest.
To configure the LM of your choice, run:
```bash
make setup-config
```
```bash
make setup-config
```
This command will prompt you to enter the LLM API key, model name, and other variables ensuring that OpenHands is tailored to your specific needs. Note that the model name will apply only when you run headless. If you use the UI, please set the model in the UI.
This command will prompt you to enter the LLM API key, model name, and other variables ensuring that OpenHands is tailored to your specific needs. Note that the model name will apply only when you run headless. If you use the UI, please set the model in the UI.
Note: If you have previously run OpenHands using the docker command, you may have already set some environmental variables in your terminal. The final configurations are set from highest to lowest priority:
Environment variables > config.toml variables > default variables
Note: If you have previously run OpenHands using the docker command, you may have already set some environmental variables in your terminal. The final configurations are set from highest to lowest priority:
Environment variables > config.toml variables > default variables
**Note on Alternative Models:**
See [our documentation](https://docs.all-hands.dev/modules/usage/llms) for recommended models.
### 4. Running the application
#### Option A: Run the Full Application
Once the setup is complete, this command starts both the backend and frontend servers, allowing you to interact with OpenHands:
```bash
make run
```
#### Option B: Individual Server Startup
- **Start the Backend Server:** If you prefer, you can start the backend server independently to focus on backend-related tasks or configurations.
```bash
make start-backend
```
```bash
make start-backend
```
- **Start the Frontend Server:** Similarly, you can start the frontend server on its own to work on frontend-related components or interface enhancements.
```bash
make start-frontend
```
```bash
make start-frontend
```
### 6. LLM Debugging
If you encounter any issues with the Language Model (LM) or you're simply curious, export DEBUG=1 in the environment and restart the backend.
OpenHands will log the prompts and responses in the logs/llm/CURRENT_DATE directory, allowing you to identify the causes.
### 7. Help
Need help or info on available targets and commands? Use the help command for all the guidance you need with OpenHands.
```bash
make help
```
```
### 8. Testing
To run tests, refer to the following:
#### Unit tests
```bash
@@ -93,14 +109,16 @@ poetry run pytest ./tests/unit/test_*.py
```
### 9. Add or update dependency
1. Add your dependency in `pyproject.toml` or use `poetry add xxx`.
2. Update the poetry.lock file via `poetry lock --no-update`.
### 9. Use existing Docker image
To reduce build time (e.g., if no changes were made to the client-runtime component), you can use an existing Docker container image by
setting the SANDBOX_RUNTIME_CONTAINER_IMAGE environment variable to the desired Docker image.
Example: `export SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.19-nikolaik`
Example: `export SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.29-nikolaik`
## Develop inside Docker container
@@ -126,3 +144,20 @@ cd ./containers/dev
```
You do need [Docker](https://docs.docker.com/engine/install/) installed on your host though.
## Key Documentation Resources
Here's a guide to the important documentation files in the repository:
- [/README.md](./README.md): Main project overview, features, and basic setup instructions
- [/Development.md](./Development.md) (this file): Comprehensive guide for developers working on OpenHands
- [/CONTRIBUTING.md](./CONTRIBUTING.md): Guidelines for contributing to the project, including code style and PR process
- [/docs/DOC_STYLE_GUIDE.md](./docs/DOC_STYLE_GUIDE.md): Standards for writing and maintaining project documentation
- [/openhands/README.md](./openhands/README.md): Details about the backend Python implementation
- [/frontend/README.md](./frontend/README.md): Frontend React application setup and development guide
- [/containers/README.md](./containers/README.md): Information about Docker containers and deployment
- [/tests/unit/README.md](./tests/unit/README.md): Guide to writing and running unit tests
- [/evaluation/README.md](./evaluation/README.md): Documentation for the evaluation framework and benchmarks
- [/microagents/README.md](./microagents/README.md): Information about the microagents architecture and implementation
- [/openhands/server/README.md](./openhands/server/README.md): Server implementation details and API documentation
- [/openhands/runtime/README.md](./openhands/runtime/README.md): Documentation for the runtime environment and execution model
+10 -3
View File
@@ -2,12 +2,13 @@
These are the procedures and guidelines on how issues are triaged in this repo by the maintainers.
## General
* Most issues must be tagged with **enhancement** or **bug**.
* Issues may be tagged with what it relates to (**backend**, **frontend**, **agent quality**, etc.).
* All issues must be tagged with **enhancement**, **bug** or **troubleshooting/help**.
* Issues may be tagged with what it relates to (**agent quality**, **frontend**, **resolver**, etc.).
## Severity
* **Low**: Minor issues or affecting single user.
* **Medium**: Affecting multiple users.
* **High**: High visibility issues or affecting many users.
* **Critical**: Affecting all users or potential security issues.
## Effort
@@ -18,8 +19,14 @@ These are the procedures and guidelines on how issues are triaged in this repo b
## Not Enough Information
* User is asked to provide more information (logs, how to reproduce, etc.) when the issue is not clear.
* If an issue is unclear and the author does not provide more information or respond to a request, the issue may be closed as **not planned** (Usually after a week).
* If an issue is unclear and the author does not provide more information or respond to a request,
the issue may be closed as **not planned** (Usually after a week).
## Multiple Requests/Fixes in One Issue
* These issues will be narrowed down to one request/fix so the issue is more easily tracked and fixed.
* Issues may be broken down into multiple issues if required.
## Stale and Auto Closures
* In order to keep a maintainable backlog, issues that have no activity within 30 days are automatically marked as **Stale**.
* If issues marked as **Stale** continue to have no activity for 7 more days, they will automatically be closed as not planned.
* Issues may be reopened by maintainers if deemed important.
+4 -33
View File
@@ -1,4 +1,4 @@
SHELL=/bin/bash
SHELL=/usr/bin/env bash
# Makefile for OpenHands project
# Variables
@@ -81,10 +81,10 @@ check-nodejs:
@if command -v node > /dev/null; then \
NODE_VERSION=$(shell node --version | sed -E 's/v//g'); \
IFS='.' read -r -a NODE_VERSION_ARRAY <<< "$$NODE_VERSION"; \
if [ "$${NODE_VERSION_ARRAY[0]}" -ge 20 ]; then \
if [ "$${NODE_VERSION_ARRAY[0]}" -ge 22 ]; then \
echo "$(BLUE)Node.js $$NODE_VERSION is already installed.$(RESET)"; \
else \
echo "$(RED)Node.js 20.x or later is required. Please install Node.js 20.x or later to continue.$(RESET)"; \
echo "$(RED)Node.js 22.x or later is required. Please install Node.js 22.x or later to continue.$(RESET)"; \
exit 1; \
fi; \
else \
@@ -133,7 +133,7 @@ install-python-dependencies:
export HNSWLIB_NO_NATIVE=1; \
poetry run pip install chroma-hnswlib; \
fi
@poetry install --without llama-index
@poetry install
@if [ -f "/etc/manjaro-release" ]; then \
echo "$(BLUE)Detected Manjaro Linux. Installing Playwright dependencies...$(RESET)"; \
poetry run pip install playwright; \
@@ -265,35 +265,6 @@ setup-config-prompts:
@read -p "Enter your LLM base URL [mostly used for local LLMs, leave blank if not needed - example: http://localhost:5001/v1/]: " llm_base_url; \
if [[ ! -z "$$llm_base_url" ]]; then echo "base_url=\"$$llm_base_url\"" >> $(CONFIG_FILE).tmp; fi
@echo "Enter your LLM Embedding Model"; \
echo "Choices are:"; \
echo " - openai"; \
echo " - azureopenai"; \
echo " - Embeddings available only with OllamaEmbedding:"; \
echo " - llama2"; \
echo " - mxbai-embed-large"; \
echo " - nomic-embed-text"; \
echo " - all-minilm"; \
echo " - stable-code"; \
echo " - bge-m3"; \
echo " - bge-large"; \
echo " - paraphrase-multilingual"; \
echo " - snowflake-arctic-embed"; \
echo " - Leave blank to default to 'BAAI/bge-small-en-v1.5' via huggingface"; \
read -p "> " llm_embedding_model; \
echo "embedding_model=\"$$llm_embedding_model\"" >> $(CONFIG_FILE).tmp; \
if [ "$$llm_embedding_model" = "llama2" ] || [ "$$llm_embedding_model" = "mxbai-embed-large" ] || [ "$$llm_embedding_model" = "nomic-embed-text" ] || [ "$$llm_embedding_model" = "all-minilm" ] || [ "$$llm_embedding_model" = "stable-code" ]; then \
read -p "Enter the local model URL for the embedding model (will set llm.embedding_base_url): " llm_embedding_base_url; \
echo "embedding_base_url=\"$$llm_embedding_base_url\"" >> $(CONFIG_FILE).tmp; \
elif [ "$$llm_embedding_model" = "azureopenai" ]; then \
read -p "Enter the Azure endpoint URL (will overwrite llm.base_url): " llm_base_url; \
echo "base_url=\"$$llm_base_url\"" >> $(CONFIG_FILE).tmp; \
read -p "Enter the Azure LLM Embedding Deployment Name: " llm_embedding_deployment_name; \
echo "embedding_deployment_name=\"$$llm_embedding_deployment_name\"" >> $(CONFIG_FILE).tmp; \
read -p "Enter the Azure API Version: " llm_api_version; \
echo "api_version=\"$$llm_api_version\"" >> $(CONFIG_FILE).tmp; \
fi
# Develop in container
docker-dev:
+11 -7
View File
@@ -12,7 +12,7 @@
<a href="https://codecov.io/github/All-Hands-AI/OpenHands?branch=main"><img alt="CodeCov" src="https://img.shields.io/codecov/c/github/All-Hands-AI/OpenHands?style=for-the-badge&color=blue"></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-2wkh4pklz-w~h_DVDtEe9H5kyQlcNxVw"><img src="https://img.shields.io/badge/Slack-Join%20Us-red?logo=slack&logoColor=white&style=for-the-badge" alt="Join our Slack community"></a>
<a href="https://join.slack.com/t/openhands-ai/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw"><img src="https://img.shields.io/badge/Slack-Join%20Us-red?logo=slack&logoColor=white&style=for-the-badge" alt="Join our Slack community"></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="Join our Discord community"></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="Credits"></a>
<br/>
@@ -39,23 +39,27 @@ Learn more at [docs.all-hands.dev](https://docs.all-hands.dev), or jump to the [
## ⚡ Quick Start
The easiest way to run OpenHands is in Docker.
See the [Installation](https://docs.all-hands.dev/modules/usage/installation) guide for
See the [Running OpenHands](https://docs.all-hands.dev/modules/usage/installation) guide for
system requirements and more information.
```bash
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.19-nikolaik
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik
docker run -it --rm --pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.19-nikolaik \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.29-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.19
docker.all-hands.dev/all-hands-ai/openhands:0.29
```
> [!WARNING]
> On a public network? See our [Hardened Docker Installation](https://docs.all-hands.dev/modules/usage/runtimes/docker#hardened-docker-installation) guide
> to secure your deployment by restricting network binding and implementing additional security measures.
You'll find OpenHands running at [http://localhost:3000](http://localhost:3000)!
Finally, you'll need a model provider and API key.
@@ -69,7 +73,7 @@ run OpenHands in a scriptable [headless mode](https://docs.all-hands.dev/modules
interact with it via a [friendly CLI](https://docs.all-hands.dev/modules/usage/how-to/cli-mode),
or run it on tagged issues with [a github action](https://docs.all-hands.dev/modules/usage/how-to/github-action).
Visit [Installation](https://docs.all-hands.dev/modules/usage/installation) for more information and setup instructions.
Visit [Running OpenHands](https://docs.all-hands.dev/modules/usage/installation) for more information and setup instructions.
> [!CAUTION]
> OpenHands is meant to be run by a single user on their local workstation.
@@ -96,7 +100,7 @@ troubleshooting resources, and advanced configuration options.
OpenHands is a community-driven project, and we welcome contributions from everyone. We do most of our communication
through Slack, so this is the best place to start, but we also are happy to have you contact us on Discord or Github:
- [Join our Slack workspace](https://join.slack.com/t/openhands-ai/shared_invite/zt-2wkh4pklz-w~h_DVDtEe9H5kyQlcNxVw) - Here we talk about research, architecture, and future development.
- [Join our Slack workspace](https://join.slack.com/t/openhands-ai/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw) - Here we talk about research, architecture, and future development.
- [Join our Discord server](https://discord.gg/ESHStjSjD4) - This is a community-run server for general discussion, questions, and feedback.
- [Read or post Github Issues](https://github.com/All-Hands-AI/OpenHands/issues) - Check out the issues we're working on, or add your own ideas.
+1 -2
View File
@@ -1,5 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
cp pyproject.toml poetry.lock openhands
poetry build -v
+138 -34
View File
@@ -17,24 +17,39 @@
#modal_api_token_id = ""
#modal_api_token_secret = ""
# API key for Daytona
#daytona_api_key = ""
# Daytona Target
#daytona_target = ""
# Base path for the workspace
workspace_base = "./workspace"
# Cache directory path
#cache_dir = "/tmp/cache"
# Reasoning effort for o1 models (low, medium, high, or not set)
#reasoning_effort = "medium"
# Debugging enabled
#debug = false
# Disable color in terminal output
#disable_color = false
# Enable saving and restoring the session when run from CLI
#enable_cli_session = false
# Path to store trajectories, can be a folder or a file
# If it's a folder, the session id will be used as the file name
#trajectories_path="./trajectories"
#save_trajectory_path="./trajectories"
# Whether to save screenshots in the trajectory
# The screenshots are encoded and can make trajectory json files very large
#save_screenshots_in_trajectory = false
# Path to replay a trajectory, must be a file path
# If provided, trajectory will be loaded and replayed before the
# agent responds to any user instruction
#replay_trajectory_path = ""
# File store path
#file_store_path = "/tmp/file_store"
@@ -42,9 +57,6 @@ workspace_base = "./workspace"
# File store type
#file_store = "memory"
# List of allowed file extensions for uploads
#file_uploads_allowed_extensions = [".*"]
# Maximum file size for uploads, in megabytes
#file_uploads_max_file_size_mb = 0
@@ -67,7 +79,7 @@ workspace_base = "./workspace"
#run_as_openhands = true
# Runtime environment
#runtime = "eventstream"
#runtime = "docker"
# Name of the default agent
#default_agent = "CodeActAgent"
@@ -81,6 +93,17 @@ workspace_base = "./workspace"
# List of allowed file extensions for uploads
#file_uploads_allowed_extensions = [".*"]
# Whether to enable the default LLM summarizing condenser when no condenser is specified in config
# When true, a LLMSummarizingCondenserConfig will be used as the default condenser
# When false, a NoOpCondenserConfig (no summarization) will be used
#enable_default_condenser = true
# Maximum number of concurrent conversations per user
#max_concurrent_conversations = 3
# Maximum age of conversations in seconds before they are automatically closed
#conversation_max_age_seconds = 864000 # 10 days
#################################### LLM #####################################
# Configuration for LLM models (group name starts with 'llm')
# use 'llm' for the default LLM config
@@ -96,7 +119,7 @@ workspace_base = "./workspace"
#aws_secret_access_key = ""
# API key to use (For Headless / CLI only - In Web this is overridden by Session Init)
api_key = "your-api-key"
api_key = ""
# API base URL (For Headless / CLI only - In Web this is overridden by Session Init)
#base_url = ""
@@ -113,15 +136,6 @@ api_key = "your-api-key"
# Custom LLM provider
#custom_llm_provider = ""
# Embedding API base URL
#embedding_base_url = ""
# Embedding deployment name
#embedding_deployment_name = ""
# Embedding model to use
embedding_model = "local"
# Maximum number of characters in an observation's content
#max_message_chars = 10000
@@ -186,8 +200,10 @@ model = "gpt-4o"
# https://github.com/All-Hands-AI/OpenHands/pull/4711
#native_tool_calling = None
[llm.gpt4o-mini]
api_key = "your-api-key"
api_key = ""
model = "gpt-4o"
@@ -199,33 +215,28 @@ model = "gpt-4o"
##############################################################################
[agent]
# whether the browsing tool is enabled
# Whether the browsing tool is enabled
codeact_enable_browsing = true
# whether the LLM draft editor is enabled
# Whether the LLM draft editor is enabled
codeact_enable_llm_editor = false
# whether the IPython tool is enabled
# Whether the IPython tool is enabled
codeact_enable_jupyter = true
# Name of the micro agent to use for this agent
#micro_agent_name = ""
# Memory enabled
#memory_enabled = false
# Memory maximum threads
#memory_max_threads = 3
# LLM config group to use
#llm_config = 'your-llm-config-group'
# Whether to use microagents at all
#use_microagents = true
# Whether to use prompt extension (e.g., microagent, repo/runtime info) at all
#enable_prompt_extensions = true
# List of microagents to disable
#disabled_microagents = []
# Whether history should be truncated to continue the session when hitting LLM context
# length limit
enable_history_truncation = true
[agent.RepoExplorerAgent]
# Example: use a cheaper model for RepoExplorerAgent to reduce cost, especially
# useful when an agent doesn't demand high quality but uses a lot of tokens
@@ -247,7 +258,7 @@ llm_config = 'gpt3'
# Use host network
#use_host_network = false
# runtime extra build args
# Runtime extra build args
#runtime_extra_build_args = ["--network=host", "--add-host=host.docker.internal:host-gateway"]
# Enable auto linting after editing
@@ -265,6 +276,33 @@ llm_config = 'gpt3'
# BrowserGym environment to use for evaluation
#browsergym_eval_env = ""
# Platform to use for building the runtime image (e.g., "linux/amd64")
#platform = ""
# Force rebuild of runtime image even if it exists
#force_rebuild_runtime = false
# Runtime container image to use (if not provided, will be built from base_container_image)
#runtime_container_image = ""
# Keep runtime alive after session ends
#keep_runtime_alive = false
# Pause closed runtimes instead of stopping them
#pause_closed_runtimes = false
# Delay in seconds before closing idle runtimes
#close_delay = 300
# Remove all containers when stopping the runtime
#rm_all_containers = false
# Enable GPU support in the runtime
#enable_gpu = false
# Additional Docker runtime kwargs
#docker_runtime_kwargs = {}
#################################### Security ###################################
# Configuration for security features
##############################################################################
@@ -276,6 +314,72 @@ llm_config = 'gpt3'
# The security analyzer to use (For Headless / CLI only - In Web this is overridden by Session Init)
#security_analyzer = ""
# Whether to enable security analyzer
#enable_security_analyzer = false
#################################### Condenser #################################
# Condensers control how conversation history is managed and compressed when
# the context grows too large. Each agent uses one condenser configuration.
##############################################################################
[condenser]
# The type of condenser to use. Available options:
# - "noop": No condensing, keeps full history (default)
# - "observation_masking": Keeps full event structure but masks older observations
# - "recent": Keeps only recent events and discards older ones
# - "llm": Uses an LLM to summarize conversation history
# - "amortized": Intelligently forgets older events while preserving important context
# - "llm_attention": Uses an LLM to prioritize most relevant context
type = "noop"
# Examples for each condenser type (uncomment and modify as needed):
# 1. NoOp Condenser - No additional settings needed
#type = "noop"
# 2. Observation Masking Condenser
#type = "observation_masking"
# Number of most-recent events where observations will not be masked
#attention_window = 100
# 3. Recent Events Condenser
#type = "recent"
# Number of initial events to always keep (typically includes task description)
#keep_first = 1
# Maximum number of events to keep in history
#max_events = 100
# 4. LLM Summarizing Condenser
#type = "llm"
# Reference to an LLM config to use for summarization
#llm_config = "condenser"
# Number of initial events to always keep (typically includes task description)
#keep_first = 1
# Maximum size of history before triggering summarization
#max_size = 100
# 5. Amortized Forgetting Condenser
#type = "amortized"
# Number of initial events to always keep (typically includes task description)
#keep_first = 1
# Maximum size of history before triggering forgetting
#max_size = 100
# 6. LLM Attention Condenser
#type = "llm_attention"
# Reference to an LLM config to use for attention scoring
#llm_config = "condenser"
# Number of initial events to always keep (typically includes task description)
#keep_first = 1
# Maximum size of history before triggering attention mechanism
#max_size = 100
# Example of a custom LLM configuration for condensers that require an LLM
# If not provided, it falls back to the default LLM
#[llm.condenser]
#model = "gpt-4o"
#temperature = 0.1
#max_tokens = 1024
#################################### Eval ####################################
# Configuration for the evaluation, please refer to the specific evaluation
# plugin for the available options
+1 -1
View File
@@ -26,7 +26,7 @@ RUN apt-get update -y \
COPY ./pyproject.toml ./poetry.lock ./
RUN touch README.md
RUN export POETRY_CACHE_DIR && poetry install --without evaluation,llama-index --no-root && rm -rf $POETRY_CACHE_DIR
RUN export POETRY_CACHE_DIR && poetry install --without evaluation --no-root && rm -rf $POETRY_CACHE_DIR
FROM python:3.12.3-slim AS openhands-app
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eo pipefail
# Initialize variables with default values
+1 -1
View File
@@ -11,7 +11,7 @@ services:
- BACKEND_HOST=${BACKEND_HOST:-"0.0.0.0"}
- SANDBOX_API_HOSTNAME=host.docker.internal
#
- SANDBOX_RUNTIME_CONTAINER_IMAGE=${SANDBOX_RUNTIME_CONTAINER_IMAGE:-ghcr.io/all-hands-ai/runtime:0.19-nikolaik}
- SANDBOX_RUNTIME_CONTAINER_IMAGE=${SANDBOX_RUNTIME_CONTAINER_IMAGE:-ghcr.io/all-hands-ai/runtime:0.29-nikolaik}
- SANDBOX_USER_ID=${SANDBOX_USER_ID:-1234}
- WORKSPACE_MOUNT_PATH=${WORKSPACE_BASE:-$PWD/workspace}
ports:
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -o pipefail
function get_docker() {
+3
View File
@@ -24,3 +24,6 @@ inline-quotes = "single"
[format]
quote-style = "single"
[lint.flake8-bugbear]
extend-immutable-calls = ["Depends", "fastapi.Depends", "fastapi.params.Depends"]
+1 -1
View File
@@ -7,7 +7,7 @@ services:
image: openhands:latest
container_name: openhands-app-${DATE:-}
environment:
- SANDBOX_RUNTIME_CONTAINER_IMAGE=${SANDBOX_RUNTIME_CONTAINER_IMAGE:-docker.all-hands.dev/all-hands-ai/runtime:0.19-nikolaik}
- SANDBOX_RUNTIME_CONTAINER_IMAGE=${SANDBOX_RUNTIME_CONTAINER_IMAGE:-docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik}
#- SANDBOX_USER_ID=${SANDBOX_USER_ID:-1234} # enable this only if you want a specific non-root sandbox user but you will have to manually adjust permissions of openhands-state for this user
- WORKSPACE_MOUNT_PATH=${WORKSPACE_BASE:-$PWD/workspace}
ports:
+8
View File
@@ -46,3 +46,11 @@ docker run -it \
-e THAT=that
...
```
### Referring to UI Elements
When referencing UI elements, use ``.
Example:
1. Toggle the `Advanced` option
2. Enter your model in the `Custom Model` textbox.
+33 -14
View File
@@ -1,21 +1,32 @@
# Website
# OpenHands Documentation
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
This website is built using [Docusaurus](https://docusaurus.io/).
When published, the content will be published at https://docs.all-hands.dev/.
### Installation
```
```bash
$ cd docs
$ yarn
```
### Local Development
```
$ yarn start
$ yarn start # for the default English version
```
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
Alternatively, you can pass a `--locale` argument to render a specific language in dev mode as in:
```
$ yarn start --locale pt-BR # for the Brazilian Portuguese version
$ yarn start --locale fr # for the French version
$ yarn start --locale zh-Hans # for the Chinese Han (simplified variant) version
```
### Build
```
@@ -24,18 +35,26 @@ $ yarn build
This command generates static content into the `build` directory and can be served using any static contents hosting service.
It compiles all languages.
### Deployment
Using SSH:
Open a new pull request and - when it is merged - the [deploy-docs](.github/workflows/deploy-docs.yml) GH action will take care of everything else.
```
$ USE_SSH=true yarn deploy
## Automatic Translations
Translations can be automatically updated when the original English content changes, this is done by the script [`translation_updater.py`](./translation_updater.py).
From the root of the repository, you can run the following:
```bash
$ export ANTHROPIC_API_KEY=<your_api_key>
$ poetry run python docs/translation_updater.py
# ...
# Change detected in docs/modules/usage/getting-started.mdx
# translating... docs/modules/usage/getting-started.mdx pt-BR
# translation done
# ...
```
Not using SSH:
```
$ GIT_USER=<Your GitHub username> yarn deploy
```
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
This process uses `claude-3-opus-20240229` as base model and each language consumes at least ~30k input tokens and ~35k output tokens.
+34 -40
View File
@@ -1,30 +1,30 @@
import type * as Preset from "@docusaurus/preset-classic";
import type { Config } from "@docusaurus/types";
import { themes as prismThemes } from "prism-react-renderer";
import type * as Preset from '@docusaurus/preset-classic';
import type { Config } from '@docusaurus/types';
import { themes as prismThemes } from 'prism-react-renderer';
const config: Config = {
title: "OpenHands",
tagline: "Code Less, Make More",
favicon: "img/logo-square.png",
title: 'OpenHands',
tagline: 'Code Less, Make More',
favicon: 'img/logo-square.png',
// Set the production url of your site here
url: "https://docs.all-hands.dev",
baseUrl: "/",
url: 'https://docs.all-hands.dev',
baseUrl: '/',
// GitHub pages deployment config.
organizationName: "All-Hands-AI",
projectName: "OpenHands",
organizationName: 'All-Hands-AI',
projectName: 'OpenHands',
trailingSlash: false,
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr', 'zh-Hans'],
locales: ['en', 'fr', 'zh-Hans', 'pt-BR'],
localeConfigs: {
en: {
htmlLang: 'en-GB',
@@ -38,62 +38,56 @@ const config: Config = {
themes: ['@docusaurus/theme-mermaid'],
presets: [
[
"classic",
'classic',
{
docs: {
path: "modules",
routeBasePath: "modules",
sidebarPath: "./sidebars.ts",
path: 'modules',
routeBasePath: 'modules',
sidebarPath: './sidebars.ts',
exclude: [
// '**/_*.{js,jsx,ts,tsx,md,mdx}',
// '**/_*/**',
"**/*.test.{js,jsx,ts,tsx}",
"**/__tests__/**",
'**/*.test.{js,jsx,ts,tsx}',
'**/__tests__/**',
],
},
blog: {
showReadingTime: true,
},
theme: {
customCss: "./src/css/custom.css",
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
],
themeConfig: {
image: "img/docusaurus.png",
image: 'img/docusaurus.png',
navbar: {
title: "OpenHands",
title: 'OpenHands',
logo: {
alt: "OpenHands",
src: "img/logo.png",
alt: 'OpenHands',
src: 'img/logo.png',
},
items: [
{
type: "docSidebar",
sidebarId: "docsSidebar",
position: "left",
label: "User Guides",
},
{
type: "docSidebar",
sidebarId: "apiSidebar",
position: "left",
label: "Python API",
type: 'docSidebar',
sidebarId: 'docsSidebar',
position: 'left',
label: 'User Guides',
},
{
type: 'localeDropdown',
position: 'left',
},
{
href: "https://all-hands.dev",
label: "Company",
position: "right",
href: 'https://all-hands.dev',
label: 'Company',
position: 'right',
},
{
href: "https://github.com/All-Hands-AI/OpenHands",
label: "GitHub",
position: "right",
href: 'https://github.com/All-Hands-AI/OpenHands',
label: 'GitHub',
position: 'right',
},
],
},
+21
View File
@@ -402,5 +402,26 @@
"theme.unlistedContent.message": {
"message": "Cette page n'est pas répertoriée. Les moteurs de recherche ne l'indexeront pas, et seuls les utilisateurs ayant un lien direct peuvent y accéder.",
"description": "The unlisted content banner message"
},
"Use AI to tackle the toil in your backlog. Our agents have all the same tools as a human developer: they can modify code, run commands, browse the web, call APIs, and yes-even copy code snippets from StackOverflow.": {
"message": "Utilisez l'IA pour gérer les tâches répétitives de votre backlog. Nos agents disposent des mêmes outils qu'un développeur humain : ils peuvent modifier du code, exécuter des commandes, naviguer sur le web, appeler des API et même copier des extraits de code depuis StackOverflow."
},
"Get started with OpenHands.": {
"message": "Commencer avec OpenHands"
},
"Most Popular Links": {
"message": "Liens Populaires"
},
"Customizing OpenHands to a repository": {
"message": "Personnaliser OpenHands pour un dépôt"
},
"Integrating OpenHands with Github": {
"message": "Intégrer OpenHands avec Github"
},
"Recommended models to use": {
"message": "Modèles recommandés"
},
"Connecting OpenHands to your filesystem": {
"message": "Connecter OpenHands à votre système de fichiers"
}
}
@@ -1,8 +1,8 @@
# 📦 Runtime EventStream
# 📦 Runtime Docker
Le Runtime EventStream d'OpenHands est le composant principal qui permet l'exécution sécurisée et flexible des actions des agents d'IA.
Le Runtime Docker d'OpenHands est le composant principal qui permet l'exécution sécurisée et flexible des actions des agents d'IA.
Il crée un environnement en bac à sable (sandbox) en utilisant Docker, où du code arbitraire peut être exécuté en toute sécurité sans risquer le système hôte.
## Pourquoi avons-nous besoin d'un runtime en bac à sable ?
@@ -1,5 +1,3 @@
# Options de configuration
Ce guide détaille toutes les options de configuration disponibles pour OpenHands, vous aidant à personnaliser son comportement et à l'intégrer avec d'autres services.
@@ -13,41 +11,39 @@ la priorité.
# Table des matières
1. [Configuration de base](#configuration-de-base)
- [Clés API](#clés-api)
- [Espace de travail](#espace-de-travail)
- [Débogage et journalisation](#débogage-et-journalisation)
- [Gestion des sessions](#gestion-des-sessions)
- [Trajectoires](#trajectoires)
- [Stockage de fichiers](#stockage-de-fichiers)
- [Gestion des tâches](#gestion-des-tâches)
- [Configuration du bac à sable](#configuration-du-bac-à-sable)
- [Divers](#divers)
2. [Configuration LLM](#configuration-llm)
- [Informations d'identification AWS](#informations-didentification-aws)
- [Configuration de l'API](#configuration-de-lapi)
- [Fournisseur LLM personnalisé](#fournisseur-llm-personnalisé)
1. [Configuration de base](#core-configuration)
- [Clés API](#api-keys)
- [Espace de travail](#workspace)
- [Débogage et journalisation](#debugging-and-logging)
- [Trajectoires](#trajectories)
- [Stockage de fichiers](#file-store)
- [Gestion des tâches](#task-management)
- [Configuration du bac à sable](#sandbox-configuration)
- [Divers](#miscellaneous)
2. [Configuration LLM](#llm-configuration)
- [Informations d'identification AWS](#aws-credentials)
- [Configuration de l'API](#api-configuration)
- [Fournisseur LLM personnalisé](#custom-llm-provider)
- [Embeddings](#embeddings)
- [Gestion des messages](#gestion-des-messages)
- [Sélection du modèle](#sélection-du-modèle)
- [Nouvelles tentatives](#nouvelles-tentatives)
- [Options avancées](#options-avancées)
3. [Configuration de l'agent](#configuration-de-lagent)
- [Configuration du micro-agent](#configuration-du-micro-agent)
- [Configuration de la mémoire](#configuration-de-la-mémoire)
- [Configuration LLM](#configuration-llm-2)
- [Configuration de l'espace d'action](#configuration-de-lespace-daction)
- [Utilisation du micro-agent](#utilisation-du-micro-agent)
4. [Configuration du bac à sable](#configuration-du-bac-à-sable-2)
- [Exécution](#exécution)
- [Image de conteneur](#image-de-conteneur)
- [Mise en réseau](#mise-en-réseau)
- [Linting et plugins](#linting-et-plugins)
- [Dépendances et environnement](#dépendances-et-environnement)
- [Évaluation](#évaluation)
5. [Configuration de sécurité](#configuration-de-sécurité)
- [Mode de confirmation](#mode-de-confirmation)
- [Analyseur de sécurité](#analyseur-de-sécurité)
- [Gestion des messages](#message-handling)
- [Sélection du modèle](#model-selection)
- [Nouvelles tentatives](#retrying)
- [Options avancées](#advanced-options)
3. [Configuration de l'agent](#agent-configuration)
- [Configuration de la mémoire](#memory-configuration)
- [Configuration LLM](#llm-configuration-1)
- [Configuration de l'espace d'action](#actionspace-configuration)
- [Utilisation du micro-agent](#microagent-usage)
4. [Configuration du bac à sable](#sandbox-configuration-1)
- [Exécution](#execution)
- [Image de conteneur](#container-image)
- [Mise en réseau](#networking)
- [Linting et plugins](#linting-and-plugins)
- [Dépendances et environnement](#dependencies-and-environment)
- [Évaluation](#evaluation)
5. [Configuration de sécurité](#security-configuration)
- [Mode de confirmation](#confirmation-mode)
- [Analyseur de sécurité](#security-analyzer)
---
@@ -94,7 +90,7 @@ Les options de configuration de base sont définies dans la section `[core]` du
- Description : Désactiver la couleur dans la sortie du terminal
**Trajectoires**
- `trajectories_path`
- `save_trajectory_path`
- Type : `str`
- Valeur par défaut : `"./trajectories"`
- Description : Chemin pour stocker les trajectoires (peut être un dossier ou un fichier). Si c'est un dossier, les trajectoires seront enregistrées dans un fichier nommé avec l'ID de session et l'extension .json, dans ce dossier.
@@ -165,7 +161,7 @@ Les options de configuration de base sont définies dans la section `[core]` du
- `runtime`
- Type : `str`
- Valeur par défaut : `"eventstream"`
- Valeur par défaut : `"docker"`
- Description : Environnement d'exécution
- `default_agent`
@@ -184,6 +180,10 @@ Les options de configuration LLM (Large Language Model) sont définies dans la s
Pour les utiliser avec la commande docker, passez `-e LLM_<option>`. Exemple : `-e LLM_NUM_RETRIES`.
:::note
Pour les configurations de développement, vous pouvez également définir des configurations LLM personnalisées. Voir [Configurations LLM personnalisées](./llms/custom-llm-configs) pour plus de détails.
:::
**Informations d'identification AWS**
- `aws_access_key_id`
- Type : `str`
@@ -331,12 +331,6 @@ Pour les utiliser avec la commande docker, passez `-e LLM_<option>`. Exemple : `
Les options de configuration de l'agent sont définies dans les sections `[agent]` et `[agent.<agent_name>]` du fichier `config.toml`.
**Configuration du micro-agent**
- `micro_agent_name`
- Type : `str`
- Valeur par défaut : `""`
- Description : Nom du micro-agent à utiliser pour cet agent
**Configuration de la mémoire**
- `memory_enabled`
- Type : `bool`
@@ -368,4 +362,26 @@ Les options de configuration de l'agent sont définies dans les sections `[agent
- `codeact_enable_llm_editor`
- Type : `bool`
- Valeur par défaut : `false`
- Description : Si l'éditeur LLM est activé dans l'espace d'action (foncti
- Description : Si l'éditeur LLM est activé dans l'espace d'action (fonctionne uniquement avec l'appel de fonction)
**Utilisation du micro-agent**
- `enable_prompt_extensions`
- Type : `bool`
- Valeur par défaut : `true`
- Description : Indique si l'utilisation des micro-agents est activée ou non
- `disabled_microagents`
- Type : `list of str`
- Valeur par défaut : `None`
- Description : Liste des micro-agents à désactiver
### Exécution
- `timeout`
- Type : `int`
- Valeur par défaut : `120`
- Description : Délai d'expiration du bac à sable, en secondes
- `user_id`
- Type : `int`
- Valeur par défaut : `1000`
- Description : ID de l'utilisateur du bac à sable
@@ -42,10 +42,11 @@ Créez un fichier ```config.toml``` dans le répertoire OpenHands et entrez ces
[core]
workspace_base="./workspace"
run_as_openhands=true
sandbox_base_container_image="image_personnalisée"
[sandbox]
base_container_image="image_personnalisée"
```
> Assurez-vous que ```sandbox_base_container_image``` est défini sur le nom de votre image personnalisée précédente.
> Assurez-vous que ```base_container_image``` est défini sur le nom de votre image personnalisée précédente.
## Exécution
@@ -82,20 +83,17 @@ dockerfile_content = (
## Dépannage / Erreurs
### Erreur: ```useradd: UID 1000 est non unique```
Si vous voyez cette erreur dans la sortie de la console, il s'agit du fait que OpenHands essaie de créer le utilisateur openhands dans le sandbox avec un ID d'utilisateur de 1000, cependant cet ID d'utilisateur est déjà utilisé dans l'image (pour une raison inconnue). Pour résoudre ce problème, changez la valeur du champ sandbox_user_id dans le fichier config.toml en une valeur différente:
Si vous voyez cette erreur dans la sortie de la console, il s'agit du fait que OpenHands essaie de créer le utilisateur openhands dans le sandbox avec un ID d'utilisateur de 1000, cependant cet ID d'utilisateur est déjà utilisé dans l'image (pour une raison inconnue). Pour résoudre ce problème, changez la valeur du champ user_id dans le fichier config.toml en une valeur différente:
```toml
[core]
workspace_base="./workspace"
run_as_openhands=true
sandbox_base_container_image="image_personnalisée"
sandbox_user_id="1001"
[sandbox]
base_container_image="image_personnalisée"
user_id="1001"
```
### Erreurs de port d'utilisation
Si vous voyez un message d'erreur indiquant que le port est utilisé ou indisponible, essayez de supprimer toutes les containers docker en cours d'exécution (exécutez `docker ps` et `docker rm` des containers concernés) puis ré-exécutez ```make run```
## Discuter
Pour d'autres problèmes ou questions rejoignez le [Slack](https://join.slack.com/t/openhands-ai/shared_invite/zt-2wkh4pklz-w~h_DVDtEe9H5kyQlcNxVw) ou le [Discord](https://discord.gg/ESHStjSjD4) et demandez!
@@ -52,7 +52,7 @@ LLM_API_KEY="sk_test_12345"
```bash
docker run -it \
--pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.19-nikolaik \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik \
-e SANDBOX_USER_ID=$(id -u) \
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
-e LLM_API_KEY=$LLM_API_KEY \
@@ -61,7 +61,7 @@ docker run -it \
-v /var/run/docker.sock:/var/run/docker.sock \
--add-host host.docker.internal:host-gateway \
--name openhands-app-$(date +%Y%m%d%H%M%S) \
docker.all-hands.dev/all-hands-ai/openhands:0.19 \
docker.all-hands.dev/all-hands-ai/openhands:0.29 \
python -m openhands.core.cli
```
@@ -44,12 +44,13 @@ Tout d'abord, assurez-vous de pouvoir exécuter OpenHands en suivant les instruc
### Spécifier l'Image de Base du Sandbox
Dans le fichier `config.toml` dans le répertoire OpenHands, définissez `sandbox_base_container_image` sur l'image que vous souhaitez utiliser. Cela peut être une image que vous avez déjà extraite ou une que vous avez construite :
Dans le fichier `config.toml` dans le répertoire OpenHands, définissez `base_container_image` sur l'image que vous souhaitez utiliser. Cela peut être une image que vous avez déjà extraite ou une que vous avez construite :
```bash
[core]
...
sandbox_base_container_image="custom-image"
[sandbox]
base_container_image="custom-image"
```
### Exécution
@@ -114,7 +114,7 @@ Pour créer un workflow d'évaluation pour votre benchmark, suivez ces étapes :
def get_config(instance: pd.Series, metadata: EvalMetadata) -> AppConfig:
config = AppConfig(
default_agent=metadata.agent_class,
runtime='eventstream',
runtime='docker',
max_iterations=metadata.max_iterations,
sandbox=SandboxConfig(
base_container_image='your_container_image',
@@ -46,7 +46,7 @@ LLM_API_KEY="sk_test_12345"
```bash
docker run -it \
--pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.19-nikolaik \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik \
-e SANDBOX_USER_ID=$(id -u) \
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
-e LLM_API_KEY=$LLM_API_KEY \
@@ -56,6 +56,6 @@ docker run -it \
-v /var/run/docker.sock:/var/run/docker.sock \
--add-host host.docker.internal:host-gateway \
--name openhands-app-$(date +%Y%m%d%H%M%S) \
docker.all-hands.dev/all-hands-ai/openhands:0.19 \
docker.all-hands.dev/all-hands-ai/openhands:0.29 \
python -m openhands.core.main -t "write a bash script that prints hi" --no-auto-continue
```
@@ -13,16 +13,16 @@
La façon la plus simple d'exécuter OpenHands est avec Docker.
```bash
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.19-nikolaik
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik
docker run -it --rm --pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.19-nikolaik \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik \
-e LOG_ALL_EVENTS=true \
-v /var/run/docker.sock:/var/run/docker.sock \
-p 3000:3000 \
--add-host host.docker.internal:host-gateway \
--name openhands-app \
docker.all-hands.dev/all-hands-ai/openhands:0.19
docker.all-hands.dev/all-hands-ai/openhands:0.29
```
Vous pouvez également exécuter OpenHands en mode [headless scriptable](https://docs.all-hands.dev/modules/usage/how-to/headless-mode), en tant que [CLI interactive](https://docs.all-hands.dev/modules/usage/how-to/cli-mode), ou en utilisant l'[Action GitHub OpenHands](https://docs.all-hands.dev/modules/usage/how-to/github-action).
@@ -42,7 +42,7 @@ Explorez le code source d'OpenHands sur [GitHub](https://github.com/All-Hands-AI
/>
</a>
<br></br>
<a href="https://join.slack.com/t/openhands-ai/shared_invite/zt-2wkh4pklz-w~h_DVDtEe9H5kyQlcNxVw">
<a href="https://join.slack.com/t/openhands-ai/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw">
<img
src="https://img.shields.io/badge/Slack-Join%20Us-red?logo=slack&logoColor=white&style=for-the-badge"
alt="Join our Slack community"
@@ -0,0 +1,106 @@
# Configurations LLM personnalisées
OpenHands permet de définir plusieurs configurations LLM nommées dans votre fichier `config.toml`. Cette fonctionnalité vous permet d'utiliser différentes configurations LLM pour différents usages, comme utiliser un modèle moins coûteux pour les tâches qui ne nécessitent pas de réponses de haute qualité, ou utiliser différents modèles avec différents paramètres pour des agents spécifiques.
## Comment ça fonctionne
Les configurations LLM nommées sont définies dans le fichier `config.toml` en utilisant des sections qui commencent par `llm.`. Par exemple :
```toml
# Configuration LLM par défaut
[llm]
model = "gpt-4"
api_key = "votre-clé-api"
temperature = 0.0
# Configuration LLM personnalisée pour un modèle moins coûteux
[llm.gpt3]
model = "gpt-3.5-turbo"
api_key = "votre-clé-api"
temperature = 0.2
# Une autre configuration personnalisée avec des paramètres différents
[llm.haute-creativite]
model = "gpt-4"
api_key = "votre-clé-api"
temperature = 0.8
top_p = 0.9
```
Chaque configuration nommée hérite de tous les paramètres de la section `[llm]` par défaut et peut remplacer n'importe lequel de ces paramètres. Vous pouvez définir autant de configurations personnalisées que nécessaire.
## Utilisation des configurations personnalisées
### Avec les agents
Vous pouvez spécifier quelle configuration LLM un agent doit utiliser en définissant le paramètre `llm_config` dans la section de configuration de l'agent :
```toml
[agent.RepoExplorerAgent]
# Utiliser la configuration GPT-3 moins coûteuse pour cet agent
llm_config = 'gpt3'
[agent.CodeWriterAgent]
# Utiliser la configuration haute créativité pour cet agent
llm_config = 'haute-creativite'
```
### Options de configuration
Chaque configuration LLM nommée prend en charge toutes les mêmes options que la configuration LLM par défaut. Celles-ci incluent :
- Sélection du modèle (`model`)
- Configuration de l'API (`api_key`, `base_url`, etc.)
- Paramètres du modèle (`temperature`, `top_p`, etc.)
- Paramètres de nouvelle tentative (`num_retries`, `retry_multiplier`, etc.)
- Limites de jetons (`max_input_tokens`, `max_output_tokens`)
- Et toutes les autres options de configuration LLM
Pour une liste complète des options disponibles, consultez la section Configuration LLM dans la documentation des [Options de configuration](../configuration-options).
## Cas d'utilisation
Les configurations LLM personnalisées sont particulièrement utiles dans plusieurs scénarios :
- **Optimisation des coûts** : Utiliser des modèles moins coûteux pour les tâches qui ne nécessitent pas de réponses de haute qualité, comme l'exploration de dépôt ou les opérations simples sur les fichiers.
- **Réglage spécifique aux tâches** : Configurer différentes valeurs de température et de top_p pour les tâches qui nécessitent différents niveaux de créativité ou de déterminisme.
- **Différents fournisseurs** : Utiliser différents fournisseurs LLM ou points d'accès API pour différentes tâches.
- **Tests et développement** : Basculer facilement entre différentes configurations de modèles pendant le développement et les tests.
## Exemple : Optimisation des coûts
Un exemple pratique d'utilisation des configurations LLM personnalisées pour optimiser les coûts :
```toml
# Configuration par défaut utilisant GPT-4 pour des réponses de haute qualité
[llm]
model = "gpt-4"
api_key = "votre-clé-api"
temperature = 0.0
# Configuration moins coûteuse pour l'exploration de dépôt
[llm.repo-explorer]
model = "gpt-3.5-turbo"
temperature = 0.2
# Configuration pour la génération de code
[llm.code-gen]
model = "gpt-4"
temperature = 0.0
max_output_tokens = 2000
[agent.RepoExplorerAgent]
llm_config = 'repo-explorer'
[agent.CodeWriterAgent]
llm_config = 'code-gen'
```
Dans cet exemple :
- L'exploration de dépôt utilise un modèle moins coûteux car il s'agit principalement de comprendre et de naviguer dans le code
- La génération de code utilise GPT-4 avec une limite de jetons plus élevée pour générer des blocs de code plus importants
- La configuration par défaut reste disponible pour les autres tâches
:::note
Les configurations LLM personnalisées ne sont disponibles que lors de l'utilisation d'OpenHands en mode développement, via `main.py` ou `cli.py`. Lors de l'exécution via `docker run`, veuillez utiliser les options de configuration standard.
:::
@@ -13,7 +13,7 @@ C'est le Runtime par défaut qui est utilisé lorsque vous démarrez OpenHands.
```
docker run # ...
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.19-nikolaik \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik \
-v /var/run/docker.sock:/var/run/docker.sock \
# ...
```
+53
View File
@@ -0,0 +1,53 @@
{
"footer.title": {
"message": "OpenHands"
},
"footer.docs": {
"message": "Documentação"
},
"footer.community": {
"message": "Comunidade"
},
"footer.copyright": {
"message": "© {year} OpenHands"
},
"faq.title": {
"message": "Perguntas Frequentes",
"description": "FAQ Title"
},
"faq.description": {
"message": "Perguntas Frequentes"
},
"faq.section.title.1": {
"message": "O que é o OpenHands?",
"description": "First Section Title"
},
"faq.section.highlight": {
"message": "OpenHands",
"description": "Highlight Text"
},
"faq.section.description.1": {
"message": "é um engenheiro de software autônomo que pode resolver tarefas de engenharia de software e navegação web a qualquer momento. Pode executar consultas de ciência de dados, como \"Encontrar o número de pull requests no repositório OpenHands nos últimos meses\", e tarefas de engenharia de software, como \"Por favor, adicione testes a este arquivo e verifique se todos os testes passam. Se não, corrija o arquivo.\"",
"description": "Description for OpenHands"
},
"faq.section.description.2": {
"message": "Além disso, o OpenHands é uma plataforma e comunidade para desenvolvedores de agentes que desejam testar e avaliar novos agentes.",
"description": "Further Description for OpenHands"
},
"faq.section.title.2": {
"message": "Suporte",
"description": "Support Section Title"
},
"faq.section.support.answer": {
"message": "Se você encontrar um problema que outros usuários também possam ter, por favor, relate-o em {githubLink}. Se você estiver tendo dificuldades com a instalação ou tiver perguntas gerais, junte-se a nós no {discordLink} ou {slackLink}.",
"description": "Support Answer"
},
"faq.section.title.3": {
"message": "Como resolver um problema no GitHub com o OpenHands?",
"description": "GitHub Issue Section Title"
},
"faq.section.github.steps.intro": {
"message": "Para resolver um problema no GitHub usando o OpenHands, envie um comando ao OpenHands pedindo para seguir etapas como as seguintes:",
"description": "GitHub Steps Introduction"
}
}
@@ -0,0 +1,14 @@
{
"title": {
"message": "Blog",
"description": "O título do blog usado para SEO"
},
"description": {
"message": "Blog",
"description": "A descrição do blog usada para SEO"
},
"sidebar.title": {
"message": "Artigos recentes",
"description": "A descrição para a barra lateral esquerda"
}
}
@@ -0,0 +1,18 @@
{
"version.label": {
"message": "Atual",
"description": "The label for version current"
},
"sidebar.docsSidebar.category.🤖 Backends LLM": {
"message": "🤖 Backends LLM",
"description": "The label for category 🤖 Backends LLM in sidebar docsSidebar"
},
"sidebar.docsSidebar.category.🚧 Dépannage": {
"message": "🚧 Solução de Problemas",
"description": "The label for category 🚧 Dépannage in sidebar docsSidebar"
},
"sidebar.apiSidebar.category.Backend": {
"message": "Backend",
"description": "The label for category Backend in sidebar apiSidebar"
}
}
@@ -0,0 +1,3 @@
# Python Docs
Docs will appear here after deployment.
@@ -0,0 +1,5 @@
{
"items": ["python/python"],
"label": "Backend",
"type": "category"
}
@@ -0,0 +1,25 @@
# Sobre o OpenHands
## Estratégia de Pesquisa
Alcançar a replicação completa de aplicações de nível de produção com LLMs é um esforço complexo. Nossa estratégia envolve:
- **Pesquisa Técnica Central:** Foco em pesquisa fundamental para entender e aprimorar os aspectos técnicos da geração e manipulação de código.
- **Planejamento de Tarefas:** Desenvolvimento de capacidades para detecção de bugs, gerenciamento de codebase e otimização.
- **Avaliação:** Estabelecimento de métricas de avaliação abrangentes para melhor entender e aprimorar nossos agentes.
## Agente Padrão
Nosso Agente padrão atualmente é o [CodeActAgent](agents), que é capaz de gerar código e lidar com arquivos.
## Construído Com
O OpenHands é construído usando uma combinação de poderosos frameworks e bibliotecas, fornecendo uma base robusta para seu desenvolvimento. Aqui estão as principais tecnologias usadas no projeto:
![FastAPI](https://img.shields.io/badge/FastAPI-black?style=for-the-badge) ![uvicorn](https://img.shields.io/badge/uvicorn-black?style=for-the-badge) ![LiteLLM](https://img.shields.io/badge/LiteLLM-black?style=for-the-badge) ![Docker](https://img.shields.io/badge/Docker-black?style=for-the-badge) ![Ruff](https://img.shields.io/badge/Ruff-black?style=for-the-badge) ![MyPy](https://img.shields.io/badge/MyPy-black?style=for-the-badge) ![LlamaIndex](https://img.shields.io/badge/LlamaIndex-black?style=for-the-badge) ![React](https://img.shields.io/badge/React-black?style=for-the-badge)
Por favor, note que a seleção dessas tecnologias está em andamento, e tecnologias adicionais podem ser adicionadas ou as existentes podem ser removidas à medida que o projeto evolui. Nós nos esforçamos para adotar as ferramentas mais adequadas e eficientes para aprimorar as capacidades do OpenHands.
## Licença
Distribuído sob a [Licença](https://github.com/All-Hands-AI/OpenHands/blob/main/LICENSE) MIT.
@@ -0,0 +1,23 @@
# 🧠 Agente Principal e Capacidades
## CodeActAgent
### Descrição
Este agente implementa a ideia do CodeAct ([artigo](https://arxiv.org/abs/2402.01030), [tweet](https://twitter.com/xingyaow_/status/1754556835703751087)) que consolida as **ações** dos agentes LLM em um espaço de ação de **código** unificado para _simplicidade_ e _desempenho_.
A ideia conceitual é ilustrada abaixo. A cada turno, o agente pode:
1. **Conversar**: Comunicar-se com humanos em linguagem natural para pedir esclarecimentos, confirmações, etc.
2. **CodeAct**: Optar por executar a tarefa executando código
- Executar qualquer comando Linux `bash` válido
- Executar qualquer código `Python` válido com [um interpretador Python interativo](https://ipython.org/). Isso é simulado através do comando `bash`, veja o sistema de plugins abaixo para mais detalhes.
![image](https://github.com/All-Hands-AI/OpenHands/assets/38853559/92b622e3-72ad-4a61-8f41-8c040b6d5fb3)
### Demonstração
https://github.com/All-Hands-AI/OpenHands/assets/38853559/f592a192-e86c-4f48-ad31-d69282d5f6ac
_Exemplo do CodeActAgent com `gpt-4-turbo-2024-04-09` realizando uma tarefa de ciência de dados (regressão linear)_.
@@ -0,0 +1,58 @@
# 🏛️ Arquitetura do Sistema
<div style={{ textAlign: 'center' }}>
<img
src="https://github.com/All-Hands-AI/OpenHands/assets/16201837/97d747e3-29d8-4ccb-8d34-6ad1adb17f38"
alt="Diagrama da Arquitetura do Sistema OpenHands 4 de julho de 2024"
/>
<p>
<em>Diagrama da Arquitetura do Sistema OpenHands (4 de julho de 2024)</em>
</p>
</div>
Esta é uma visão geral de alto nível da arquitetura do sistema. O sistema é dividido em dois componentes principais: o frontend e o backend. O frontend é responsável por lidar com as interações do usuário e exibir os resultados. O backend é responsável por lidar com a lógica de negócios e executar os agentes.
# Arquitetura do Frontend {#frontend-architecture-en}
![system_architecture.svg](/img/system_architecture.svg)
Esta visão geral é simplificada para mostrar os principais componentes e suas interações. Para uma visão mais detalhada da arquitetura do backend, consulte a seção Arquitetura do Backend abaixo.
# Arquitetura do Backend {#backend-architecture-en}
_**Aviso**: A arquitetura do backend é um trabalho em andamento e está sujeita a alterações. O diagrama a seguir mostra a arquitetura atual do backend com base no commit mostrado no rodapé do diagrama._
![backend_architecture.svg](/img/backend_architecture.svg)
<details>
<summary>Atualizando este Diagrama</summary>
<div>
A geração do diagrama da arquitetura do backend é parcialmente automatizada.
O diagrama é gerado a partir das type hints no código usando a ferramenta py2puml.
O diagrama é então revisado manualmente, ajustado e exportado para PNG e SVG.
## Pré-requisitos
- Ambiente python em execução no qual o openhands é executável
(de acordo com as instruções no arquivo README.md na raiz do repositório)
- [py2puml](https://github.com/lucsorel/py2puml) instalado
## Passos
1. Gere automaticamente o diagrama executando o seguinte comando na raiz do repositório:
`py2puml openhands openhands > docs/architecture/backend_architecture.puml`
2. Abra o arquivo gerado em um editor PlantUML, por exemplo, Visual Studio Code com a extensão PlantUML ou [PlantText](https://www.planttext.com/)
3. Revise o PUML gerado e faça todos os ajustes necessários no diagrama (adicione partes ausentes, corrija erros, melhore o posicionamento).
_py2puml cria o diagrama com base nas type hints no código, portanto, type hints ausentes ou incorretas podem resultar em um diagrama incompleto ou incorreto._
4. Revise a diferença entre o novo diagrama e o anterior e verifique manualmente se as alterações estão corretas.
_Certifique-se de não remover partes que foram adicionadas manualmente ao diagrama no passado e ainda são relevantes._
5. Adicione o hash do commit que foi usado para gerar o diagrama no rodapé do diagrama.
6. Exporte o diagrama como arquivos PNG e SVG e substitua os diagramas existentes no diretório `docs/architecture`. Isso pode ser feito com (por exemplo, [PlantText](https://www.planttext.com/))
</div>
</details>
@@ -0,0 +1,134 @@
# 📦 Docker Runtime
O OpenHands Docker Runtime é o componente principal que permite a execução segura e flexível das ações do agente de IA.
Ele cria um ambiente isolado usando o Docker, onde código arbitrário pode ser executado com segurança sem arriscar o sistema host.
## Por que precisamos de um runtime isolado?
O OpenHands precisa executar código arbitrário em um ambiente seguro e isolado por várias razões:
1. Segurança: Executar código não confiável pode representar riscos significativos para o sistema host. Um ambiente isolado impede que código malicioso acesse ou modifique os recursos do sistema host
2. Consistência: Um ambiente isolado garante que a execução do código seja consistente em diferentes máquinas e configurações, eliminando problemas do tipo "funciona na minha máquina"
3. Controle de Recursos: O isolamento permite um melhor controle sobre a alocação e uso de recursos, evitando que processos descontrolados afetem o sistema host
4. Isolamento: Diferentes projetos ou usuários podem trabalhar em ambientes isolados sem interferir uns com os outros ou com o sistema host
5. Reprodutibilidade: Ambientes isolados facilitam a reprodução de bugs e problemas, já que o ambiente de execução é consistente e controlável
## Como o Runtime funciona?
O sistema OpenHands Runtime usa uma arquitetura cliente-servidor implementada com contêineres Docker. Aqui está uma visão geral de como ele funciona:
```mermaid
graph TD
A[Imagem Docker Personalizada Fornecida pelo Usuário] --> B[Backend do OpenHands]
B -->|Constrói| C[Imagem do OH Runtime]
C -->|Inicia| D[Executor de Ação]
D -->|Inicializa| E[Navegador]
D -->|Inicializa| F[Shell Bash]
D -->|Inicializa| G[Plugins]
G -->|Inicializa| L[Servidor Jupyter]
B -->|Gera| H[Agente]
B -->|Gera| I[EventStream]
I <--->|Executa Ação para
Obter Observação
via API REST
| D
H -->|Gera Ação| I
I -->|Obtém Observação| H
subgraph "Contêiner Docker"
D
E
F
G
L
end
```
1. Entrada do Usuário: O usuário fornece uma imagem Docker base personalizada
2. Construção da Imagem: O OpenHands constrói uma nova imagem Docker (a "imagem do OH runtime") com base na imagem fornecida pelo usuário. Essa nova imagem inclui código específico do OpenHands, principalmente o "cliente de runtime"
3. Inicialização do Contêiner: Quando o OpenHands inicia, ele lança um contêiner Docker usando a imagem do OH runtime
4. Inicialização do Servidor de Execução de Ação: O servidor de execução de ação inicializa um `ActionExecutor` dentro do contêiner, configurando os componentes necessários, como um shell bash e carregando quaisquer plugins especificados
5. Comunicação: O backend do OpenHands (`openhands/runtime/impl/eventstream/eventstream_runtime.py`) se comunica com o servidor de execução de ação por meio de uma API RESTful, enviando ações e recebendo observações
6. Execução da Ação: O cliente de runtime recebe ações do backend, as executa no ambiente isolado e envia de volta as observações
7. Retorno da Observação: O servidor de execução de ação envia os resultados da execução de volta para o backend do OpenHands como observações
O papel do cliente:
- Ele atua como um intermediário entre o backend do OpenHands e o ambiente isolado
- Ele executa vários tipos de ações (comandos shell, operações de arquivo, código Python, etc.) com segurança dentro do contêiner
- Ele gerencia o estado do ambiente isolado, incluindo o diretório de trabalho atual e os plugins carregados
- Ele formata e retorna observações para o backend, garantindo uma interface consistente para processar os resultados
## Como o OpenHands constrói e mantém imagens do OH Runtime
A abordagem do OpenHands para construir e gerenciar imagens de runtime garante eficiência, consistência e flexibilidade na criação e manutenção de imagens Docker para ambientes de produção e desenvolvimento.
Confira o [código relevante](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/utils/runtime_build.py) se você estiver interessado em mais detalhes.
### Sistema de Tags de Imagem
O OpenHands usa um sistema de três tags para suas imagens de runtime para equilibrar reprodutibilidade com flexibilidade.
As tags podem estar em um dos 2 formatos:
- **Tag Versionada**: `oh_v{openhands_version}_{base_image}` (ex.: `oh_v0.9.9_nikolaik_s_python-nodejs_t_python3.12-nodejs22`)
- **Tag de Bloqueio**: `oh_v{openhands_version}_{16_digit_lock_hash}` (ex.: `oh_v0.9.9_1234567890abcdef`)
- **Tag de Origem**: `oh_v{openhands_version}_{16_digit_lock_hash}_{16_digit_source_hash}`
(ex.: `oh_v0.9.9_1234567890abcdef_1234567890abcdef`)
#### Tag de Origem - Mais Específica
Estes são os primeiros 16 dígitos do MD5 do hash do diretório para o diretório de origem. Isso fornece um hash
apenas para o código-fonte do openhands
#### Tag de Bloqueio
Este hash é construído a partir dos primeiros 16 dígitos do MD5 de:
- O nome da imagem base sobre a qual a imagem foi construída (ex.: `nikolaik/python-nodejs:python3.12-nodejs22`)
- O conteúdo do `pyproject.toml` incluído na imagem.
- O conteúdo do `poetry.lock` incluído na imagem.
Isso efetivamente fornece um hash para as dependências do Openhands independente do código-fonte.
#### Tag Versionada - Mais Genérica
Esta tag é uma concatenação da versão do openhands e do nome da imagem base (transformado para se adequar ao padrão de tag).
#### Processo de Construção
Ao gerar uma imagem...
- **Sem reconstrução**: O OpenHands primeiro verifica se existe uma imagem com a mesma **tag de origem mais específica**. Se houver tal imagem,
nenhuma construção é realizada - a imagem existente é usada.
- **Reconstrução mais rápida**: O OpenHands verifica em seguida se existe uma imagem com a **tag de bloqueio genérica**. Se houver tal imagem,
o OpenHands constrói uma nova imagem com base nela, ignorando todas as etapas de instalação (como `poetry install` e
`apt-get`), exceto uma operação final para copiar o código-fonte atual. A nova imagem é marcada apenas com uma
tag de **origem**.
- **Reconstrução razoável**: Se não existir uma tag de **origem** nem de **bloqueio**, uma imagem será construída com base na imagem com tag **versionada**.
Na imagem com tag versionada, a maioria das dependências já deve estar instalada, economizando tempo.
- **Reconstrução mais lenta**: Se todas as três tags não existirem, uma nova imagem é construída com base na imagem
base (o que é uma operação mais lenta). Esta nova imagem é marcada com todas as tags de **origem**, **bloqueio** e **versionada**.
Essa abordagem de tags permite que o OpenHands gerencie com eficiência ambientes de desenvolvimento e produção.
1. Código-fonte e Dockerfile idênticos sempre produzem a mesma imagem (via tags baseadas em hash)
2. O sistema pode reconstruir rapidamente imagens quando ocorrem pequenas alterações (aproveitando imagens compatíveis recentes)
3. A tag de **bloqueio** (ex.: `runtime:oh_v0.9.3_1234567890abcdef`) sempre aponta para a construção mais recente para uma combinação específica de imagem base, dependência e versão do OpenHands
## Sistema de Plugins do Runtime
O OpenHands Runtime suporta um sistema de plugins que permite estender a funcionalidade e personalizar o ambiente de runtime. Os plugins são inicializados quando o cliente de runtime é iniciado.
Confira [um exemplo do plugin Jupyter aqui](https://github.com/All-Hands-AI/OpenHands/blob/ecf4aed28b0cf7c18d4d8ff554883ba182fc6bdd/openhands/runtime/plugins/jupyter/__init__.py#L21-L55) se você quiser implementar seu próprio plugin.
_Mais detalhes sobre o sistema de Plugins ainda estão em construção - contribuições são bem-vindas!_
Aspectos-chave do sistema de plugins:
1. Definição de Plugin: Os plugins são definidos como classes Python que herdam de uma classe base `Plugin`
2. Registro de Plugin: Os plugins disponíveis são registrados em um dicionário `ALL_PLUGINS`
3. Especificação de Plugin: Os plugins são associados a `Agent.sandbox_plugins: list[PluginRequirement]`. Os usuários podem especificar quais plugins carregar ao inicializar o runtime
4. Inicialização: Os plugins são inicializados de forma assíncrona quando o cliente de runtime é iniciado
5. Uso: O cliente de runtime pode usar plugins inicializados para estender suas capacidades (por exemplo, o JupyterPlugin para executar células IPython)
@@ -0,0 +1,33 @@
Here is the translation to Brazilian Portuguese:
# GitHub Cloud Resolver
O GitHub Cloud Resolver automatiza correções de código e fornece assistência inteligente para seus repositórios.
## Configuração
O Resolvedor do GitHub na Nuvem está disponível automaticamente quando você
[concede acesso ao repositório do OpenHands Cloud](./openhands-cloud.md#adding-repository-access).
## Uso
Após conceder acesso ao repositório do OpenHands Cloud, você pode usar o Resolvedor do GitHub na Nuvem nos problemas e pull requests
do repositório.
### Issues
No seu repositório, rotule um issue com `openhands`. O OpenHands irá:
1. Comentar no issue 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 issue foi resolvido com sucesso.
3. Comentar no issue 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 inline 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.
@@ -0,0 +1,45 @@
# Openhands Cloud
O OpenHands Cloud é a versão hospedada na nuvem do OpenHands da All Hands AI.
## Acessando o OpenHands Cloud
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.
## Primeiros Passos
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.
## Acesso ao Repositório
### Adicionando Acesso ao Repositório
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,396 @@
# Opções de Configuração
Este guia detalha todas as opções de configuração disponíveis para o OpenHands, ajudando você a personalizar seu comportamento e integrá-lo com outros serviços.
:::note
Se você estiver executando no [Modo GUI](https://docs.all-hands.dev/modules/usage/how-to/gui-mode), as configurações disponíveis na UI de Configurações sempre terão precedência.
:::
## Configuração Principal
As opções de configuração principais são definidas na seção `[core]` do arquivo `config.toml`.
### Chaves de API
- `e2b_api_key`
- Tipo: `str`
- Padrão: `""`
- Descrição: Chave de API para E2B
- `modal_api_token_id`
- Tipo: `str`
- Padrão: `""`
- Descrição: ID do token de API para Modal
- `modal_api_token_secret`
- Tipo: `str`
- Padrão: `""`
- Descrição: Segredo do token de API para Modal
### Workspace
- `workspace_base`
- Tipo: `str`
- Padrão: `"./workspace"`
- Descrição: Caminho base para o workspace
- `cache_dir`
- Tipo: `str`
- Padrão: `"/tmp/cache"`
- Descrição: Caminho do diretório de cache
### Depuração e Log
- `debug`
- Tipo: `bool`
- Padrão: `false`
- Descrição: Habilitar depuração
- `disable_color`
- Tipo: `bool`
- Padrão: `false`
- Descrição: Desabilitar cor na saída do terminal
### Trajetórias
- `save_trajectory_path`
- Tipo: `str`
- Padrão: `"./trajectories"`
- Descrição: Caminho para armazenar trajetórias (pode ser uma pasta ou um arquivo). Se for uma pasta, as trajetórias serão salvas em um arquivo nomeado com o nome do id da sessão e extensão .json, nessa pasta.
- `replay_trajectory_path`
- Tipo: `str`
- Padrão: `""`
- Descrição: Caminho para carregar uma trajetória e reproduzir. Se fornecido, deve ser um caminho para o arquivo de trajetória no formato JSON. As ações no arquivo de trajetória seriam reproduzidas primeiro antes de qualquer instrução do usuário ser executada.
### Armazenamento de Arquivos
- `file_store_path`
- Tipo: `str`
- Padrão: `"/tmp/file_store"`
- Descrição: Caminho do armazenamento de arquivos
- `file_store`
- Tipo: `str`
- Padrão: `"memory"`
- Descrição: Tipo de armazenamento de arquivos
- `file_uploads_allowed_extensions`
- Tipo: `list of str`
- Padrão: `[".*"]`
- Descrição: Lista de extensões de arquivo permitidas para uploads
- `file_uploads_max_file_size_mb`
- Tipo: `int`
- Padrão: `0`
- Descrição: Tamanho máximo de arquivo para uploads, em megabytes
- `file_uploads_restrict_file_types`
- Tipo: `bool`
- Padrão: `false`
- Descrição: Restringir tipos de arquivo para uploads de arquivos
- `file_uploads_allowed_extensions`
- Tipo: `list of str`
- Padrão: `[".*"]`
- Descrição: Lista de extensões de arquivo permitidas para uploads
### Gerenciamento de Tarefas
- `max_budget_per_task`
- Tipo: `float`
- Padrão: `0.0`
- Descrição: Orçamento máximo por tarefa (0.0 significa sem limite)
- `max_iterations`
- Tipo: `int`
- Padrão: `100`
- Descrição: Número máximo de iterações
### Configuração do Sandbox
- `workspace_mount_path_in_sandbox`
- Tipo: `str`
- Padrão: `"/workspace"`
- Descrição: Caminho para montar o workspace no sandbox
- `workspace_mount_path`
- Tipo: `str`
- Padrão: `""`
- Descrição: Caminho para montar o workspace
- `workspace_mount_rewrite`
- Tipo: `str`
- Padrão: `""`
- Descrição: Caminho para reescrever o caminho de montagem do workspace. Você geralmente pode ignorar isso, refere-se a casos especiais de execução dentro de outro contêiner.
### Diversos
- `run_as_openhands`
- Tipo: `bool`
- Padrão: `true`
- Descrição: Executar como OpenHands
- `runtime`
- Tipo: `str`
- Padrão: `"docker"`
- Descrição: Ambiente de execução
- `default_agent`
- Tipo: `str`
- Padrão: `"CodeActAgent"`
- Descrição: Nome do agente padrão
- `jwt_secret`
- Tipo: `str`
- Padrão: `uuid.uuid4().hex`
- Descrição: Segredo JWT para autenticação. Por favor, defina seu próprio valor.
## Configuração do LLM
As opções de configuração do LLM (Large Language Model) são definidas na seção `[llm]` do arquivo `config.toml`.
Para usá-las com o comando docker, passe `-e LLM_<opção>`. Exemplo: `-e LLM_NUM_RETRIES`.
:::note
Para configurações de desenvolvimento, você também pode definir configurações de LLM personalizadas nomeadas. Veja [Configurações Personalizadas de LLM](./llms/custom-llm-configs) para detalhes.
:::
**Credenciais AWS**
- `aws_access_key_id`
- Tipo: `str`
- Padrão: `""`
- Descrição: ID da chave de acesso AWS
- `aws_region_name`
- Tipo: `str`
- Padrão: `""`
- Descrição: Nome da região AWS
- `aws_secret_access_key`
- Tipo: `str`
- Padrão: `""`
- Descrição: Chave secreta de acesso AWS
### Configuração da API
- `api_key`
- Tipo: `str`
- Padrão: `None`
- Descrição: Chave de API a ser usada
- `base_url`
- Tipo: `str`
- Padrão: `""`
- Descrição: URL base da API
- `api_version`
- Tipo: `str`
- Padrão: `""`
- Descrição: Versão da API
- `input_cost_per_token`
- Tipo: `float`
- Padrão: `0.0`
- Descrição: Custo por token de entrada
- `output_cost_per_token`
- Tipo: `float`
- Padrão: `0.0`
- Descrição: Custo por token de saída
### Provedor LLM Personalizado
- `custom_llm_provider`
- Tipo: `str`
- Padrão: `""`
- Descrição: Provedor LLM personalizado
### Tratamento de Mensagens
- `max_message_chars`
- Tipo: `int`
- Padrão: `30000`
- Descrição: O número máximo aproximado de caracteres no conteúdo de um evento incluído no prompt para o LLM. Observações maiores são truncadas.
- `max_input_tokens`
- Tipo: `int`
- Padrão: `0`
- Descrição: Número máximo de tokens de entrada
- `max_output_tokens`
- Tipo: `int`
- Padrão: `0`
- Descrição: Número máximo de tokens de saída
### Seleção de Modelo
- `model`
- Tipo: `str`
- Padrão: `"claude-3-5-sonnet-20241022"`
- Descrição: Modelo a ser usado
### Tentativas
- `num_retries`
- Tipo: `int`
- Padrão: `8`
- Descrição: Número de tentativas a serem feitas
- `retry_max_wait`
- Tipo: `int`
- Padrão: `120`
- Descrição: Tempo máximo de espera (em segundos) entre tentativas
- `retry_min_wait`
- Tipo: `int`
- Padrão: `15`
- Descrição: Tempo mínimo de espera (em segundos) entre tentativas
- `retry_multiplier`
- Tipo: `float`
- Padrão: `2.0`
- Descrição: Multiplicador para cálculo de backoff exponencial
### Opções Avançadas
- `drop_params`
- Tipo: `bool`
- Padrão: `false`
- Descrição: Descartar quaisquer parâmetros não mapeados (não suportados) sem causar uma exceção
- `caching_prompt`
- Tipo: `bool`
- Padrão: `true`
- Descrição: Usar o recurso de cache de prompt se fornecido pelo LLM e suportado
- `ollama_base_url`
- Tipo: `str`
- Padrão: `""`
- Descrição: URL base para a API OLLAMA
- `temperature`
- Tipo: `float`
- Padrão: `0.0`
- Descrição: Temperatura para a API
- `timeout`
- Tipo: `int`
- Padrão: `0`
- Descrição: Timeout para a API
- `top_p`
- Tipo: `float`
- Padrão: `1.0`
- Descrição: Top p para a API
- `disable_vision`
- Tipo: `bool`
- Padrão: `None`
- Descrição: Se o modelo é capaz de visão, esta opção permite desabilitar o processamento de imagem (útil para redução de custo)
## Configuração do Agente
As opções de configuração do agente são definidas nas seções `[agent]` e `[agent.<agent_name>]` do arquivo `config.toml`.
### Configuração do LLM
- `llm_config`
- Tipo: `str`
- Padrão: `'your-llm-config-group'`
- Descrição: O nome da configuração LLM a ser usada
### Configuração do Espaço de Ação
- `function_calling`
- Tipo: `bool`
- Padrão: `true`
- Descrição: Se a chamada de função está habilitada
- `codeact_enable_browsing`
- Tipo: `bool`
- Padrão: `false`
- Descrição: Se o delegado de navegação está habilitado no espaço de ação (funciona apenas com chamada de função)
- `codeact_enable_llm_editor`
- Tipo: `bool`
- Padrão: `false`
- Descrição: Se o editor LLM está habilitado no espaço de ação (funciona apenas com chamada de função)
- `codeact_enable_jupyter`
- Tipo: `bool`
- Padrão: `false`
- Descrição: Se o Jupyter está habilitado no espaço de ação
- `enable_history_truncation`
- Tipo: `bool`
- Padrão: `true`
- Descrição: Se o histórico deve ser truncado para continuar a sessão ao atingir o limite de comprimento de contexto do LLM
### Uso de Microagentes
- `enable_prompt_extensions`
- Tipo: `bool`
- Padrão: `true`
- Descrição: Se deve usar microagentes
- `disabled_microagents`
- Tipo: `list of str`
- Padrão: `None`
- Descrição: Uma lista de microagentes a serem desabilitados
## Configuração do Sandbox
As opções de configuração do sandbox são definidas na seção `[sandbox]` do arquivo `config.toml`.
Para usá-las com o comando docker, passe `-e SANDBOX_<opção>`. Exemplo: `-e SANDBOX_TIMEOUT`.
### Execução
- `timeout`
- Tipo: `int`
- Padrão: `120`
- Descrição: Timeout do sandbox em segundos
- `user_id`
- Tipo: `int`
- Padrão: `1000`
- Descrição: ID do usuário do sandbox
### Imagem do Contêiner
- `base_container_image`
- Tipo: `str`
- Padrão: `"nikolaik/python-nodejs:python3.12-nodejs22"`
- Descrição: Imagem do contêiner a ser usada para o sandbox
### Rede
- `use_host_network`
- Tipo: `bool`
- Padrão: `false`
- Descrição: Usar a rede do host
- `runtime_binding_address`
- Tipo: `str`
- Padrão: `0.0.0.0`
- Descrição: O endereço de ligação para as portas de tempo de execução. Especifica em qual interface de rede na máquina host o Docker deve ligar as portas de tempo de execução.
### Linting e Plugins
- `enable_auto_lint`
- Tipo: `bool`
- Padrão: `false`
- Descrição: Habilitar linting automático após a edição
- `initialize_plugins`
- Tipo: `bool`
- Padrão: `true`
- Descrição: Se deve inicializar plugins
### Dependências e Ambiente
- `runtime_extra_deps`
- Tipo: `str`
- Padrão: `""`
- Descrição: Dependências extras a serem instaladas na imagem de tempo de execução
- `runtime_startup_env_vars`
- Tipo: `dict`
- Padrão: `{}`
- Descrição: Variáveis de ambiente a serem definidas no lançamento do tempo de execução
### Avaliação
- `browsergym_eval_env`
- Tipo: `str`
- Padrão: `""`
- Descrição: Ambiente BrowserGym a ser usado para avaliação
## Configuração de Segurança
As opções de configuração de segurança são definidas na seção `[security]` do arquivo `config.toml`.
Para usá-las com o comando docker, passe `-e SECURITY_<opção>`. Exemplo: `-e SECURITY_CONFIRMATION_MODE`.
### Modo de Confirmação
- `confirmation_mode`
- Tipo
@@ -0,0 +1,38 @@
# ✅ Fornecendo Feedback
Ao usar o OpenHands, você encontrará casos em que as coisas funcionam bem e outros em que não funcionam. Nós encorajamos você a fornecer feedback quando usar o OpenHands para ajudar a dar feedback para a equipe de desenvolvimento e, talvez mais importante, criar um corpus aberto de exemplos de treinamento de agentes de codificação -- Share-OpenHands!
## 📝 Como Fornecer Feedback
Fornecer feedback é fácil! Quando você estiver usando o OpenHands, você pode pressionar o botão de polegar para cima ou polegar para baixo a qualquer momento durante sua interação. Você será solicitado a fornecer seu endereço de e-mail (por exemplo, para que possamos entrar em contato com você se quisermos fazer alguma pergunta de acompanhamento), e você pode escolher se deseja fornecer feedback publicamente ou privadamente.
<iframe width="560" height="315" src="https://www.youtube.com/embed/5rFx-StMVV0?si=svo7xzp6LhGK_GXr" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
## 📜 Uso de Dados e Privacidade
### Configurações de compartilhamento de dados
Quando você envia dados, você pode enviá-los publicamente ou privadamente.
- Dados **públicos** serão distribuídos sob a Licença MIT, como o próprio OpenHands, e podem ser usados pela comunidade para treinar e testar modelos. Obviamente, o feedback que você pode tornar público será mais valioso para a comunidade como um todo, então quando você não estiver lidando com informações confidenciais, nós encorajamos você a escolher esta opção!
- Dados **privados** serão disponibilizados para a equipe do OpenHands com o propósito de melhorar o OpenHands. No entanto, um link com um ID único ainda será criado para que você possa compartilhar publicamente com outras pessoas.
### Quem coleta e armazena os dados?
Os dados são coletados e armazenados pela [All Hands AI](https://all-hands.dev), uma empresa fundada pelos mantenedores do OpenHands para apoiar e melhorar o OpenHands.
### Como os dados públicos serão divulgados?
Os dados públicos serão divulgados quando atingirmos marcos fixos, como 1.000 exemplos públicos, 10.000 exemplos públicos, etc. Neste momento, seguiremos o seguinte processo de divulgação:
1. Todas as pessoas que contribuíram com feedback público receberão um e-mail descrevendo a divulgação dos dados e terão a oportunidade de optar por não participar.
2. A pessoa ou pessoas responsáveis pela divulgação dos dados realizarão o controle de qualidade dos dados, removendo feedback de baixa qualidade, removendo endereços de e-mail dos remetentes e tentando remover quaisquer informações confidenciais.
3. Os dados serão divulgados publicamente sob a licença MIT por meio de sites comumente usados, como GitHub ou Hugging Face.
### E se eu quiser que meus dados sejam excluídos?
Para dados nos servidores da All Hands AI, teremos prazer em excluí-los mediante solicitação:
**Uma Parte dos Dados:** Se você deseja que uma parte dos dados seja excluída, em breve adicionaremos um mecanismo para excluir partes dos dados usando o link e a senha exibidos na interface quando você envia os dados.
**Todos os Dados:** Se você deseja que todas as partes de seus dados sejam excluídas, ou se você não possui o ID e a senha que recebeu ao enviar os dados, entre em contato com `contact@all-hands.dev` a partir do endereço de e-mail que você registrou quando enviou os dados originalmente.
@@ -0,0 +1,111 @@
# Começando com o OpenHands
Então você [executou o OpenHands](./installation) e
[configurou seu LLM](./installation#setup). E agora?
O OpenHands pode ajudá-lo a lidar com uma ampla variedade de tarefas de engenharia. Mas a tecnologia
ainda é nova, e estamos longe de ter agentes que possam assumir tarefas de engenharia grandes e complicadas
sem qualquer orientação. Portanto, é importante ter uma noção do que o agente
faz bem e onde ele pode precisar de alguma ajuda.
## Olá Mundo
A primeira coisa que você pode querer tentar é um exemplo simples de "olá mundo".
Isso pode ser mais complicado do que parece!
Tente solicitar ao agente:
> Por favor, escreva um script bash hello.sh que imprima "hello world!"
Você deve ver que o agente não apenas escreve o script, mas também define as permissões
corretas e executa o script para verificar a saída.
Você pode continuar solicitando ao agente para refinar seu código. Esta é uma ótima maneira de
trabalhar com agentes. Comece de forma simples e itere.
> Por favor, modifique hello.sh para que ele aceite um nome como o primeiro argumento, mas use "world" como padrão
Você também pode trabalhar em qualquer linguagem que precisar, embora o agente possa precisar de algum
tempo para configurar seu ambiente!
> Por favor, converta hello.sh para um script Ruby e execute-o
## Construindo do Zero
Os agentes se saem excepcionalmente bem em tarefas "greenfield" (tarefas em que eles não precisam
de nenhum contexto sobre uma base de código existente) e podem simplesmente começar do zero.
É melhor começar com uma tarefa simples e, em seguida, iterar sobre ela. Também é melhor ser
o mais específico possível sobre o que você deseja, qual deve ser a pilha de tecnologia, etc.
Por exemplo, podemos construir um aplicativo de lista de tarefas:
> Por favor, construa um aplicativo básico de lista de tarefas em React. Ele deve ser apenas frontend e todo o estado
> deve ser mantido no localStorage.
Podemos continuar iterando no aplicativo assim que o esqueleto estiver lá:
> Por favor, permita adicionar uma data de vencimento opcional para cada tarefa.
Assim como no desenvolvimento normal, é bom fazer commit e push do seu código com frequência.
Dessa forma, você sempre pode reverter para um estado antigo se o agente sair do caminho.
Você pode pedir ao agente para fazer commit e push para você:
> Por favor, faça commit das alterações e envie-as para uma nova branch chamada "feature/due-dates"
## Adicionando Novo Código
O OpenHands também pode fazer um ótimo trabalho adicionando novo código a uma base de código existente.
Por exemplo, você pode pedir ao OpenHands para adicionar uma nova ação do GitHub ao seu projeto
que faça lint do seu código. O OpenHands pode dar uma olhada na sua base de código para ver qual linguagem
ele deve usar e, em seguida, soltar um novo arquivo em `./github/workflows/lint.yml`.
> Por favor, adicione uma ação do GitHub que faça lint do código neste repositório.
Algumas tarefas podem exigir um pouco mais de contexto. Embora o OpenHands possa usar `ls` e `grep`
para pesquisar em sua base de código, fornecer contexto antecipadamente permite que ele se mova mais rápido
e com mais precisão. E isso custará menos tokens para você!
> Por favor, modifique ./backend/api/routes.js para adicionar uma nova rota que retorne uma lista de todas as tarefas.
> Por favor, adicione um novo componente React que exiba uma lista de Widgets no diretório ./frontend/components.
> Ele deve usar o componente Widget existente.
## Refatoração
O OpenHands é ótimo em refatorar código existente, especialmente em pequenos pedaços.
Você provavelmente não vai querer tentar rearquitetar toda a sua base de código, mas dividir
arquivos e funções longas, renomear variáveis, etc. tendem a funcionar muito bem.
> Por favor, renomeie todas as variáveis de uma letra em ./app.go.
> Por favor, divida a função `build_and_deploy_widgets` em duas funções, `build_widgets` e `deploy_widgets` em widget.php.
> Por favor, divida ./api/routes.js em arquivos separados para cada rota.
## Correções de Bugs
O OpenHands também pode ajudá-lo a rastrear e corrigir bugs em seu código. Mas como qualquer
desenvolvedor sabe, a correção de bugs pode ser extremamente complicada e, muitas vezes, o OpenHands precisará de mais contexto.
Ajuda se você diagnosticou o bug, mas quer que o OpenHands descubra a lógica.
> Atualmente, o campo de e-mail no endpoint `/subscribe` está rejeitando domínios .io. Por favor, corrija isso.
> A função `search_widgets` em ./app.py está fazendo uma pesquisa sensível a maiúsculas e minúsculas. Por favor, torne-a insensível a maiúsculas e minúsculas.
Muitas vezes, ajuda fazer o desenvolvimento orientado a testes ao corrigir bugs com um agente.
Você pode pedir ao agente para escrever um novo teste e, em seguida, iterar até que ele corrija o bug:
> A função `hello` trava na string vazia. Por favor, escreva um teste que reproduza esse bug e, em seguida, corrija o código para que ele passe.
## Mais
O OpenHands é capaz de ajudar em praticamente qualquer tarefa de codificação, mas é necessária alguma prática
para tirar o máximo proveito dele. Lembre-se de:
* Manter suas tarefas pequenas.
* Ser o mais específico possível.
* Fornecer o máximo de contexto possível.
* Fazer commit e push com frequência.
Veja [Melhores Práticas de Prompt](./prompting/prompting-best-practices) para mais dicas sobre como obter o máximo do OpenHands.
@@ -0,0 +1,96 @@
# Modo CLI
O OpenHands pode ser executado em um modo CLI interativo, que permite aos usuários iniciar uma sessão interativa via linha de comando.
Esse modo é diferente do [modo headless](headless-mode), que é não interativo e melhor para scripting.
## Com Python
Para iniciar uma sessão interativa do OpenHands via linha de comando:
1. Certifique-se de ter seguido as [instruções de configuração de desenvolvimento](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md).
2. Execute o seguinte comando:
```bash
poetry run python -m openhands.core.cli
```
Esse comando iniciará uma sessão interativa onde você pode inserir tarefas e receber respostas do OpenHands.
Você precisará definir seu modelo, chave de API e outras configurações via variáveis de ambiente
[ou o arquivo `config.toml`](https://github.com/All-Hands-AI/OpenHands/blob/main/config.template.toml).
## Com Docker
Para executar o OpenHands no modo CLI com Docker:
1. Defina as seguintes variáveis de ambiente no seu terminal:
- `WORKSPACE_BASE` para o diretório que você deseja que o OpenHands edite (Ex: `export WORKSPACE_BASE=$(pwd)/workspace`).
- `LLM_MODEL` para o modelo a ser usado (Ex: `export LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"`).
- `LLM_API_KEY` para a chave de API (Ex: `export LLM_API_KEY="sk_test_12345"`).
2. Execute o seguinte comando Docker:
```bash
docker run -it \
--pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik \
-e SANDBOX_USER_ID=$(id -u) \
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
-e LLM_API_KEY=$LLM_API_KEY \
-e LLM_MODEL=$LLM_MODEL \
-v $WORKSPACE_BASE:/opt/workspace_base \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ~/.openhands-state:/.openhands-state \
--add-host host.docker.internal:host-gateway \
--name openhands-app-$(date +%Y%m%d%H%M%S) \
docker.all-hands.dev/all-hands-ai/openhands:0.29 \
python -m openhands.core.cli
```
Esse comando iniciará uma sessão interativa no Docker onde você pode inserir tarefas e receber respostas do OpenHands.
## Exemplos de Comandos CLI e Saídas Esperadas
Aqui estão alguns exemplos de comandos CLI e suas saídas esperadas:
### Exemplo 1: Tarefa Simples
```bash
>> Escreva um script Python que imprima "Hello, World!"
```
Saída Esperada:
```bash
🤖 Claro! Aqui está um script Python que imprime "Hello, World!":
print("Hello, World!")
```
### Exemplo 2: Comando Bash
```bash
>> Crie um diretório chamado "test_dir"
```
Saída Esperada:
```bash
🤖 Criando um diretório chamado "test_dir":
mkdir test_dir
```
### Exemplo 3: Tratamento de Erro
```bash
>> Exclua um arquivo inexistente
```
Saída Esperada:
```bash
🤖 Ocorreu um erro. Por favor, tente novamente.
```
@@ -0,0 +1,97 @@
# Sandbox Personalizado
O sandbox é onde o agente realiza suas tarefas. Em vez de executar comandos diretamente no seu computador
(o que poderia ser arriscado), o agente os executa dentro de um contêiner Docker.
O sandbox padrão do OpenHands (`python-nodejs:python3.12-nodejs22`
do [nikolaik/python-nodejs](https://hub.docker.com/r/nikolaik/python-nodejs)) vem com alguns pacotes instalados, como
python e Node.js, mas pode precisar de outros softwares instalados por padrão.
Você tem duas opções para personalização:
- Usar uma imagem existente com o software necessário.
- Criar sua própria imagem personalizada do Docker.
Se você escolher a primeira opção, pode pular a seção `Crie Sua Imagem Docker`.
## Crie Sua Imagem Docker
Para criar uma imagem personalizada do Docker, ela deve ser baseada no Debian.
Por exemplo, se você quiser que o OpenHands tenha o `ruby` instalado, você pode criar um `Dockerfile` com o seguinte conteúdo:
```dockerfile
FROM nikolaik/python-nodejs:python3.12-nodejs22
# Instalar pacotes necessários
RUN apt-get update && apt-get install -y ruby
```
Ou você pode usar uma imagem base específica do Ruby:
```dockerfile
FROM ruby:latest
```
Salve este arquivo em uma pasta. Em seguida, construa sua imagem Docker (por exemplo, chamada custom-image) navegando até a pasta no
terminal e executando:
```bash
docker build -t custom-image .
```
Isso produzirá uma nova imagem chamada `custom-image`, que estará disponível no Docker.
## Usando o Comando Docker
Ao executar o OpenHands usando [o comando docker](/modules/usage/installation#start-the-app), substitua
`-e SANDBOX_RUNTIME_CONTAINER_IMAGE=...` por `-e SANDBOX_BASE_CONTAINER_IMAGE=<nome da imagem personalizada>`:
```commandline
docker run -it --rm --pull=always \
-e SANDBOX_BASE_CONTAINER_IMAGE=custom-image \
...
```
## Usando o Fluxo de Trabalho de Desenvolvimento
### Configuração
Primeiro, certifique-se de que você pode executar o OpenHands seguindo as instruções em [Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md).
### Especifique a Imagem Base do Sandbox
No arquivo `config.toml` dentro do diretório OpenHands, defina `base_container_image` como a imagem que você deseja usar.
Isso pode ser uma imagem que você já baixou ou uma que você construiu:
```bash
[core]
...
[sandbox]
base_container_image="custom-image"
```
### Opções de Configuração Adicionais
O arquivo `config.toml` suporta várias outras opções para personalizar seu sandbox:
```toml
[core]
# Instalar dependências adicionais quando o runtime for construído
# Pode conter quaisquer comandos shell válidos
# Se você precisar do caminho para o interpretador Python em qualquer um desses comandos, pode usar a variável $OH_INTERPRETER_PATH
runtime_extra_deps = """
pip install numpy pandas
apt-get update && apt-get install -y ffmpeg
"""
# Definir variáveis de ambiente para o runtime
# Útil para configuração que precisa estar disponível em tempo de execução
runtime_startup_env_vars = { DATABASE_URL = "postgresql://user:pass@localhost/db" }
# Especificar a plataforma para builds de várias arquiteturas (por exemplo, "linux/amd64" ou "linux/arm64")
platform = "linux/amd64"
```
### Executar
Execute o OpenHands executando ```make run``` no diretório de nível superior.
@@ -0,0 +1,71 @@
# Debugging
The following is intended as a primer on debugging OpenHands for Development purposes.
## Server / VSCode
The following `launch.json` will allow debugging the agent, controller and server elements, but not the sandbox (Which runs inside docker). It will ignore any changes inside the `workspace/` directory:
```
{
"version": "0.2.0",
"configurations": [
{
"name": "OpenHands CLI",
"type": "debugpy",
"request": "launch",
"module": "openhands.core.cli",
"justMyCode": false
},
{
"name": "OpenHands WebApp",
"type": "debugpy",
"request": "launch",
"module": "uvicorn",
"args": [
"openhands.server.listen:app",
"--reload",
"--reload-exclude",
"${workspaceFolder}/workspace",
"--port",
"3000"
],
"justMyCode": false
}
]
}
```
More specific debugging configurations which include more parameters may be specified:
```
...
{
"name": "Debug CodeAct",
"type": "debugpy",
"request": "launch",
"module": "openhands.core.main",
"args": [
"-t",
"Ask me what your task is.",
"-d",
"${workspaceFolder}/workspace",
"-c",
"CodeActAgent",
"-l",
"llm.o1",
"-n",
"prompts"
],
"justMyCode": false
}
...
```
Values in the snippet above can be updated such that:
* *t*: the task
* *d*: the openhands workspace directory
* *c*: the agent
* *l*: the LLM config (pre-defined in config.toml)
* *n*: session name (e.g. eventstream name)
@@ -0,0 +1,74 @@
---
sidebar_position: 9
---
# Visão Geral do Desenvolvimento
Este guia fornece uma visão geral dos principais recursos de documentação disponíveis no repositório OpenHands. Se você está procurando contribuir, entender a arquitetura ou trabalhar em componentes específicos, esses recursos irão ajudá-lo a navegar pelo codebase de forma eficaz.
## Documentação Principal
### Fundamentos do Projeto
- **Visão Geral do Projeto Principal** (`/README.md`)
O ponto de entrada principal para entender o OpenHands, incluindo recursos e instruções básicas de configuração.
- **Guia de Desenvolvimento** (`/Development.md`)
Guia abrangente para desenvolvedores que trabalham no OpenHands, incluindo configuração, requisitos e fluxos de trabalho de desenvolvimento.
- **Diretrizes de Contribuição** (`/CONTRIBUTING.md`)
Informações essenciais para contribuidores, abrangendo estilo de código, processo de PR e fluxos de trabalho de contribuição.
### Documentação de Componentes
#### Frontend
- **Aplicação Frontend** (`/frontend/README.md`)
Guia completo para configurar e desenvolver a aplicação frontend baseada em React.
#### Backend
- **Implementação do Backend** (`/openhands/README.md`)
Documentação detalhada da implementação e arquitetura do backend em Python.
- **Documentação do Servidor** (`/openhands/server/README.md`)
Detalhes de implementação do servidor, documentação da API e arquitetura de serviços.
- **Ambiente de Execução** (`/openhands/runtime/README.md`)
Documentação abrangendo o ambiente de execução, modelo de execução e configurações de tempo de execução.
#### Infraestrutura
- **Documentação de Contêineres** (`/containers/README.md`)
Informações abrangentes sobre contêineres Docker, estratégias de implantação e gerenciamento de contêineres.
### Testes e Avaliação
- **Guia de Testes Unitários** (`/tests/unit/README.md`)
Instruções para escrever, executar e manter testes unitários.
- **Framework de Avaliação** (`/evaluation/README.md`)
Documentação para o framework de avaliação, benchmarks e testes de desempenho.
### Recursos Avançados
- **Arquitetura de Microagentes** (`/microagents/README.md`)
Informações detalhadas sobre a arquitetura, implementação e uso de microagentes.
### Padrões de Documentação
- **Guia de Estilo de Documentação** (`/docs/DOC_STYLE_GUIDE.md`)
Padrões e diretrizes para escrever e manter a documentação do projeto.
## Começando com o Desenvolvimento
Se você é novo no desenvolvimento com OpenHands, recomendamos seguir esta sequência:
1. Comece com o `README.md` principal para entender o propósito e os recursos do projeto
2. Revise as diretrizes em `CONTRIBUTING.md` se você planeja contribuir
3. Siga as instruções de configuração em `Development.md`
4. Mergulhe na documentação de componentes específicos com base na sua área de interesse:
- Desenvolvedores frontend devem se concentrar em `/frontend/README.md`
- Desenvolvedores backend devem começar com `/openhands/README.md`
- O trabalho de infraestrutura deve começar com `/containers/README.md`
## Atualizações da Documentação
Ao fazer alterações no codebase, certifique-se de que:
1. A documentação relevante seja atualizada para refletir suas alterações
2. Novos recursos sejam documentados nos arquivos README apropriados
3. Quaisquer alterações na API sejam refletidas na documentação do servidor
4. A documentação siga o guia de estilo em `/docs/DOC_STYLE_GUIDE.md`
@@ -0,0 +1,278 @@
# Avaliação
Este guia fornece uma visão geral de como integrar seu próprio benchmark de avaliação ao framework OpenHands.
## Configurar Ambiente e Configuração do LLM
Por favor, siga as instruções [aqui](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md) para configurar seu ambiente de desenvolvimento local.
O OpenHands no modo de desenvolvimento usa `config.toml` para manter o controle da maioria das configurações.
Aqui está um exemplo de arquivo de configuração que você pode usar para definir e usar múltiplos LLMs:
```toml
[llm]
# IMPORTANTE: adicione sua chave de API aqui e defina o modelo para o que você deseja avaliar
model = "claude-3-5-sonnet-20241022"
api_key = "sk-XXX"
[llm.eval_gpt4_1106_preview_llm]
model = "gpt-4-1106-preview"
api_key = "XXX"
temperature = 0.0
[llm.eval_some_openai_compatible_model_llm]
model = "openai/MODEL_NAME"
base_url = "https://OPENAI_COMPATIBLE_URL/v1"
api_key = "XXX"
temperature = 0.0
```
## Como usar o OpenHands na linha de comando
O OpenHands pode ser executado a partir da linha de comando usando o seguinte formato:
```bash
poetry run python ./openhands/core/main.py \
-i <max_iterations> \
-t "<task_description>" \
-c <agent_class> \
-l <llm_config>
```
Por exemplo:
```bash
poetry run python ./openhands/core/main.py \
-i 10 \
-t "Write me a bash script that prints hello world." \
-c CodeActAgent \
-l llm
```
Este comando executa o OpenHands com:
- Um máximo de 10 iterações
- A descrição da tarefa especificada
- Usando o CodeActAgent
- Com a configuração do LLM definida na seção `llm` do seu arquivo `config.toml`
## Como o OpenHands funciona
O ponto de entrada principal para o OpenHands está em `openhands/core/main.py`. Aqui está um fluxo simplificado de como ele funciona:
1. Analisa os argumentos da linha de comando e carrega a configuração
2. Cria um ambiente de execução usando `create_runtime()`
3. Inicializa o agente especificado
4. Executa o controlador usando `run_controller()`, que:
- Anexa o ambiente de execução ao agente
- Executa a tarefa do agente
- Retorna um estado final quando concluído
A função `run_controller()` é o núcleo da execução do OpenHands. Ela gerencia a interação entre o agente, o ambiente de execução e a tarefa, lidando com coisas como simulação de entrada do usuário e processamento de eventos.
## Maneira mais fácil de começar: Explorando Benchmarks Existentes
Encorajamos você a revisar os vários benchmarks de avaliação disponíveis no [diretório `evaluation/benchmarks/`](https://github.com/All-Hands-AI/OpenHands/blob/main/evaluation/benchmarks) do nosso repositório.
Para integrar seu próprio benchmark, sugerimos começar com aquele que mais se assemelha às suas necessidades. Essa abordagem pode simplificar significativamente seu processo de integração, permitindo que você construa sobre estruturas existentes e as adapte aos seus requisitos específicos.
## Como criar um fluxo de trabalho de avaliação
Para criar um fluxo de trabalho de avaliação para o seu benchmark, siga estas etapas:
1. Importe as utilidades relevantes do OpenHands:
```python
import openhands.agenthub
from evaluation.utils.shared import (
EvalMetadata,
EvalOutput,
make_metadata,
prepare_dataset,
reset_logger_for_multiprocessing,
run_evaluation,
)
from openhands.controller.state.state import State
from openhands.core.config import (
AppConfig,
SandboxConfig,
get_llm_config_arg,
parse_arguments,
)
from openhands.core.logger import openhands_logger as logger
from openhands.core.main import create_runtime, run_controller
from openhands.events.action import CmdRunAction
from openhands.events.observation import CmdOutputObservation, ErrorObservation
from openhands.runtime.runtime import Runtime
```
2. Crie uma configuração:
```python
def get_config(instance: pd.Series, metadata: EvalMetadata) -> AppConfig:
config = AppConfig(
default_agent=metadata.agent_class,
runtime='docker',
max_iterations=metadata.max_iterations,
sandbox=SandboxConfig(
base_container_image='your_container_image',
enable_auto_lint=True,
timeout=300,
),
)
config.set_llm_config(metadata.llm_config)
return config
```
3. Inicialize o ambiente de execução e configure o ambiente de avaliação:
```python
def initialize_runtime(runtime: Runtime, instance: pd.Series):
# Configure seu ambiente de avaliação aqui
# Por exemplo, definindo variáveis de ambiente, preparando arquivos, etc.
pass
```
4. Crie uma função para processar cada instância:
```python
from openhands.utils.async_utils import call_async_from_sync
def process_instance(instance: pd.Series, metadata: EvalMetadata) -> EvalOutput:
config = get_config(instance, metadata)
runtime = create_runtime(config)
call_async_from_sync(runtime.connect)
initialize_runtime(runtime, instance)
instruction = get_instruction(instance, metadata)
state = run_controller(
config=config,
task_str=instruction,
runtime=runtime,
fake_user_response_fn=your_user_response_function,
)
# Avalie as ações do agente
evaluation_result = await evaluate_agent_actions(runtime, instance)
return EvalOutput(
instance_id=instance.instance_id,
instruction=instruction,
test_result=evaluation_result,
metadata=metadata,
history=compatibility_for_eval_history_pairs(state.history),
metrics=state.metrics.get() if state.metrics else None,
error=state.last_error if state and state.last_error else None,
)
```
5. Execute a avaliação:
```python
metadata = make_metadata(llm_config, dataset_name, agent_class, max_iterations, eval_note, eval_output_dir)
output_file = os.path.join(metadata.eval_output_dir, 'output.jsonl')
instances = prepare_dataset(your_dataset, output_file, eval_n_limit)
await run_evaluation(
instances,
metadata,
output_file,
num_workers,
process_instance
)
```
Este fluxo de trabalho configura a configuração, inicializa o ambiente de execução, processa cada instância executando o agente e avaliando suas ações e, em seguida, coleta os resultados em um objeto `EvalOutput`. A função `run_evaluation` lida com a paralelização e o rastreamento do progresso.
Lembre-se de personalizar as funções `get_instruction`, `your_user_response_function` e `evaluate_agent_actions` de acordo com os requisitos específicos do seu benchmark.
Ao seguir essa estrutura, você pode criar um fluxo de trabalho de avaliação robusto para o seu benchmark dentro do framework OpenHands.
## Entendendo a `user_response_fn`
A `user_response_fn` é um componente crucial no fluxo de trabalho de avaliação do OpenHands. Ela simula a interação do usuário com o agente, permitindo respostas automatizadas durante o processo de avaliação. Essa função é particularmente útil quando você deseja fornecer respostas consistentes e predefinidas às consultas ou ações do agente.
### Fluxo de Trabalho e Interação
O fluxo de trabalho correto para lidar com ações e a `user_response_fn` é o seguinte:
1. O agente recebe uma tarefa e começa a processar
2. O agente emite uma Ação
3. Se a Ação for executável (por exemplo, CmdRunAction, IPythonRunCellAction):
- O Runtime processa a Ação
- O Runtime retorna uma Observação
4. Se a Ação não for executável (normalmente uma MessageAction):
- A `user_response_fn` é chamada
- Ela retorna uma resposta simulada do usuário
5. O agente recebe a Observação ou a resposta simulada
6. As etapas 2-5 se repetem até que a tarefa seja concluída ou o número máximo de iterações seja atingido
Aqui está uma representação visual mais precisa:
```
[Agente]
|
v
[Emitir Ação]
|
v
[A Ação é Executável?]
/ \
Sim Não
| |
v v
[Runtime] [user_response_fn]
| |
v v
[Retornar Observação] [Resposta Simulada]
\ /
\ /
v v
[Agente recebe feedback]
|
v
[Continuar ou Concluir Tarefa]
```
Neste fluxo de trabalho:
- Ações executáveis (como executar comandos ou código) são tratadas diretamente pelo Runtime
- Ações não executáveis (normalmente quando o agente deseja se comunicar ou pedir esclarecimentos) são tratadas pela `user_response_fn`
- O agente então processa o feedback, seja uma Observação do Runtime ou uma resposta simulada da `user_response_fn`
Essa abordagem permite o tratamento automatizado de ações concretas e interações simuladas do usuário, tornando-a adequada para cenários de avaliação em que você deseja testar a capacidade do agente de concluir tarefas com intervenção humana mínima.
### Exemplo de Implementação
Aqui está um exemplo de uma `user_response_fn` usada na avaliação SWE-Bench:
```python
def codeact_user_response(state: State | None) -> str:
msg = (
'Please continue working on the task on whatever approach you think is suitable.\n'
'If you think you have solved the task, please first send your answer to user through message and then <execute_bash> exit </execute_bash>.\n'
'IMPORTANT: YOU SHOULD NEVER ASK FOR HUMAN HELP.\n'
)
if state and state.history:
# check if the agent has tried to talk to the user 3 times, if so, let the agent know it can give up
user_msgs = [
event
for event in state.history
if isinstance(event, MessageAction) and event.source == 'user'
]
if len(user_msgs) >= 2:
# let the agent know that it can give up when it has tried 3 times
return (
msg
+ 'If you want to give up, run: <execute_bash> exit </execute_bash>.\n'
)
return msg
```
Esta função faz o seguinte:
1. Fornece uma mensagem padrão encorajando o agente a continuar trabalhando
2. Verifica quantas vezes o agente tentou se comunicar com o usuário
3. Se o agente fez várias tentativas, fornece uma opção para desistir
Ao usar essa função, você pode garantir um comportamento consistente em várias execuções de avaliação e evitar que o agente fique preso esperando a entrada do usuário.
@@ -0,0 +1,50 @@
# Usando a Ação do GitHub OpenHands
Este guia explica como usar a Ação do GitHub OpenHands, tanto dentro do repositório OpenHands quanto em seus próprios projetos.
## Usando a Ação no Repositório OpenHands
Para usar a Ação do GitHub OpenHands em um repositório, você pode:
1. Criar uma issue no repositório.
2. Adicionar a etiqueta `fix-me` à issue ou deixar um comentário na issue começando com `@openhands-agent`.
A ação será acionada automaticamente e tentará resolver a issue.
## Instalando a Ação em um Novo Repositório
Para instalar a Ação do GitHub OpenHands em seu próprio repositório, siga o [README para o OpenHands Resolver](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/resolver/README.md).
## Dicas de Uso
### Resolução Iterativa
1. Crie uma issue no repositório.
2. Adicione a etiqueta `fix-me` à issue ou deixe um comentário começando com `@openhands-agent`.
3. Revise a tentativa de resolver a issue verificando o pull request.
4. Faça um acompanhamento com feedback por meio de comentários gerais, comentários de revisão ou comentários de thread inline.
5. Adicione a etiqueta `fix-me` ao pull request ou aborde um comentário específico começando com `@openhands-agent`.
### Etiqueta versus Macro
- Etiqueta (`fix-me`): Solicita ao OpenHands que aborde a issue ou pull request **inteiro**.
- Macro (`@openhands-agent`): Solicita ao OpenHands que considere apenas a descrição da issue/pull request e **o comentário específico**.
## Configurações Avançadas
### Adicionar configurações personalizadas do repositório
Você pode fornecer instruções personalizadas para o OpenHands seguindo o [README para o resolver](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/resolver/README.md#providing-custom-instructions).
### Configurações personalizadas
O GitHub resolver verificará automaticamente se há [segredos do repositório](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions?tool=webui#creating-secrets-for-a-repository) ou [variáveis do repositório](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#creating-configuration-variables-for-a-repository) válidos para personalizar seu comportamento.
As opções de personalização que você pode definir são:
| **Nome do atributo** | **Tipo** | **Finalidade** | **Exemplo** |
| -------------------------------- | -------- | --------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| `LLM_MODEL` | Variável | Definir o LLM a ser usado com o OpenHands | `LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"` |
| `OPENHANDS_MAX_ITER` | Variável | Definir o limite máximo de iterações do agente | `OPENHANDS_MAX_ITER=10` |
| `OPENHANDS_MACRO` | Variável | Personalizar a macro padrão para invocar o resolver | `OPENHANDS_MACRO=@resolveit` |
| `OPENHANDS_BASE_CONTAINER_IMAGE` | Variável | Sandbox personalizado ([saiba mais](https://docs.all-hands.dev/modules/usage/how-to/custom-sandbox-guide)) | `OPENHANDS_BASE_CONTAINER_IMAGE="custom_image"` |
| `TARGET_BRANCH` | Variável | Mesclar em um branch diferente de `main` | `TARGET_BRANCH="dev"` |
@@ -0,0 +1,118 @@
# Modo GUI
O OpenHands fornece um modo de Interface Gráfica do Usuário (GUI) para interagir com o assistente de IA.
## Instalação e Configuração
1. Siga as instruções de instalação para instalar o OpenHands.
2. Após executar o comando, acesse o OpenHands em [http://localhost:3000](http://localhost:3000).
## Interagindo com a GUI
### Configuração Inicial
1. No primeiro lançamento, você verá uma página de configurações.
2. Selecione um `Provedor de LLM` e um `Modelo de LLM` nos menus suspensos. Se o modelo necessário não existir na lista,
ative as opções `Avançadas` e insira-o com o prefixo correto na caixa de texto `Modelo Personalizado`.
3. Insira a `Chave de API` correspondente para o provedor escolhido.
4. Clique em `Salvar Alterações` para aplicar as configurações.
### Configuração do Token do GitHub
O OpenHands exporta automaticamente um `GITHUB_TOKEN` para o ambiente shell se ele estiver disponível. Isso pode acontecer de duas maneiras:
**Instalação Local**: O usuário insere diretamente seu token do GitHub.
<details>
<summary>Configurando um Token do GitHub</summary>
1. **Gere um Personal Access Token (PAT)**:
- No GitHub, vá para Settings > Developer Settings > Personal Access Tokens > Tokens (classic).
- **New token (classic)**
- Escopos necessários:
- `repo` (Controle total de repositórios privados)
- **Fine-Grained Tokens**
- All Repositories (Você pode selecionar repositórios específicos, mas isso afetará o que retorna na pesquisa de repositórios)
- Minimal Permissions (Selecione **Meta Data = Read-only** para pesquisa, **Pull Requests = Read and Write**, **Content = Read and Write** para criação de branches)
2. **Insira o Token no OpenHands**:
- Clique no botão Settings (ícone de engrenagem).
- Navegue até a seção `GitHub Settings`.
- Cole seu token no campo `GitHub Token`.
- Clique em `Save Changes` para aplicar as alterações.
</details>
<details>
<summary>Políticas de Token Organizacional</summary>
Se você estiver trabalhando com repositórios organizacionais, configurações adicionais podem ser necessárias:
1. **Verifique os Requisitos da Organização**:
- Os administradores da organização podem impor políticas específicas de token.
- Algumas organizações exigem que os tokens sejam criados com SSO habilitado.
- Revise as [configurações de política de token](https://docs.github.com/en/organizations/managing-programmatic-access-to-your-organization/setting-a-personal-access-token-policy-for-your-organization) da sua organização.
2. **Verifique o Acesso à Organização**:
- Vá para as configurações do seu token no GitHub.
- Procure a organização em `Organization access`.
- Se necessário, clique em `Enable SSO` ao lado da sua organização.
- Conclua o processo de autorização SSO.
</details>
<details>
<summary>Solução de Problemas</summary>
Problemas comuns e soluções:
- **Token Não Reconhecido**:
- Certifique-se de que o token esteja salvo corretamente nas configurações.
- Verifique se o token não expirou.
- Verifique se o token possui os escopos necessários.
- Tente regenerar o token.
- **Acesso à Organização Negado**:
- Verifique se o SSO é necessário, mas não está habilitado.
- Verifique a associação à organização.
- Entre em contato com o administrador da organização se as políticas de token estiverem bloqueando o acesso.
- **Verificando se o Token Funciona**:
- O aplicativo mostrará uma marca de seleção verde se o token for válido.
- Tente acessar um repositório para confirmar as permissões.
- Verifique o console do navegador em busca de mensagens de erro.
</details>
**OpenHands Cloud**: O token é obtido por meio da autenticação OAuth do GitHub.
<details>
<summary>Autenticação OAuth</summary>
Ao usar o OpenHands Cloud, o fluxo OAuth do GitHub solicita as seguintes permissões:
- Acesso ao repositório (leitura/escrita)
- Gerenciamento de fluxo de trabalho
- Acesso de leitura à organização
Para autenticar o OpenHands:
- Clique em `Sign in with GitHub` quando solicitado.
- Revise as permissões solicitadas.
- Autorize o OpenHands a acessar sua conta do GitHub.
- Se estiver usando uma organização, autorize o acesso à organização se solicitado.
</details>
### Configurações Avançadas
1. Dentro da página Settings, ative as opções `Advanced` para acessar configurações adicionais.
2. Use a caixa de texto `Custom Model` para inserir manualmente um modelo se ele não estiver na lista.
3. Especifique uma `Base URL` se necessário para o seu provedor de LLM.
### Interagindo com a IA
1. Digite seu prompt na caixa de entrada.
2. Clique no botão de envio ou pressione Enter para enviar sua mensagem.
3. A IA processará sua entrada e fornecerá uma resposta na janela de chat.
4. Você pode continuar a conversa fazendo perguntas de acompanhamento ou fornecendo informações adicionais.
## Dicas para Uso Eficaz
- Seja específico em suas solicitações para obter as respostas mais precisas e úteis, conforme descrito nas [melhores práticas de prompting](../prompting/prompting-best-practices).
- Use o painel de workspace para explorar a estrutura do seu projeto.
- Use um dos modelos recomendados, conforme descrito na seção [LLMs](usage/llms/llms.md).
Lembre-se, o modo GUI do OpenHands é projetado para tornar sua interação com o assistente de IA o mais suave e intuitiva
possível. Não hesite em explorar seus recursos para maximizar sua produtividade.
@@ -0,0 +1,56 @@
# Modo Headless
Você pode executar o OpenHands com um único comando, sem iniciar a aplicação web.
Isso facilita a escrita de scripts e a automação de tarefas com o OpenHands.
Isso é diferente do [Modo CLI](cli-mode), que é interativo e melhor para desenvolvimento ativo.
## Com Python
Para executar o OpenHands no modo headless com Python:
1. Certifique-se de ter seguido as [instruções de configuração de desenvolvimento](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md).
2. Execute o seguinte comando:
```bash
poetry run python -m openhands.core.main -t "escreva um script bash que imprima oi"
```
Você precisará definir seu modelo, chave de API e outras configurações por meio de variáveis de ambiente
[ou do arquivo `config.toml`](https://github.com/All-Hands-AI/OpenHands/blob/main/config.template.toml).
## Com Docker
Para executar o OpenHands no modo Headless com Docker:
1. Defina as seguintes variáveis de ambiente no seu terminal:
- `WORKSPACE_BASE` para o diretório que você deseja que o OpenHands edite (Ex: `export WORKSPACE_BASE=$(pwd)/workspace`).
- `LLM_MODEL` para o modelo a ser usado (Ex: `export LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"`).
- `LLM_API_KEY` para a chave de API (Ex: `export LLM_API_KEY="sk_test_12345"`).
2. Execute o seguinte comando Docker:
```bash
docker run -it \
--pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik \
-e SANDBOX_USER_ID=$(id -u) \
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
-e LLM_API_KEY=$LLM_API_KEY \
-e LLM_MODEL=$LLM_MODEL \
-e LOG_ALL_EVENTS=true \
-v $WORKSPACE_BASE:/opt/workspace_base \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ~/.openhands-state:/.openhands-state \
--add-host host.docker.internal:host-gateway \
--name openhands-app-$(date +%Y%m%d%H%M%S) \
docker.all-hands.dev/all-hands-ai/openhands:0.29 \
python -m openhands.core.main -t "escreva um script bash que imprima oi"
```
## Configurações Avançadas do Headless
Para visualizar todas as opções de configuração disponíveis para o modo headless, execute o comando Python com a flag `--help`.
### Logs Adicionais
Para que o modo headless registre todas as ações do agente, execute no terminal: `export LOG_ALL_EVENTS=true`
@@ -0,0 +1,104 @@
# Executando o OpenHands
## Requisitos do Sistema
- MacOS com [suporte ao Docker Desktop](https://docs.docker.com/desktop/setup/install/mac-install/#system-requirements)
- Linux
- Windows com [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) e [suporte ao Docker Desktop](https://docs.docker.com/desktop/setup/install/windows-install/#system-requirements)
É recomendado um sistema com um processador moderno e um mínimo de **4GB de RAM** para executar o OpenHands.
## Pré-requisitos
<details>
<summary>MacOS</summary>
**Docker Desktop**
1. [Instale o Docker Desktop no Mac](https://docs.docker.com/desktop/setup/install/mac-install).
2. Abra o Docker Desktop, vá em `Settings > Advanced` e certifique-se de que `Allow the default Docker socket to be used` esteja habilitado.
</details>
<details>
<summary>Linux</summary>
:::note
Testado com Ubuntu 22.04.
:::
**Docker Desktop**
1. [Instale o Docker Desktop no Linux](https://docs.docker.com/desktop/setup/install/linux/).
</details>
<details>
<summary>Windows</summary>
**WSL**
1. [Instale o WSL](https://learn.microsoft.com/en-us/windows/wsl/install).
2. Execute `wsl --version` no powershell e confirme `Default Version: 2`.
**Docker Desktop**
1. [Instale o Docker Desktop no Windows](https://docs.docker.com/desktop/setup/install/windows-install).
2. Abra o Docker Desktop, vá em `Settings` e confirme o seguinte:
- General: `Use the WSL 2 based engine` está habilitado.
- Resources > WSL Integration: `Enable integration with my default WSL distro` está habilitado.
:::note
O comando docker abaixo para iniciar o aplicativo deve ser executado dentro do terminal WSL.
:::
</details>
## Inicie o Aplicativo
A maneira mais fácil de executar o OpenHands é no Docker.
```bash
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik
docker run -it --rm --pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.29-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.29
```
Você encontrará o OpenHands em execução em http://localhost:3000!
Você também pode [conectar o OpenHands ao seu sistema de arquivos local](https://docs.all-hands.dev/modules/usage/runtimes#connecting-to-your-filesystem),
executar o OpenHands em um [modo headless programável](https://docs.all-hands.dev/modules/usage/how-to/headless-mode),
interagir com ele através de uma [CLI amigável](https://docs.all-hands.dev/modules/usage/how-to/cli-mode),
ou executá-lo em issues marcadas com [uma ação do GitHub](https://docs.all-hands.dev/modules/usage/how-to/github-action).
## Configuração
Ao iniciar o OpenHands, você verá uma página de Configurações. Você **deve** selecionar um `LLM Provider` e `LLM Model` e inserir uma `API Key` correspondente.
Estes podem ser alterados a qualquer momento selecionando o botão `Settings` (ícone de engrenagem) na interface do usuário.
Se o modelo necessário não existir na lista, você pode ativar as opções `Advanced` e inseri-lo manualmente com o prefixo correto
na caixa de texto `Custom Model`.
As opções `Advanced` também permitem que você especifique uma `Base URL`, se necessário.
Agora você está pronto para [começar com o OpenHands](./getting-started).
## Versões
O [comando docker acima](./installation#start-the-app) baixa a versão estável mais recente do OpenHands. Você também tem outras opções:
- Para uma versão específica, substitua $VERSION em `openhands:$VERSION` e `runtime:$VERSION`, com o número da versão.
Usamos SemVer, então `0.9` apontará automaticamente para a versão mais recente `0.9.x`, e `0` apontará para a versão mais recente `0.x.x`.
- Para a versão de desenvolvimento mais atualizada, substitua $VERSION em `openhands:$VERSION` e `runtime:$VERSION`, por `main`.
Esta versão é instável e é recomendada apenas para fins de teste ou desenvolvimento.
Você pode escolher a tag que melhor se adapta às suas necessidades com base nos requisitos de estabilidade e recursos desejados.
Para o fluxo de trabalho de desenvolvimento, consulte [Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md).
Está tendo problemas? Confira nosso [Guia de Solução de Problemas](https://docs.all-hands.dev/modules/usage/troubleshooting).
@@ -0,0 +1,41 @@
# Azure
O OpenHands usa o LiteLLM para fazer chamadas para os modelos de chat do Azure. Você pode encontrar a documentação sobre como usar o Azure como provedor [aqui](https://docs.litellm.ai/docs/providers/azure).
## Configuração do Azure OpenAI
Ao executar o OpenHands, você precisará definir a seguinte variável de ambiente usando `-e` no
[comando docker run](../installation#running-openhands):
```
LLM_API_VERSION="<api-version>" # por exemplo, "2023-05-15"
```
Exemplo:
```bash
docker run -it --pull=always \
-e LLM_API_VERSION="2023-05-15"
...
```
Então, nas configurações da interface do usuário do OpenHands:
:::note
Você precisará do nome da sua implantação do ChatGPT, que pode ser encontrado na página de implantações no Azure. Isso é referenciado como
&lt;deployment-name&gt; abaixo.
:::
1. Habilite as opções `Advanced`
2. Defina o seguinte:
- `Custom Model` para azure/&lt;deployment-name&gt;
- `Base URL` para a URL base da sua API do Azure (por exemplo, `https://example-endpoint.openai.azure.com`)
- `API Key` para a sua chave de API do Azure
### Configuração do Azure OpenAI
Ao executar o OpenHands, defina a seguinte variável de ambiente usando `-e` no
[comando docker run](../installation#running-openhands):
```
LLM_API_VERSION="<api-version>" # por exemplo, "2024-02-15-preview"
```
@@ -0,0 +1,136 @@
# Configurações Personalizadas de LLM
O OpenHands suporta a definição de múltiplas configurações nomeadas de LLM no seu arquivo `config.toml`. Este recurso permite que você use diferentes configurações de LLM para diferentes propósitos, como usar um modelo mais barato para tarefas que não exigem respostas de alta qualidade, ou usar diferentes modelos com diferentes parâmetros para agentes específicos.
## Como Funciona
As configurações nomeadas de LLM são definidas no arquivo `config.toml` usando seções que começam com `llm.`. Por exemplo:
```toml
# Configuração padrão de LLM
[llm]
model = "gpt-4"
api_key = "your-api-key"
temperature = 0.0
# Configuração personalizada de LLM para um modelo mais barato
[llm.gpt3]
model = "gpt-3.5-turbo"
api_key = "your-api-key"
temperature = 0.2
# Outra configuração personalizada com parâmetros diferentes
[llm.high-creativity]
model = "gpt-4"
api_key = "your-api-key"
temperature = 0.8
top_p = 0.9
```
Cada configuração nomeada herda todas as configurações da seção padrão `[llm]` e pode sobrescrever qualquer uma dessas configurações. Você pode definir quantas configurações personalizadas forem necessárias.
## Usando Configurações Personalizadas
### Com Agentes
Você pode especificar qual configuração de LLM um agente deve usar definindo o parâmetro `llm_config` na seção de configuração do agente:
```toml
[agent.RepoExplorerAgent]
# Usa a configuração mais barata do GPT-3 para este agente
llm_config = 'gpt3'
[agent.CodeWriterAgent]
# Usa a configuração de alta criatividade para este agente
llm_config = 'high-creativity'
```
### Opções de Configuração
Cada configuração nomeada de LLM suporta todas as mesmas opções que a configuração padrão de LLM. Isso inclui:
- Seleção de modelo (`model`)
- Configuração da API (`api_key`, `base_url`, etc.)
- Parâmetros do modelo (`temperature`, `top_p`, etc.)
- Configurações de repetição (`num_retries`, `retry_multiplier`, etc.)
- Limites de tokens (`max_input_tokens`, `max_output_tokens`)
- E todas as outras opções de configuração de LLM
Para uma lista completa das opções disponíveis, consulte a seção Configuração de LLM na documentação de [Opções de Configuração](../configuration-options).
## Casos de Uso
As configurações personalizadas de LLM são particularmente úteis em vários cenários:
- **Otimização de Custos**: Use modelos mais baratos para tarefas que não exigem respostas de alta qualidade, como exploração de repositório ou operações simples de arquivos.
- **Ajuste Específico de Tarefas**: Configure diferentes valores de temperature e top_p para tarefas que exigem diferentes níveis de criatividade ou determinismo.
- **Diferentes Provedores**: Use diferentes provedores de LLM ou endpoints de API para diferentes tarefas.
- **Testes e Desenvolvimento**: Alterne facilmente entre diferentes configurações de modelo durante o desenvolvimento e testes.
## Exemplo: Otimização de Custos
Um exemplo prático de uso de configurações personalizadas de LLM para otimizar custos:
```toml
# Configuração padrão usando GPT-4 para respostas de alta qualidade
[llm]
model = "gpt-4"
api_key = "your-api-key"
temperature = 0.0
# Configuração mais barata para exploração de repositório
[llm.repo-explorer]
model = "gpt-3.5-turbo"
temperature = 0.2
# Configuração para geração de código
[llm.code-gen]
model = "gpt-4"
temperature = 0.0
max_output_tokens = 2000
[agent.RepoExplorerAgent]
llm_config = 'repo-explorer'
[agent.CodeWriterAgent]
llm_config = 'code-gen'
```
Neste exemplo:
- A exploração de repositório usa um modelo mais barato, pois envolve principalmente entender e navegar pelo código
- A geração de código usa GPT-4 com um limite maior de tokens para gerar blocos de código maiores
- A configuração padrão permanece disponível para outras tarefas
# Configurações Personalizadas com Nomes Reservados
O OpenHands pode usar configurações personalizadas de LLM nomeadas com nomes reservados, para casos de uso específicos. Se você especificar o modelo e outras configurações sob os nomes reservados, então o OpenHands irá carregá-los e usá-los para um propósito específico. Até agora, uma dessas configurações está implementada: editor de rascunho.
## Configuração do Editor de Rascunho
A configuração `draft_editor` é um grupo de configurações que você pode fornecer, para especificar o modelo a ser usado para a elaboração preliminar de edições de código, para quaisquer tarefas que envolvam edição e refinamento de código. Você precisa fornecê-la na seção `[llm.draft_editor]`.
Por exemplo, você pode definir em `config.toml` um editor de rascunho assim:
```toml
[llm.draft_editor]
model = "gpt-4"
temperature = 0.2
top_p = 0.95
presence_penalty = 0.0
frequency_penalty = 0.0
```
Esta configuração:
- Usa GPT-4 para edições e sugestões de alta qualidade
- Define uma temperatura baixa (0,2) para manter a consistência, permitindo alguma flexibilidade
- Usa um valor alto de top_p (0,95) para considerar uma ampla gama de opções de tokens
- Desativa as penalidades de presença e frequência para manter o foco nas edições específicas necessárias
Use esta configuração quando quiser que um LLM faça um rascunho das edições antes de realizá-las. Em geral, pode ser útil para:
- Revisar e sugerir melhorias de código
- Refinar o conteúdo existente, mantendo seu significado principal
- Fazer alterações precisas e focadas no código ou texto
:::note
As configurações personalizadas de LLM estão disponíveis apenas quando se usa o OpenHands no modo de desenvolvimento, via `main.py` ou `cli.py`. Ao executar via `docker run`, por favor, use as opções de configuração padrão.
:::
@@ -0,0 +1,29 @@
# Google Gemini/Vertex
O OpenHands usa o LiteLLM para fazer chamadas aos modelos de chat do Google. Você pode encontrar a documentação sobre como usar o Google como provedor:
- [Gemini - Google AI Studio](https://docs.litellm.ai/docs/providers/gemini)
- [VertexAI - Google Cloud Platform](https://docs.litellm.ai/docs/providers/vertex)
## Configurações do Gemini - Google AI Studio
Ao executar o OpenHands, você precisará definir o seguinte na interface do usuário do OpenHands através das Configurações:
- `LLM Provider` para `Gemini`
- `LLM Model` para o modelo que você usará.
Se o modelo não estiver na lista, ative as opções `Advanced` e insira-o em `Custom Model` (por exemplo, gemini/&lt;model-name&gt; como `gemini/gemini-1.5-pro`).
- `API Key` para sua chave de API do Gemini
## Configurações do VertexAI - Google Cloud Platform
Para usar o Vertex AI através do Google Cloud Platform ao executar o OpenHands, você precisará definir as seguintes variáveis de ambiente usando `-e` no [comando docker run](../installation#running-openhands):
```
GOOGLE_APPLICATION_CREDENTIALS="<json-dump-of-gcp-service-account-json>"
VERTEXAI_PROJECT="<your-gcp-project-id>"
VERTEXAI_LOCATION="<your-gcp-location>"
```
Em seguida, defina o seguinte na interface do usuário do OpenHands através das Configurações:
- `LLM Provider` para `VertexAI`
- `LLM Model` para o modelo que você usará.
Se o modelo não estiver na lista, ative as opções `Advanced` e insira-o em `Custom Model` (por exemplo, vertex_ai/&lt;model-name&gt;).
@@ -0,0 +1,21 @@
# Groq
O OpenHands usa o LiteLLM para fazer chamadas para modelos de chat no Groq. Você pode encontrar a documentação deles sobre como usar o Groq como provedor [aqui](https://docs.litellm.ai/docs/providers/groq).
## Configuração
Ao executar o OpenHands, você precisará definir o seguinte na interface do usuário do OpenHands através das Configurações:
- `LLM Provider` para `Groq`
- `LLM Model` para o modelo que você usará. [Visite aqui para ver a lista de modelos que o Groq hospeda](https://console.groq.com/docs/models). Se o modelo não estiver na lista, ative as opções `Advanced` e insira-o em `Custom Model` (por exemplo, groq/&lt;model-name&gt; como `groq/llama3-70b-8192`).
- `API key` para sua chave de API do Groq. Para encontrar ou criar sua chave de API do Groq, [veja aqui](https://console.groq.com/keys).
## Usando o Groq como um Endpoint Compatível com OpenAI
O endpoint do Groq para conclusão de chat é [em grande parte compatível com OpenAI](https://console.groq.com/docs/openai). Portanto, você pode acessar os modelos do Groq como acessaria qualquer endpoint compatível com OpenAI. Na interface do usuário do OpenHands, através das Configurações:
1. Habilite as opções `Advanced`
2. Defina o seguinte:
- `Custom Model` para o prefixo `openai/` + o modelo que você usará (por exemplo, `openai/llama3-70b-8192`)
- `Base URL` para `https://api.groq.com/openai/v1`
- `API Key` para sua chave de API do Groq
@@ -0,0 +1,22 @@
Here is the translation to Brazilian Portuguese:
# Proxy LiteLLM
O OpenHands suporta o uso do [proxy LiteLLM](https://docs.litellm.ai/docs/proxy/quick_start) para acessar vários provedores de LLM.
## Configuração
Para usar o proxy LiteLLM com o OpenHands, você precisa:
1. Configurar um servidor proxy LiteLLM (veja a [documentação do LiteLLM](https://docs.litellm.ai/docs/proxy/quick_start))
2. Ao executar o OpenHands, você precisará definir o seguinte na interface do usuário do OpenHands através das Configurações:
* Habilitar opções `Avançadas`
* `Modelo Personalizado` para o prefixo `litellm_proxy/` + o modelo que você usará (por exemplo, `litellm_proxy/anthropic.claude-3-5-sonnet-20241022-v2:0`)
* `URL Base` para a URL do seu proxy LiteLLM (por exemplo, `https://your-litellm-proxy.com`)
* `Chave de API` para a chave de API do seu proxy LiteLLM
## Modelos Suportados
Os modelos suportados dependem da configuração do seu proxy LiteLLM. O OpenHands suporta qualquer modelo que o seu proxy LiteLLM esteja configurado para lidar.
Consulte a configuração do seu proxy LiteLLM para obter a lista de modelos disponíveis e seus nomes.
@@ -0,0 +1,72 @@
# 🤖 Backends de LLM
O OpenHands pode se conectar a qualquer LLM suportado pelo LiteLLM. No entanto, ele requer um modelo poderoso para funcionar.
## Recomendações de Modelo
Com base em nossas avaliações de modelos de linguagem para tarefas de codificação (usando o conjunto de dados SWE-bench), podemos fornecer algumas recomendações para a seleção de modelos. Nossos resultados mais recentes de benchmarking podem ser encontrados nesta [planilha](https://docs.google.com/spreadsheets/d/1wOUdFCMyY6Nt0AIqF705KN4JKOWgeI4wUGUP60krXXs/edit?gid=0).
Com base nessas descobertas e no feedback da comunidade, os seguintes modelos foram verificados como funcionando razoavelmente bem com o OpenHands:
- anthropic/claude-3-5-sonnet-20241022 (recomendado)
- anthropic/claude-3-5-haiku-20241022
- deepseek/deepseek-chat
- gpt-4o
:::warning
O OpenHands enviará muitos prompts para o LLM que você configurar. A maioria desses LLMs custa dinheiro, então certifique-se de definir limites de gastos e monitorar o uso.
:::
Para obter uma lista completa dos provedores e modelos disponíveis, consulte a [documentação do litellm](https://docs.litellm.ai/docs/providers).
:::note
A maioria dos modelos locais e de código aberto atuais não são tão poderosos. Ao usar esses modelos, você pode ver longos tempos de espera entre as mensagens, respostas ruins ou erros sobre JSON malformado. O OpenHands só pode ser tão poderoso quanto os modelos que o impulsionam. No entanto, se você encontrar alguns que funcionem, adicione-os à lista verificada acima.
:::
## Configuração do LLM
O seguinte pode ser definido na interface do usuário do OpenHands por meio das Configurações:
- `Provedor LLM`
- `Modelo LLM`
- `Chave API`
- `URL Base` (através das configurações `Avançadas`)
Existem algumas configurações que podem ser necessárias para alguns LLMs/provedores que não podem ser definidas através da interface do usuário. Em vez disso, elas podem ser definidas por meio de variáveis de ambiente passadas para o comando docker run ao iniciar o aplicativo usando `-e`:
- `LLM_API_VERSION`
- `LLM_EMBEDDING_MODEL`
- `LLM_EMBEDDING_DEPLOYMENT_NAME`
- `LLM_DROP_PARAMS`
- `LLM_DISABLE_VISION`
- `LLM_CACHING_PROMPT`
Temos alguns guias para executar o OpenHands com provedores de modelo específicos:
- [Azure](llms/azure-llms)
- [Google](llms/google-llms)
- [Groq](llms/groq)
- [LiteLLM Proxy](llms/litellm-proxy)
- [OpenAI](llms/openai-llms)
- [OpenRouter](llms/openrouter)
### Novas tentativas de API e limites de taxa
Os provedores de LLM normalmente têm limites de taxa, às vezes muito baixos, e podem exigir novas tentativas. O OpenHands tentará automaticamente as solicitações novamente se receber um Erro de Limite de Taxa (código de erro 429).
Você pode personalizar essas opções conforme necessário para o provedor que está usando. Verifique a documentação deles e defina as seguintes variáveis de ambiente para controlar o número de novas tentativas e o tempo entre as novas tentativas:
- `LLM_NUM_RETRIES` (Padrão de 4 vezes)
- `LLM_RETRY_MIN_WAIT` (Padrão de 5 segundos)
- `LLM_RETRY_MAX_WAIT` (Padrão de 30 segundos)
- `LLM_RETRY_MULTIPLIER` (Padrão de 2)
Se você estiver executando o OpenHands no modo de desenvolvimento, também poderá definir essas opções no arquivo `config.toml`:
```toml
[llm]
num_retries = 4
retry_min_wait = 5
retry_max_wait = 30
retry_multiplier = 2
```
@@ -0,0 +1,192 @@
# Local LLM with Ollama
:::warning
When using a Local LLM, OpenHands may have limited functionality.
:::
Ensure that you have the Ollama server up and running.
For detailed startup instructions, refer to [here](https://github.com/ollama/ollama).
This guide assumes you've started ollama with `ollama serve`. If you're running ollama differently (e.g. inside docker), the instructions might need to be modified. Please note that if you're running WSL the default ollama configuration blocks requests from docker containers. See [here](#configuring-ollama-service-wsl-en).
## Pull Models
Ollama model names can be found [here](https://ollama.com/library). For a small example, you can use
the `codellama:7b` model. Bigger models will generally perform better.
```bash
ollama pull codellama:7b
```
you can check which models you have downloaded like this:
```bash
~$ ollama list
NAME ID SIZE MODIFIED
codellama:7b 8fdf8f752f6e 3.8 GB 6 weeks ago
mistral:7b-instruct-v0.2-q4_K_M eb14864c7427 4.4 GB 2 weeks ago
starcoder2:latest f67ae0f64584 1.7 GB 19 hours ago
```
## Run OpenHands with Docker
### Start OpenHands
Use the instructions [here](../getting-started) to start OpenHands using Docker.
But when running `docker run`, you'll need to add a few more arguments:
```bash
docker run # ...
--add-host host.docker.internal:host-gateway \
-e LLM_OLLAMA_BASE_URL="http://host.docker.internal:11434" \
# ...
```
LLM_OLLAMA_BASE_URL is optional. If you set it, it will be used to show
the available installed models in the UI.
### Configure the Web Application
When running `openhands`, you'll need to set the following in the OpenHands UI through the Settings:
- the model to "ollama/&lt;model-name&gt;"
- the base url to `http://host.docker.internal:11434`
- the API key is optional, you can use any string, such as `ollama`.
## Run OpenHands in Development Mode
### Build from Source
Use the instructions in [Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md) to build OpenHands.
Make sure `config.toml` is there by running `make setup-config` which will create one for you. In `config.toml`, enter the followings:
```
[core]
workspace_base="./workspace"
[llm]
embedding_model="local"
ollama_base_url="http://localhost:11434"
```
Done! Now you can start OpenHands by: `make run`. You now should be able to connect to `http://localhost:3000/`
### Configure the Web Application
In the OpenHands UI, click on the Settings wheel in the bottom-left corner.
Then in the `Model` input, enter `ollama/codellama:7b`, or the name of the model you pulled earlier.
If it doesnt show up in the dropdown, enable `Advanced Settings` and type it in. Please note: you need the model name as listed by `ollama list`, with the prefix `ollama/`.
In the API Key field, enter `ollama` or any value, since you don't need a particular key.
In the Base URL field, enter `http://localhost:11434`.
And now you're ready to go!
## Configuring the ollama service (WSL) {#configuring-ollama-service-wsl-en}
The default configuration for ollama in WSL only serves localhost. This means you can't reach it from a docker container. eg. it wont work with OpenHands. First let's test that ollama is running correctly.
```bash
ollama list # get list of installed models
curl http://localhost:11434/api/generate -d '{"model":"[NAME]","prompt":"hi"}'
#ex. curl http://localhost:11434/api/generate -d '{"model":"codellama:7b","prompt":"hi"}'
#ex. curl http://localhost:11434/api/generate -d '{"model":"codellama","prompt":"hi"}' #the tag is optional if there is only one
```
Once that is done, test that it allows "outside" requests, like those from inside a docker container.
```bash
docker ps # get list of running docker containers, for most accurate test choose the OpenHands sandbox container.
docker exec [CONTAINER ID] curl http://host.docker.internal:11434/api/generate -d '{"model":"[NAME]","prompt":"hi"}'
#ex. docker exec cd9cc82f7a11 curl http://host.docker.internal:11434/api/generate -d '{"model":"codellama","prompt":"hi"}'
```
## Fixing it
Now let's make it work. Edit /etc/systemd/system/ollama.service with sudo privileges. (Path may vary depending on linux flavor)
```bash
sudo vi /etc/systemd/system/ollama.service
```
or
```bash
sudo nano /etc/systemd/system/ollama.service
```
In the [Service] bracket add these lines
```
Environment="OLLAMA_HOST=0.0.0.0:11434"
Environment="OLLAMA_ORIGINS=*"
```
Then save, reload the configuration and restart the service.
```bash
sudo systemctl daemon-reload
sudo systemctl restart ollama
```
Finally test that ollama is accessible from within the container
```bash
ollama list # get list of installed models
docker ps # get list of running docker containers, for most accurate test choose the OpenHands sandbox container.
docker exec [CONTAINER ID] curl http://host.docker.internal:11434/api/generate -d '{"model":"[NAME]","prompt":"hi"}'
```
# Local LLM with LM Studio
Steps to set up LM Studio:
1. Open LM Studio
2. Go to the Local Server tab.
3. Click the "Start Server" button.
4. Select the model you want to use from the dropdown.
Set the following configs:
```bash
LLM_MODEL="openai/lmstudio"
LLM_BASE_URL="http://localhost:1234/v1"
CUSTOM_LLM_PROVIDER="openai"
```
### Docker
```bash
docker run # ...
-e LLM_MODEL="openai/lmstudio" \
-e LLM_BASE_URL="http://host.docker.internal:1234/v1" \
-e CUSTOM_LLM_PROVIDER="openai" \
# ...
```
You should now be able to connect to `http://localhost:3000/`
In the development environment, you can set the following configs in the `config.toml` file:
```
[core]
workspace_base="./workspace"
[llm]
model="openai/lmstudio"
base_url="http://localhost:1234/v1"
custom_llm_provider="openai"
```
Done! Now you can start OpenHands by: `make run` without Docker. You now should be able to connect to `http://localhost:3000/`
# Note
For WSL, run the following commands in cmd to set up the networking mode to mirrored:
```
python -c "print('[wsl2]\nnetworkingMode=mirrored',file=open(r'%UserProfile%\.wslconfig','w'))"
wsl --shutdown
```
@@ -0,0 +1,25 @@
# OpenAI
O OpenHands usa o LiteLLM para fazer chamadas para os modelos de chat da OpenAI. Você pode encontrar a documentação deles sobre como usar a OpenAI como provedor [aqui](https://docs.litellm.ai/docs/providers/openai).
## Configuração
Ao executar o OpenHands, você precisará definir o seguinte na interface do usuário do OpenHands através das Configurações:
* `LLM Provider` para `OpenAI`
* `LLM Model` para o modelo que você usará.
[Visite aqui para ver uma lista completa dos modelos da OpenAI que o LiteLLM suporta.](https://docs.litellm.ai/docs/providers/openai#openai-chat-completion-models)
Se o modelo não estiver na lista, ative as opções `Advanced` e insira-o em `Custom Model` (por exemplo, openai/&lt;model-name&gt; como `openai/gpt-4o`).
* `API Key` para a sua chave de API da OpenAI. Para encontrar ou criar sua chave de API do projeto OpenAI, [veja aqui](https://platform.openai.com/api-keys).
## Usando Endpoints Compatíveis com OpenAI
Assim como para as conclusões de chat da OpenAI, usamos o LiteLLM para endpoints compatíveis com OpenAI. Você pode encontrar a documentação completa deles sobre este tópico [aqui](https://docs.litellm.ai/docs/providers/openai_compatible).
## Usando um Proxy OpenAI
Se você estiver usando um proxy OpenAI, na interface do usuário do OpenHands através das Configurações:
1. Ative as opções `Advanced`
2. Defina o seguinte:
- `Custom Model` para openai/&lt;model-name&gt; (por exemplo, `openai/gpt-4o` ou openai/&lt;proxy-prefix&gt;/&lt;model-name&gt;)
- `Base URL` para a URL do seu proxy OpenAI
- `API Key` para a sua chave de API da OpenAI
@@ -0,0 +1,14 @@
Here is the translated content in Brazilian Portuguese:
# OpenRouter
O OpenHands usa o LiteLLM para fazer chamadas para modelos de chat no OpenRouter. Você pode encontrar a documentação deles sobre como usar o OpenRouter como provedor [aqui](https://docs.litellm.ai/docs/providers/openrouter).
## Configuração
Ao executar o OpenHands, você precisará definir o seguinte na interface do usuário do OpenHands através das Configurações:
* `LLM Provider` para `OpenRouter`
* `LLM Model` para o modelo que você usará.
[Visite aqui para ver uma lista completa de modelos do OpenRouter](https://openrouter.ai/models).
Se o modelo não estiver na lista, ative as opções `Advanced` e insira-o em `Custom Model` (por exemplo, openrouter/&lt;model-name&gt; como `openrouter/anthropic/claude-3.5-sonnet`).
* `API Key` para a sua chave de API do OpenRouter.
@@ -0,0 +1,33 @@
# Visão Geral dos Microagentes
Os microagentes são prompts especializados que aprimoram o OpenHands com conhecimento específico de domínio, contexto específico de repositório e fluxos de trabalho específicos de tarefas. Eles ajudam fornecendo orientação especializada, automatizando tarefas comuns e garantindo práticas consistentes em todos os projetos.
## Tipos de Microagentes
Atualmente, o OpenHands suporta os seguintes tipos de microagentes:
* [Microagentes de Repositório](./microagents-repo): Contexto e diretrizes específicas do repositório para o OpenHands.
* [Microagentes Públicos](./microagents-public): Diretrizes gerais acionadas por palavras-chave para todos os usuários do OpenHands.
Quando o OpenHands trabalha com um repositório, ele:
1. Carrega instruções específicas do repositório de `.openhands/microagents/`, se presentes no repositório.
2. Carrega diretrizes gerais acionadas por palavras-chave nas conversas.
Veja os [Microagentes Públicos](https://github.com/All-Hands-AI/OpenHands/tree/main/microagents/knowledge) atuais.
## Formato do Microagente
Todos os microagentes usam arquivos markdown com frontmatter YAML que possuem instruções especiais para ajudar o OpenHands a realizar tarefas:
```
---
name: <Nome do microagente>
type: <Tipo do MicroAgent>
version: <Versão do MicroAgent>
agent: <O tipo de agente (normalmente CodeActAgent)>
triggers:
- <Palavras-chave opcionais que acionam o microagente. Se os gatilhos forem removidos, ele sempre será incluído>
---
<Markdown com quaisquer diretrizes especiais, instruções e prompts que o OpenHands deve seguir.
Confira a documentação específica para cada microagente sobre as melhores práticas para obter mais informações.>
```
@@ -0,0 +1,153 @@
# Microagentes Públicos
## Visão Geral
Microagentes públicos são diretrizes especializadas acionadas por palavras-chave para todos os usuários do OpenHands.
Eles são definidos em arquivos markdown no diretório
[`microagents/knowledge/`](https://github.com/All-Hands-AI/OpenHands/tree/main/microagents/knowledge).
Microagentes públicos:
- Monitoram comandos recebidos em busca de suas palavras-chave de acionamento.
- São ativados quando os gatilhos relevantes são detectados.
- Aplicam seus conhecimentos e capacidades especializados.
- Seguem suas diretrizes e restrições específicas.
## Microagentes Públicos Atuais
Para mais informações sobre microagentes específicos, consulte seus arquivos de documentação individuais no
diretório [`microagents/knowledge/`](https://github.com/All-Hands-AI/OpenHands/tree/main/microagents/knowledge/).
### Agente GitHub
**Arquivo**: `github.md`
**Gatilhos**: `github`, `git`
O agente GitHub é especializado em interações com a API do GitHub e gerenciamento de repositórios. Ele:
- Tem acesso a um `GITHUB_TOKEN` para autenticação na API.
- Segue diretrizes rígidas para interações com repositórios.
- Lida com gerenciamento de branches e pull requests.
- Usa a API do GitHub em vez de interações com navegador web.
Principais recursos:
- Proteção de branch (impede push direto para main/master)
- Criação automatizada de PR
- Gerenciamento de configuração do Git
- Abordagem API-first para operações do GitHub
Exemplo de Uso:
```bash
git checkout -b feature-branch
git commit -m "Add new feature"
git push origin feature-branch
```
### Agente NPM
**Arquivo**: `npm.md`
**Gatilhos**: `npm`
Especializado em lidar com gerenciamento de pacotes npm com foco específico em:
- Operações shell não interativas.
- Tratamento automatizado de confirmação usando o comando Unix 'yes'.
- Automação de instalação de pacotes.
Exemplo de Uso:
```bash
yes | npm install package-name
```
## Contribuindo com um Microagente Público
Você pode criar seus próprios microagentes públicos adicionando novos arquivos markdown ao
diretório [`microagents/knowledge/`](https://github.com/All-Hands-AI/OpenHands/tree/main/microagents/knowledge/).
### Melhores Práticas para Microagentes Públicos
- **Escopo Claro**: Mantenha o microagente focado em um domínio ou tarefa específica.
- **Instruções Explícitas**: Forneça diretrizes claras e inequívocas.
- **Exemplos Úteis**: Inclua exemplos práticos de casos de uso comuns.
- **Segurança em Primeiro Lugar**: Inclua avisos e restrições necessárias.
- **Consciência de Integração**: Considere como o microagente interage com outros componentes.
### Etapas para Contribuir com um Microagente Público
#### 1. Planeje o Microagente Público
Antes de criar um microagente público, considere:
- Qual problema ou caso de uso específico ele abordará?
- Quais capacidades ou conhecimentos únicos ele deve ter?
- Quais palavras-chave fazem sentido para ativá-lo?
- Quais restrições ou diretrizes ele deve seguir?
#### 2. Crie o Arquivo
Crie um novo arquivo markdown em [`microagents/knowledge/`](https://github.com/All-Hands-AI/OpenHands/tree/main/microagents/knowledge/)
com um nome descritivo (por exemplo, `docker.md` para um agente focado em Docker).
Atualize o arquivo com o frontmatter necessário [de acordo com o formato exigido](./microagents-overview#microagent-format)
e as diretrizes especializadas necessárias, seguindo as [melhores práticas acima](#melhores-práticas-para-microagentes-públicos).
#### 3. Testando o Microagente Público
- Teste o agente com vários prompts.
- Verifique se as palavras-chave acionam o agente corretamente.
- Certifique-se de que as instruções estão claras e abrangentes.
- Verifique possíveis conflitos com agentes existentes.
#### 4. Processo de Envio
Envie um pull request com:
- O novo arquivo do microagente.
- Documentação atualizada, se necessário.
- Descrição do propósito e das capacidades do agente.
### Exemplo de Implementação de Microagente Público
Aqui está um modelo para um novo microagente:
```markdown
---
name: docker
agent: CodeActAgent
triggers:
- docker
- container
---
Você é responsável pelo gerenciamento de contêineres Docker e criação de Dockerfile.
Principais responsabilidades:
1. Criar e modificar Dockerfiles
2. Gerenciar o ciclo de vida do contêiner
3. Lidar com configurações do Docker Compose
Diretrizes:
- Sempre use imagens base oficiais quando possível
- Inclua considerações de segurança necessárias
- Siga as melhores práticas do Docker para otimização de camadas
Exemplos:
1. Criando um Dockerfile:
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
CMD ["npm", "start"]
2. Uso do Docker Compose:
version: '3'
services:
web:
build: .
ports:
- "3000:3000"
Lembre-se de:
- Validar a sintaxe do Dockerfile
- Verificar vulnerabilidades de segurança
- Otimizar para tempo de build e tamanho da imagem
```
Veja os [microagentes públicos atuais](https://github.com/All-Hands-AI/OpenHands/tree/main/microagents/knowledge) para
mais exemplos.
@@ -0,0 +1,68 @@
# Microagentes de Repositório
## Visão Geral
O OpenHands pode ser personalizado para trabalhar de forma mais eficaz com repositórios específicos, fornecendo contexto
e diretrizes específicas do repositório. Esta seção explica como otimizar o OpenHands para o seu projeto.
## Criando um Micro-Agente de Repositório
Você pode personalizar o comportamento do OpenHands para o seu repositório criando um diretório `.openhands/microagents/` na raiz do seu repositório.
No mínimo, ele deve conter o arquivo
`.openhands/microagents/repo.md`, que inclui instruções que serão
fornecidas ao agente toda vez que ele trabalhar com este repositório.
### Melhores Práticas para Microagentes de Repositório
- **Mantenha as Instruções Atualizadas**: Atualize regularmente o seu diretório `.openhands/microagents/` à medida que o seu projeto evolui.
- **Seja Específico**: Inclua caminhos, padrões e requisitos específicos exclusivos do seu projeto.
- **Documente as Dependências**: Liste todas as ferramentas e dependências necessárias para o desenvolvimento.
- **Inclua Exemplos**: Forneça exemplos de bons padrões de código do seu projeto.
- **Especifique Convenções**: Documente convenções de nomenclatura, organização de arquivos e preferências de estilo de código.
### Etapas para Criar um Microagente de Repositório
#### 1. Planeje o Microagente de Repositório
Ao criar um micro-agente específico para um repositório, sugerimos incluir as seguintes informações:
- **Visão Geral do Repositório**: Uma breve descrição do propósito e arquitetura do seu projeto.
- **Estrutura de Diretórios**: Diretórios-chave e seus propósitos.
- **Diretrizes de Desenvolvimento**: Padrões e práticas de codificação específicas do projeto.
- **Requisitos de Teste**: Como executar testes e quais tipos de testes são necessários.
- **Instruções de Configuração**: Etapas necessárias para construir e executar o projeto.
#### 2. Crie o Arquivo
Crie um arquivo em seu repositório em `.openhands/microagents/` (Exemplo: `.openhands/microagents/repo.md`)
Atualize o arquivo com o frontmatter necessário [de acordo com o formato exigido](./microagents-overview#microagent-format)
e as diretrizes especializadas necessárias para o seu repositório.
### Exemplo de Microagente de Repositório
```
---
name: repo
type: repo
agent: CodeActAgent
---
Repository: MeuProjeto
Description: Uma aplicação web para gerenciamento de tarefas
Directory Structure:
- src/: Código principal da aplicação
- tests/: Arquivos de teste
- docs/: Documentação
Setup:
- Execute `npm install` para instalar as dependências
- Use `npm run dev` para desenvolvimento
- Execute `npm test` para testes
Guidelines:
- Siga a configuração do ESLint
- Escreva testes para todos os novos recursos
- Use TypeScript para novo código
Se adicionar um novo componente em src/components, sempre adicione testes unitários apropriados em tests/components/.
```
@@ -0,0 +1,37 @@
# Melhores Práticas de Prompt
Ao trabalhar com o desenvolvedor de software OpenHands AI, é crucial fornecer prompts claros e eficazes. Este guia descreve as melhores práticas para criar prompts que produzirão as respostas mais precisas e úteis.
## Características de Bons Prompts
Bons prompts são:
- **Concretos**: Eles explicam exatamente qual funcionalidade deve ser adicionada ou qual erro precisa ser corrigido.
- **Específicos de localização**: Se conhecido, eles explicam os locais na base de código que devem ser modificados.
- **Escopo apropriado**: Eles devem ter o tamanho de uma única funcionalidade, normalmente não excedendo 100 linhas de código.
## Exemplos
### Exemplos de Bons Prompts
- "Adicione uma função `calculate_average` em `utils/math_operations.py` que recebe uma lista de números como entrada e retorna sua média."
- "Corrija o TypeError em `frontend/src/components/UserProfile.tsx` ocorrendo na linha 42. O erro sugere que estamos tentando acessar uma propriedade de undefined."
- "Implemente a validação de entrada para o campo de e-mail no formulário de registro. Atualize `frontend/src/components/RegistrationForm.tsx` para verificar se o e-mail está em um formato válido antes do envio."
### Exemplos de Maus Prompts
- "Torne o código melhor." (Muito vago, não concreto)
- "Reescreva todo o backend para usar um framework diferente." (Escopo não apropriado)
- "Há um bug em algum lugar na autenticação do usuário. Você pode encontrá-lo e corrigi-lo?" (Falta especificidade e informações de localização)
## Dicas para Prompts Eficazes
- Seja o mais específico possível sobre o resultado desejado ou o problema a ser resolvido.
- Forneça contexto, incluindo caminhos de arquivo relevantes e números de linha, se disponíveis.
- Divida tarefas grandes em prompts menores e gerenciáveis.
- Inclua quaisquer mensagens de erro ou logs relevantes.
- Especifique a linguagem de programação ou framework se não for óbvio a partir do contexto.
Lembre-se, quanto mais preciso e informativo for o seu prompt, melhor a IA poderá ajudá-lo a desenvolver ou modificar o software OpenHands.
Veja [Começando com o OpenHands](../getting-started) para mais exemplos de prompts úteis.
@@ -0,0 +1,165 @@
# Configuração de Runtime
Um Runtime é um ambiente onde o agente OpenHands pode editar arquivos e executar comandos.
Por padrão, o OpenHands usa um runtime baseado em Docker, executando no seu computador local. Isso significa que você só precisa pagar pelo LLM que está usando, e seu código é enviado apenas para o LLM.
Também suportamos runtimes "remotos", que são tipicamente gerenciados por terceiros. Eles podem tornar a configuração um pouco mais simples e escalável, especialmente se você estiver executando muitas conversas do OpenHands em paralelo (por exemplo, para fazer avaliação).
Além disso, fornecemos um runtime "local" que é executado diretamente na sua máquina sem o Docker, o que pode ser útil em ambientes controlados como pipelines de CI.
## Runtime Docker
Este é o Runtime padrão que é usado quando você inicia o OpenHands. Você pode notar algumas flags sendo passadas para o `docker run` que tornam isso possível:
```
docker run # ...
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik \
-v /var/run/docker.sock:/var/run/docker.sock \
# ...
```
O `SANDBOX_RUNTIME_CONTAINER_IMAGE` do nikolaik é uma imagem de runtime pré-construída que contém nosso servidor Runtime, bem como algumas utilidades básicas para Python e NodeJS. Você também pode [construir sua própria imagem de runtime](how-to/custom-sandbox-guide).
### Conectando ao seu sistema de arquivos
Um recurso útil aqui é a capacidade de se conectar ao seu sistema de arquivos local. Para montar seu sistema de arquivos no runtime:
1. Defina `WORKSPACE_BASE`:
```bash
export WORKSPACE_BASE=/caminho/para/seu/codigo
# Exemplo no Linux e Mac
# export WORKSPACE_BASE=$HOME/OpenHands
# Definirá $WORKSPACE_BASE como /home/<username>/OpenHands
#
# Exemplo no WSL no Windows
# export WORKSPACE_BASE=/mnt/c/dev/OpenHands
# Definirá $WORKSPACE_BASE como C:\dev\OpenHands
```
2. Adicione as seguintes opções ao comando `docker run`:
```bash
docker run # ...
-e SANDBOX_USER_ID=$(id -u) \
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
-v $WORKSPACE_BASE:/opt/workspace_base \
# ...
```
Tenha cuidado! Não há nada impedindo o agente OpenHands de excluir ou modificar quaisquer arquivos que estejam montados em seu workspace.
Essa configuração pode causar alguns problemas com permissões de arquivo (daí a variável `SANDBOX_USER_ID`), mas parece funcionar bem na maioria dos sistemas.
## OpenHands Remote Runtime
O OpenHands Remote Runtime está atualmente em beta (leia [aqui](https://runtime.all-hands.dev/) para mais detalhes), ele permite que você inicie runtimes em paralelo na nuvem. Preencha [este formulário](https://docs.google.com/forms/d/e/1FAIpQLSckVz_JFwg2_mOxNZjCtr7aoBFI2Mwdan3f75J_TrdMS1JV2g/viewform) para se inscrever se quiser experimentar isso!
NOTA: Este runtime é projetado especificamente apenas para fins de avaliação de agentes por meio do [harness de avaliação do OpenHands](https://github.com/All-Hands-AI/OpenHands/tree/main/evaluation). Ele não deve ser usado para iniciar aplicativos OpenHands em produção.
## Runtime Modal
Nossos parceiros na [Modal](https://modal.com/) também forneceram um runtime para o OpenHands.
Para usar o Runtime Modal, crie uma conta e, em seguida, [crie uma chave de API.](https://modal.com/settings)
Você precisará definir as seguintes variáveis de ambiente ao iniciar o OpenHands:
```bash
docker run # ...
-e RUNTIME=modal \
-e MODAL_API_TOKEN_ID="seu-id" \
-e MODAL_API_TOKEN_SECRET="seu-segredo" \
```
## Runtime Daytona
Outra opção é usar o [Daytona](https://www.daytona.io/) como provedor de runtime:
### Passo 1: Recupere sua chave de API do Daytona
1. Visite o [Painel do Daytona](https://app.daytona.io/dashboard/keys).
2. Clique em **"Create Key"**.
3. Digite um nome para sua chave e confirme a criação.
4. Depois que a chave for gerada, copie-a.
### Passo 2: Defina sua chave de API como uma variável de ambiente
Execute o seguinte comando no seu terminal, substituindo `<sua-chave-de-api>` pela chave real que você copiou:
```bash
export DAYTONA_API_KEY="<sua-chave-de-api>"
```
Esta etapa garante que o OpenHands possa se autenticar na plataforma Daytona quando for executado.
### Passo 3: Execute o OpenHands localmente usando o Docker
Para iniciar a versão mais recente do OpenHands em sua máquina, execute o seguinte comando no seu terminal:
```bash
bash -i <(curl -sL https://get.daytona.io/openhands)
```
#### O que este comando faz:
- Baixa o script de lançamento mais recente do OpenHands.
- Executa o script em uma sessão interativa do Bash.
- Automaticamente baixa e executa o contêiner do OpenHands usando o Docker.
Uma vez executado, o OpenHands deve estar sendo executado localmente e pronto para uso.
Para mais detalhes e inicialização manual, veja o [README.md](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/impl/daytona/README.md) completo.
## Runtime Local
O Runtime Local permite que o agente OpenHands execute ações diretamente em sua máquina local sem usar o Docker. Este runtime é destinado principalmente para ambientes controlados, como pipelines de CI ou cenários de teste onde o Docker não está disponível.
:::caution
**Aviso de segurança**: O Runtime Local é executado sem nenhum isolamento de sandbox. O agente pode acessar e modificar diretamente os arquivos em sua máquina. Use este runtime apenas em ambientes controlados ou quando você entender completamente as implicações de segurança.
:::
### Pré-requisitos
Antes de usar o Runtime Local, certifique-se de ter as seguintes dependências instaladas:
1. Você seguiu as [instruções de configuração de desenvolvimento](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md).
2. O tmux está disponível em seu sistema.
### Configuração
Para usar o Runtime Local, além das configurações necessárias como o modelo, chave de API, você precisará definir as seguintes opções por meio de variáveis de ambiente ou do [arquivo config.toml](https://github.com/All-Hands-AI/OpenHands/blob/main/config.template.toml) ao iniciar o OpenHands:
- Via variáveis de ambiente:
```bash
# Obrigatório
export RUNTIME=local
# Opcional, mas recomendado
export WORKSPACE_BASE=/caminho/para/seu/workspace
```
- Via `config.toml`:
```toml
[core]
runtime = "local"
workspace_base = "/caminho/para/seu/workspace"
```
Se `WORKSPACE_BASE` não for definido, o runtime criará um diretório temporário para o agente trabalhar.
### Exemplo de uso
Aqui está um exemplo de como iniciar o OpenHands com o Runtime Local no Modo Headless:
```bash
# Define o tipo de runtime como local
export RUNTIME=local
# Opcionalmente, define um diretório de workspace
export WORKSPACE_BASE=/caminho/para/seu/projeto
# Inicia o OpenHands
poetry run python -m openhands.core.main -t "escreva um script bash que imprima oi"
```
### Casos de uso
O Runtime Local é particularmente útil para:
- Pipelines de CI/CD onde o Docker não está disponível.
- Testes e desenvolvimento do próprio OpenHands.
- Ambientes onde o uso de contêineres é restrito.
- Cenários onde o acesso direto ao sistema de arquivos é necessário.
@@ -0,0 +1,48 @@
# 🚧 Solução de Problemas
:::tip
O OpenHands só suporta Windows via WSL. Certifique-se de executar todos os comandos dentro do seu terminal WSL.
:::
### Falha ao iniciar o cliente docker
**Descrição**
Ao executar o OpenHands, o seguinte erro é visto:
```
Launch docker client failed. Please make sure you have installed docker and started docker desktop/daemon.
```
**Resolução**
Tente estes passos em ordem:
- Confirme que o `docker` está em execução no seu sistema. Você deve ser capaz de executar `docker ps` no terminal com sucesso.
- Se estiver usando o Docker Desktop, certifique-se de que `Settings > Advanced > Allow the default Docker socket to be used` esteja habilitado.
- Dependendo da sua configuração, você pode precisar habilitar `Settings > Resources > Network > Enable host networking` no Docker Desktop.
- Reinstale o Docker Desktop.
---
# Problemas Específicos ao Ambiente de Desenvolvimento
### Erro ao construir a imagem docker do runtime
**Descrição**
Tentativas de iniciar uma nova sessão falham e erros com termos como os seguintes aparecem nos logs:
```
debian-security bookworm-security
InRelease At least one invalid signature was encountered.
```
Isso parece acontecer quando o hash de uma biblioteca externa existente muda e sua instância local do docker tem uma versão anterior em cache. Para contornar isso, tente o seguinte:
- Pare quaisquer contêineres onde o nome tenha o prefixo `openhands-runtime-`:
`docker ps --filter name=openhands-runtime- --filter status=running -aq | xargs docker stop`
- Remova quaisquer contêineres onde o nome tenha o prefixo `openhands-runtime-`:
`docker rmi $(docker images --filter name=openhands-runtime- -q --no-trunc)`
- Pare e remova quaisquer contêineres / imagens onde o nome tenha o prefixo `openhands-runtime-`
- Limpe contêineres / imagens: `docker container prune -f && docker image prune -f`
+21
View File
@@ -402,5 +402,26 @@
"theme.unlistedContent.message": {
"message": "此页面未列出。搜索引擎不会对其索引,只有拥有直接链接的用户才能访问。",
"description": "The unlisted content banner message"
},
"Use AI to tackle the toil in your backlog. Our agents have all the same tools as a human developer: they can modify code, run commands, browse the web, call APIs, and yes-even copy code snippets from StackOverflow.": {
"message": "使用AI处理您积压的工作。我们的代理拥有与人类开发者相同的工具:它们可以修改代码、运行命令、浏览网页、调用API,甚至从StackOverflow复制代码片段。"
},
"Get started with OpenHands.": {
"message": "开始使用OpenHands"
},
"Most Popular Links": {
"message": "热门链接"
},
"Customizing OpenHands to a repository": {
"message": "为仓库定制OpenHands"
},
"Integrating OpenHands with Github": {
"message": "将OpenHands与Github集成"
},
"Recommended models to use": {
"message": "推荐使用的模型"
},
"Connecting OpenHands to your filesystem": {
"message": "将OpenHands连接到您的文件系统"
}
}
@@ -1,8 +1,8 @@
以下是翻译后的内容:
# 📦 EventStream 运行时
# 📦 Docker 运行时
OpenHands EventStream 运行时是实现 AI 代理操作安全灵活执行的核心组件。
OpenHands Docker 运行时是实现 AI 代理操作安全灵活执行的核心组件。
它使用 Docker 创建一个沙盒环境,可以安全地运行任意代码而不会危及主机系统。
## 为什么我们需要沙盒运行时?
@@ -10,41 +10,39 @@
# 目录
1. [核心配置](#核心配置)
1. [核心配置](#core-configuration)
- [API Keys](#api-keys)
- [工作区](#工作区)
- [调试和日志记录](#调试和日志记录)
- [会话管理](#会话管理)
- [轨迹](#轨迹)
- [文件存储](#文件存储)
- [任务管理](#任务管理)
- [沙箱配置](#沙箱配置)
- [其他](#其他)
2. [LLM 配置](#llm-配置)
- [AWS 凭证](#aws-凭证)
- [API 配置](#api-配置)
- [自定义 LLM Provider](#自定义-llm-provider)
- [工作区](#workspace)
- [调试和日志记录](#debugging-and-logging)
- [轨迹](#trajectories)
- [文件存储](#file-store)
- [任务管理](#task-management)
- [沙箱配置](#sandbox-configuration)
- [其他](#miscellaneous)
2. [LLM 配置](#llm-configuration)
- [AWS 凭证](#aws-credentials)
- [API 配置](#api-configuration)
- [自定义 LLM Provider](#custom-llm-provider)
- [Embeddings](#embeddings)
- [消息处理](#消息处理)
- [模型选择](#模型选择)
- [重试](#重试)
- [高级选项](#高级选项)
3. [Agent 配置](#agent-配置)
- [Microagent 配置](#microagent-配置)
- [内存配置](#内存配置)
- [LLM 配置](#llm-配置-2)
- [ActionSpace 配置](#actionspace-配置)
- [Microagent 使用](#microagent-使用)
4. [沙箱配置](#沙箱配置-2)
- [执行](#执行)
- [容器镜像](#容器镜像)
- [网络](#网络)
- [Linting 和插件](#linting-和插件)
- [依赖和环境](#依赖和环境)
- [评估](#评估)
5. [安全配置](#安全配置)
- [确认模式](#确认模式)
- [安全分析器](#安全分析器)
- [消息处理](#message-handling)
- [模型选择](#model-selection)
- [重试](#retrying)
- [高级选项](#advanced-options)
3. [Agent 配置](#agent-configuration)
- [内存配置](#memory-configuration)
- [LLM 配置](#llm-configuration-1)
- [ActionSpace 配置](#actionspace-configuration)
- [Microagent 使用](#microagent-usage)
4. [沙箱配置](#sandbox-configuration-1)
- [执行](#execution)
- [容器镜像](#container-image)
- [网络](#networking)
- [Linting 和插件](#linting-and-plugins)
- [依赖和环境](#dependencies-and-environment)
- [评估](#evaluation)
5. [安全配置](#security-configuration)
- [确认模式](#confirmation-mode)
- [安全分析器](#security-analyzer)
---
@@ -91,7 +89,7 @@
- 描述: 禁用终端输出中的颜色
**轨迹**
- `trajectories_path`
- `save_trajectory_path`
- 类型: `str`
- 默认值: `"./trajectories"`
- 描述: 存储轨迹的路径(可以是文件夹或文件)。如果是文件夹,轨迹将保存在该文件夹中以会话 ID 命名的 .json 文件中。
@@ -162,7 +160,7 @@
- `runtime`
- 类型: `str`
- 默认值: `"eventstream"`
- 默认值: `"docker"`
- 描述: 运行时环境
- `default_agent`
@@ -328,12 +326,6 @@ LLM(大语言模型)配置选项在 `config.toml` 文件的 `[llm]` 部分中定
Agent 配置选项在 `config.toml` 文件的 `[agent]``[agent.<agent_name>]` 部分中定义。
**Microagent 配置**
- `micro_agent_name`
- 类型: `str`
- 默认值: `""`
- 描述: 用于此 agent 的 micro agent 名称
**内存配置**
- `memory_enabled`
- 类型: `bool`
@@ -373,7 +365,7 @@ Agent 配置选项在 `config.toml` 文件的 `[agent]` 和 `[agent.<agent_name>
- 描述: 是否在 action space 中启用 Jupyter
**Microagent 使用**
- `use_microagents`
- `enable_prompt_extensions`
- 类型: `bool`
- 默认值: `true`
- 描述: 是否使用 microagents
@@ -58,10 +58,11 @@ docker build -t custom_image .
[core]
workspace_base="./workspace"
run_as_openhands=true
sandbox_base_container_image="custom_image"
[sandbox]
base_container_image="custom_image"
```
对于 `sandbox_base_container_image` 的值, 您可以选择以下任意一项:
对于 `base_container_image` 的值, 您可以选择以下任意一项:
1. 在上一步中您构建的自定义镜像的名称(例如,`“custom_image”`
2. 从 Docker Hub 拉取的镜像(例如,`“node:20”`,如果你需要一个预装 `Node.js` 的沙箱环境)
@@ -83,20 +84,17 @@ sandbox_base_container_image="custom_image"
### 错误:```useradd: UID 1000 is not unique```
如果在控制台输出中看到此错误,说明 OpenHands 尝试在沙箱中以 UID 1000 创建 openhands 用户,但该 UID 已经被映像中的其他部分使用(不知何故)。要解决这个问题,请更改 config.toml 文件中的 sandbox_user_id 字段为不同的值:
如果在控制台输出中看到此错误,说明 OpenHands 尝试在沙箱中以 UID 1000 创建 openhands 用户,但该 UID 已经被映像中的其他部分使用(不知何故)。要解决这个问题,请更改 config.toml 文件中的 user_id 字段为不同的值:
```
[core]
workspace_base="./workspace"
run_as_openhands=true
sandbox_base_container_image="custom_image"
sandbox_user_id="1001"
[sandbox]
base_container_image="custom_image"
user_id="1001"
```
### 端口使用错误
如果您遇到端口被占用或不可用的错误提示,可以尝试先用`docker ps`命令列出所有运行中的 Docker 容器,然后使用`docker rm`命令删除相关容器,最后再重新执行```make run```命令。
## 讨论
对于其他问题或疑问,请加入 [Slack](https://join.slack.com/t/openhands-ai/shared_invite/zt-2wkh4pklz-w~h_DVDtEe9H5kyQlcNxVw) 或 [Discord](https://discord.gg/ESHStjSjD4) 提问!
@@ -50,7 +50,7 @@ LLM_API_KEY="sk_test_12345"
```bash
docker run -it \
--pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.19-nikolaik \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik \
-e SANDBOX_USER_ID=$(id -u) \
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
-e LLM_API_KEY=$LLM_API_KEY \
@@ -59,7 +59,7 @@ docker run -it \
-v /var/run/docker.sock:/var/run/docker.sock \
--add-host host.docker.internal:host-gateway \
--name openhands-app-$(date +%Y%m%d%H%M%S) \
docker.all-hands.dev/all-hands-ai/openhands:0.19 \
docker.all-hands.dev/all-hands-ai/openhands:0.29 \
python -m openhands.core.cli
```
@@ -42,12 +42,13 @@ docker build -t custom-image .
### 指定基础沙箱镜像
在 OpenHands 目录中的 `config.toml` 文件中,将 `sandbox_base_container_image` 设置为你要使用的镜像。这可以是你已经拉取的镜像或你构建的镜像:
在 OpenHands 目录中的 `config.toml` 文件中,将 `base_container_image` 设置为你要使用的镜像。这可以是你已经拉取的镜像或你构建的镜像:
```bash
[core]
...
sandbox_base_container_image="custom-image"
[sandbox]
base_container_image="custom-image"
```
### 运行
@@ -112,7 +112,7 @@ OpenHands 的主要入口点在 `openhands/core/main.py` 中。以下是它的
def get_config(instance: pd.Series, metadata: EvalMetadata) -> AppConfig:
config = AppConfig(
default_agent=metadata.agent_class,
runtime='eventstream',
runtime='docker',
max_iterations=metadata.max_iterations,
sandbox=SandboxConfig(
base_container_image='your_container_image',
@@ -47,7 +47,7 @@ LLM_API_KEY="sk_test_12345"
```bash
docker run -it \
--pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.19-nikolaik \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik \
-e SANDBOX_USER_ID=$(id -u) \
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
-e LLM_API_KEY=$LLM_API_KEY \
@@ -57,6 +57,6 @@ docker run -it \
-v /var/run/docker.sock:/var/run/docker.sock \
--add-host host.docker.internal:host-gateway \
--name openhands-app-$(date +%Y%m%d%H%M%S) \
docker.all-hands.dev/all-hands-ai/openhands:0.19 \
docker.all-hands.dev/all-hands-ai/openhands:0.29 \
python -m openhands.core.main -t "write a bash script that prints hi" --no-auto-continue
```
@@ -11,16 +11,16 @@
在 Docker 中运行 OpenHands 是最简单的方式。
```bash
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.19-nikolaik
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik
docker run -it --rm --pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.19-nikolaik \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik \
-e LOG_ALL_EVENTS=true \
-v /var/run/docker.sock:/var/run/docker.sock \
-p 3000:3000 \
--add-host host.docker.internal:host-gateway \
--name openhands-app \
docker.all-hands.dev/all-hands-ai/openhands:0.19
docker.all-hands.dev/all-hands-ai/openhands:0.29
```
你也可以在可脚本化的[无头模式](https://docs.all-hands.dev/modules/usage/how-to/headless-mode)下运行 OpenHands,作为[交互式 CLI](https://docs.all-hands.dev/modules/usage/how-to/cli-mode),或使用 [OpenHands GitHub Action](https://docs.all-hands.dev/modules/usage/how-to/github-action)。
@@ -42,7 +42,7 @@ OpenHands 是一个**自主 AI 软件工程师**,能够执行复杂的工程
/>
</a>
<br></br>
<a href="https://join.slack.com/t/openhands-ai/shared_invite/zt-2wkh4pklz-w~h_DVDtEe9H5kyQlcNxVw">
<a href="https://join.slack.com/t/openhands-ai/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw">
<img
src="https://img.shields.io/badge/Slack-Join%20Us-red?logo=slack&logoColor=white&style=for-the-badge"
alt="Join our Slack community"
@@ -11,7 +11,7 @@
```
docker run # ...
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.19-nikolaik \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik \
-v /var/run/docker.sock:/var/run/docker.sock \
# ...
```
+4 -6
View File
@@ -1,6 +1,6 @@
# 📦 EventStream Runtime
# 📦 Docker Runtime
The OpenHands EventStream Runtime is the core component that enables secure and flexible execution of AI agent's action.
The OpenHands Docker Runtime is the core component that enables secure and flexible execution of AI agent's action.
It creates a sandboxed environment using Docker, where arbitrary code can be run safely without risking the host system.
## Why do we need a sandboxed runtime?
@@ -54,14 +54,13 @@ graph TD
6. Action Execution: The runtime client receives actions from the backend, executes them in the sandboxed environment, and sends back observations
7. Observation Return: The action execution server sends execution results back to the OpenHands backend as observations
The role of the client:
- It acts as an intermediary between the OpenHands backend and the sandboxed environment
- It executes various types of actions (shell commands, file operations, Python code, etc.) safely within the container
- It manages the state of the sandboxed environment, including the current working directory and loaded plugins
- It formats and returns observations to the backend, ensuring a consistent interface for processing results
## How OpenHands builds and maintains OH Runtime images
OpenHands' approach to building and managing runtime images ensures efficiency, consistency, and flexibility in creating and maintaining Docker images for both production and development environments.
@@ -78,16 +77,15 @@ Tags may be in one of 2 formats:
- **Source Tag**: `oh_v{openhands_version}_{16_digit_lock_hash}_{16_digit_source_hash}`
(e.g.: `oh_v0.9.9_1234567890abcdef_1234567890abcdef`)
#### Source Tag - Most Specific
This is the first 16 digits of the MD5 of the directory hash for the source directory. This gives a hash
for only the openhands source
#### Lock Tag
This hash is built from the first 16 digits of the MD5 of:
- The name of the base image upon which the image was built (e.g.: `nikolaik/python-nodejs:python3.12-nodejs22`)
- The content of the `pyproject.toml` included in the image.
- The content of the `poetry.lock` included in the image.

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