Skip to content

Add search engine feature #7262

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 266 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
266 commits
Select commit Hold shift + click to select a range
70772cc
Merge remote-tracking branch 'upstream/main' into codeact_browsing
adityasoni9998 Jan 27, 2025
a7d38cd
Undo changes in package-lock.json.
adityasoni9998 Jan 27, 2025
26c4f72
Merge remote-tracking branch 'upstream/main'
adityasoni9998 Jan 30, 2025
818533f
Merge branch 'main' into codeact_browsing
adityasoni9998 Jan 30, 2025
a699a0d
Merge remote-tracking branch 'upstream/main'
adityasoni9998 Jan 30, 2025
d34c412
Merge branch 'main' into codeact_browsing
adityasoni9998 Jan 30, 2025
e66a113
Merge remote-tracking branch 'upstream/main'
adityasoni9998 Feb 1, 2025
ee1173e
Merge branch 'main' into codeact_browsing
adityasoni9998 Feb 1, 2025
83fa5b0
Rename visual browsing flag in agent config.
adityasoni9998 Feb 1, 2025
65bf992
Browser output condenser to condense observation outputs from browser…
adityasoni9998 Feb 1, 2025
3b05b68
Merge branch 'main' into browser_condenser
adityasoni9998 Feb 1, 2025
d35a225
Merge branch 'main' into browser_condenser
adityasoni9998 Feb 2, 2025
0b1ec8a
Merge remote-tracking branch 'upstream/main' into main
adityasoni9998 Feb 5, 2025
f49b7a9
Merge remote-tracking branch 'upstream/main'
adityasoni9998 Feb 6, 2025
0f24032
Merge remote-tracking branch 'upstream/main'
adityasoni9998 Feb 6, 2025
904b2b3
Remove free disk space steps from workflows to test if they are neces…
neubig Feb 5, 2025
6e7aa15
Fix memory leak in JSON encoder (#6620)
neubig Feb 5, 2025
0b361f3
Update and Improve zh-TW Traditional Chinese locale (#6621)
PeterDaveHello Feb 5, 2025
7e08383
chore(deps): bump the version-all group across 1 directory with 15 up…
dependabot[bot] Feb 6, 2025
f1911be
Only show start project button in conversations (#6626)
mamoodi Feb 6, 2025
7c1c19c
chore(frontend): Migrate from NextUI to HeroUI via codemod (#6635)
amanape Feb 6, 2025
945bdd7
Better error logging in posthog (#6346)
neubig Feb 6, 2025
03f4745
Add o1 to verfied models (#6642)
mamoodi Feb 6, 2025
3fa1fb7
Merge remote-tracking branch 'upstream/main'
adityasoni9998 Feb 7, 2025
b5391f5
Merge remote-tracking branch 'upstream/main'
adityasoni9998 Feb 20, 2025
3b504e1
Merge remote-tracking branch 'upstream/main'
adityasoni9998 Feb 27, 2025
677488d
Merge branch 'main' into browser_condenser
adityasoni9998 Feb 27, 2025
3b7d86e
Code for evaluation run 2 on GAIA.
adityasoni9998 Mar 1, 2025
e561aa9
Merge remote-tracking branch 'upstream/main'
adityasoni9998 Mar 1, 2025
19e5e5b
Changes to GAIA prompt and browser tool.
adityasoni9998 Mar 1, 2025
e9c32f7
Merge branch 'main' into eval_fixes
adityasoni9998 Mar 1, 2025
840b350
Added search engine tool in openhands. Refine prompt for GAIA. Made b…
adityasoni9998 Mar 3, 2025
edea1e9
Optimize memory usage in FileEditObservation (#6622)
neubig Feb 7, 2025
72a4ece
fix: handle SAAS mode properly in useSettings hook (#6646)
tofarr Feb 7, 2025
8cf58c6
feat: Add LocalRuntime (#5284)
xingyaoww Feb 7, 2025
f2781a5
chore(frontend): Take into account other error message types (#6647)
amanape Feb 7, 2025
102f2e4
fix: set `tool_choice` to none for non-fncall models (#6652)
xingyaoww Feb 7, 2025
04d5691
fix(6223): More properly add 'pyproject.toml' and 'poetry.lock' to th…
zchn Feb 8, 2025
4b23a77
chore(deps): bump the version-all group across 1 directory with 3 upd…
dependabot[bot] Feb 10, 2025
3d2268e
Removed in page callback (#6657)
tofarr Feb 10, 2025
6dce886
[Bug fix]: Standardize SecretStr use (#6660)
malhotra5 Feb 10, 2025
0588311
Add comprehensive OpenHands glossary (#6310)
rbren Feb 10, 2025
477b369
[Enhancement]: Handle GH token refresh inside runtime (#6632)
malhotra5 Feb 10, 2025
01d23ae
chore(deps): bump the version-all group in /frontend with 4 updates (…
dependabot[bot] Feb 10, 2025
7113d38
[Resolver]: Add target branch param (#6668)
malhotra5 Feb 10, 2025
8e55ced
Fix issue #6262: Add success/failure indicators for file read/edit op…
neubig Feb 10, 2025
1a5c252
Fix for issue where temp file is empty (#6669)
tofarr Feb 10, 2025
fcfc807
fix: Normalize whitespace when comparing patch context lines (#6541)
neubig Feb 10, 2025
a0c9451
fix: adding support for environment variables type dict (#6672)
fredysierra Feb 10, 2025
27e39fb
chore(deps): bump docker/setup-qemu-action from 3.3.0 to 3.4.0 (#6666)
dependabot[bot] Feb 10, 2025
b60acd5
chore(deps): bump the version-all group across 1 directory with 9 upd…
dependabot[bot] Feb 10, 2025
fba1f1b
hotfix: Typecheck routes during frontend build (#6676)
amanape Feb 10, 2025
508dea4
Bump OpenHands ACI to 0.2.1 (#6678)
xingyaoww Feb 10, 2025
a98f31f
Clean up global in llm.py (we figured it's not needed) (#6675)
enyst Feb 10, 2025
807b0bf
feat(runtime): use `prlimit` to limit resource usage of command to av…
xingyaoww Feb 11, 2025
25b73f9
fix(frontend): fix public github repo cannot be selected (#6680)
xyeric Feb 11, 2025
b71b723
refactor(runtime): Use openhands-aci file editor directly in runtime …
xingyaoww Feb 11, 2025
26f235f
Fix debug in remote runtime (#6688)
rbren Feb 11, 2025
e2add5c
chore(deps-dev): bump @tanstack/eslint-plugin-query from 5.66.0 to 5.…
dependabot[bot] Feb 11, 2025
e59878a
refactor: do not add DEBUG env var when it is not set (#6690)
xingyaoww Feb 11, 2025
dfbd928
Revert "Only show start project button in conversations" (#6698)
amanape Feb 12, 2025
70d7982
using all available system memory when RUNTIME_MAX_MEMORY_GB is not s…
xingyaoww Feb 12, 2025
1f01edb
Fix log formatting error (#6699)
tofarr Feb 12, 2025
7f5d767
chore: Throw a 404 instead of returning defaults if settings does not…
amanape Feb 12, 2025
bc18869
Feat: Add selected branch param to backend (#6508)
malhotra5 Feb 12, 2025
759a03f
Agent session no longer stuck in starting on raised exception (#6703)
tofarr Feb 13, 2025
6c49c5e
Release 0.24.0 (#6689)
mamoodi Feb 13, 2025
3626e29
More effective remote runtime identification (#6714)
tofarr Feb 13, 2025
dc4ca3a
fix: Filter `AgentCondensationObservation` events from agent state (#…
csmith49 Feb 13, 2025
8710951
chore(deps): bump the version-all group across 1 directory with 5 upd…
dependabot[bot] Feb 13, 2025
a418d0d
Evaluation harness: Add agent config option (#6662)
li-boxuan Feb 13, 2025
72237e4
feat(resolver): implement gitlab resolver (#6458)
wtiger9218 Feb 13, 2025
227f2f7
fix: Simplify nested f-string to fix pydoc-markdown parsing (#6717)
malhotra5 Feb 14, 2025
c50bc33
hotfix(Resolver): Workflow definition is out of sync with released pa…
malhotra5 Feb 14, 2025
f16bab0
feat(frontend): Settings screen (#6550)
amanape Feb 14, 2025
1227e50
[Resolver]: Prep env in expectation of release (#6735)
malhotra5 Feb 14, 2025
3ea122f
chore: upgrade `openhands-aci` to 0.2.2 (#6731)
ryanhoangt Feb 14, 2025
93e5441
chore(deps): bump the version-all group across 1 directory with 12 up…
dependabot[bot] Feb 15, 2025
5e469c5
docs: improve docstrings for CLI and config utils (#5398)
young010101 Feb 15, 2025
42ff2b7
Add a sanity test for load_app_config and get_agent_config_arg (#6723)
li-boxuan Feb 15, 2025
67fbf59
A few fixes for TAC evaluation harness (#6586)
li-boxuan Feb 15, 2025
643664a
Show docker build errors (#6695)
kripper Feb 15, 2025
af2e91d
fix: no interaction when clearing poetry cache (#6752)
arpandaze Feb 17, 2025
c6f4ddd
chore(deps): bump the version-all group in /frontend with 4 updates (…
dependabot[bot] Feb 17, 2025
debd000
docs(runtime): fix broken links of benchmarks (#6744)
nbyidiandian Feb 17, 2025
ee0225c
feat: implement optimistic updates for conversation deletion (#6745)
tofarr Feb 17, 2025
a3e134b
Added iterate method and additional tests for search functions (#6756)
tofarr Feb 17, 2025
e5599ef
Better LLM retry behavior (#6557)
rbren Feb 17, 2025
cb9eeae
Fix caps in status message (#6761)
rbren Feb 17, 2025
849d271
Improve SensitiveDataFilter and add comprehensive tests (#6755)
tofarr Feb 17, 2025
2988b10
fix: disable prlimit since limiting --vm breaks nodejs (#6765)
xingyaoww Feb 17, 2025
a1ffdce
Enable the multi conversation UI for all users (#6374)
tofarr Feb 17, 2025
c42c9cb
hotfix(Secrets): Add event stream filter for refreshed secret (#6764)
malhotra5 Feb 17, 2025
2f3bd3d
[Docs]: Cloud Openhands (#6747)
malhotra5 Feb 17, 2025
7aeaac5
Upgrade tree sitter (#6740)
neubig Feb 17, 2025
e5679f6
Update OpenHands Cloud docs with correct permissions and instructions…
mamoodi Feb 17, 2025
dbe2b33
Add selected branch to convo metadata (#6773)
malhotra5 Feb 17, 2025
1ef0d8f
CSS Fixes (#6770)
tofarr Feb 18, 2025
a195ada
docs: add guide for minimum computing and storage requirements (#6575)
abhiejam Feb 18, 2025
a5ea1db
hotfix: Consistent background color (#6786)
amanape Feb 18, 2025
d2398fe
hotfix(frontend): Input set/unset state and disable runtime input (#6…
amanape Feb 18, 2025
ffa5fbe
chore(deps): bump the version-all group across 1 directory with 9 upd…
dependabot[bot] Feb 18, 2025
5ac5e22
hotfix: Conversation panel toggle should change color given state (#6…
amanape Feb 18, 2025
4f00bf4
fix(frontend): Hide modal when in settings page if first time (#6792)
amanape Feb 18, 2025
a4c60d9
feat(SaaS): Billing settings screen (#6495)
amanape Feb 18, 2025
d5ee338
enh: Refactor `Event` -> `Message` pipeline outside of `CodeActAgent`…
csmith49 Feb 18, 2025
bf70965
Add `sysbox` support to remote runtime for eval; Add memory monitor, …
xingyaoww Feb 18, 2025
843f092
Fix type checking errors in resolver directory (#6738)
neubig Feb 19, 2025
ce218a1
Fix `diskcache` breaking CI & eval intermittently (#6817)
ryanhoangt Feb 19, 2025
6108434
Fix mypy errors in storage directory (#6809)
neubig Feb 19, 2025
d0ca8db
fix: Avoid infinite loop with rolling condensers and history truncati…
csmith49 Feb 19, 2025
bb559a2
Fix download workspace zip file event loop hanging (#6722)
diwu-sf Feb 19, 2025
83ecc20
Update openhands-aci to 0.2.5 (#6834)
ryanhoangt Feb 19, 2025
ec1ce2f
feat: better error logging for remote runtime (#6805)
xingyaoww Feb 19, 2025
578bf14
hotfix azure (#6806)
enyst Feb 19, 2025
659ca02
Release 0.25.0 (#6782)
mamoodi Feb 19, 2025
a253243
Update documentation with new settings page (#6716)
mamoodi Feb 19, 2025
336eb98
Clean up NullObservations from the stream (#6260)
enyst Feb 19, 2025
e5fc1af
Refactor I/O utils; allow 'task' command line parameter in cli.py (#6…
enyst Feb 19, 2025
1ddb68e
fix: LLM summarization prompt handles user messages (#6837)
csmith49 Feb 19, 2025
58ff252
hotfix: Remove external link in billing settings UI (#6841)
amanape Feb 20, 2025
507aa39
hotfix: Set proper minimum and maximum defaults that can be entered i…
amanape Feb 20, 2025
dc045d2
Fix: Less squashed logo (#6853)
tofarr Feb 20, 2025
2984ed7
Add conversation age limit configuration (#6763)
rbren Feb 20, 2025
5a8056b
chore(frontend): Standardize custom colors used throughout the app (#…
amanape Feb 20, 2025
85c5141
[Bug]: Fix workflow definition for installation phase of resolver (#6…
malhotra5 Feb 20, 2025
cf727c9
Fix: Simplify prompt caching for new Anthropic API (#6860)
enyst Feb 20, 2025
18d6dee
chore(deps): bump the version-all group across 1 directory with 10 up…
dependabot[bot] Feb 21, 2025
aaf3e08
Docs: Clarify config.toml usage in evaluation harness (#6828)
xingyaoww Feb 21, 2025
316322a
Add enable_history_truncation option to disable history truncation (#…
li-boxuan Feb 21, 2025
58cfd16
Save complete trajectory in presence of history truncation (#6751)
li-boxuan Feb 21, 2025
f8d468c
Fix jumpy conversation panel (#6874)
tofarr Feb 21, 2025
d26d925
chore(frontend): Remove latest conversation text in home screen (#6851)
amanape Feb 21, 2025
fe42b7e
fix: Add missing type annotations in utils/ directory (#6687)
neubig Feb 21, 2025
4915d20
Fix mypy errors in agenthub directory (#6811)
neubig Feb 21, 2025
25b0192
(feat): Enable memory condensation from settings page (#6868)
csmith49 Feb 21, 2025
d36a477
Add info logs for microagent loading and triggering (#6882)
rbren Feb 21, 2025
b32b4be
Fix: File Descriptor leak (#6883)
tofarr Feb 21, 2025
11c37e0
refactor : Improve frontend setup doc and locale error (#6850)
dai-dao Feb 21, 2025
afc7605
Fix: Increase Entropy Requirement for Secret Redaction to Reduce Fals…
tofarr Feb 22, 2025
aa640af
Revert "Fix: File Descriptor leak" (#6887)
enyst Feb 22, 2025
cf1265d
Fix for regression where conversations are not clickable (#6886)
tofarr Feb 22, 2025
c26c747
Keep the first user message by default in condensers (#6888)
enyst Feb 23, 2025
65524f1
Use LLM APIs responses in token counting (#5604)
enyst Feb 23, 2025
cb3edf2
Display session ID in CLI mode
enyst Feb 24, 2025
8cd6e60
hotfix: Fix switch color regression (#6881)
amanape Feb 24, 2025
30d76c3
Daytona Runtime (#6863)
idagelic Feb 24, 2025
974a46c
Fix mypy errors in security/invariant directory (#6908)
neubig Feb 24, 2025
8ba8990
Fix mypy errors in core directory (#6901)
neubig Feb 24, 2025
5a16979
Fix file descriptor leak (#6897)
tofarr Feb 24, 2025
bae3887
Small rename to long term memory (#6914)
enyst Feb 24, 2025
591e0d9
Handle Docker version string with +dfsg1 (#6732)
kripper Feb 24, 2025
3e455ad
chore: Make remote runtime class default to None (#6919)
xingyaoww Feb 24, 2025
03cdded
Replace shebang with /usr/bin/env bash for improved portability (#6876)
mateuszkwiatkowski Feb 24, 2025
2422d70
Revert "Fix file descriptor leak (#6897)" (#6921)
tofarr Feb 24, 2025
584aa7c
add extended generic section (#5932)
celek Feb 24, 2025
53f8dc1
Release 0.26.0 (#6915)
mamoodi Feb 24, 2025
6d248ee
Add documentation checkbox to PR template (#6924)
mamoodi Feb 24, 2025
aebfa76
chore(frontend): Claude 3.7 is visible in dropdown for selection (#6931)
amanape Feb 25, 2025
facd03a
feat(llm): Add Claude 3.7 backend configurations (#6937)
neubig Feb 25, 2025
693da0a
Add pause_closed_runtimes config to pause instead of stop runtimes (#…
rbren Feb 25, 2025
218dc54
[Feat]: Adding endpoint for suggested tasks Openhands could tackle (#…
malhotra5 Feb 26, 2025
e2fb796
fix: `task_str` validation not required for trajectory replay (#6957)
ryanhoangt Feb 26, 2025
9858c89
Refactor llm config from toml and clean up (#6923)
enyst Feb 26, 2025
7fa0959
Add ability to define custom runtime classes (#6955)
raymyers Feb 26, 2025
04175c7
Fix fd leak (#6950)
tofarr Feb 26, 2025
1a9b284
Add selected_repo to command line (#6949)
enyst Feb 26, 2025
a44fd2c
hotfix(frontend): Consistent buttons and their styles throughout the …
amanape Feb 26, 2025
3815cfc
Fix microagent matching to the user message, not previous enhancement…
enyst Feb 26, 2025
4f5c7d2
Refactor agent_config loading from toml (#6967)
enyst Feb 26, 2025
16c54e0
refactor: codeact tools into separate files (#6978)
xingyaoww Feb 26, 2025
288f46a
chore(deps): bump the version-all group across 1 directory with 11 up…
dependabot[bot] Feb 26, 2025
994f4f8
Azure completion_tokens fix (take two) (#6975)
enyst Feb 27, 2025
855ccb8
Add system event listeners for monitoring (#6929)
raymyers Feb 27, 2025
32fda5f
[agent] System message update (#6787)
xingyaoww Feb 27, 2025
39ae2bd
chore(deps): bump react-icons from 5.4.0 to 5.5.0 in /docs in the ver…
dependabot[bot] Feb 27, 2025
2ebc816
[eval] Upgrade SWE-Bench to use official image and latest harness (#6…
xingyaoww Feb 27, 2025
7d0befc
Refactor sandbox and security configurations (#6973)
enyst Feb 27, 2025
cb8cfe0
Fix for error cleaning stale (#6971)
tofarr Feb 27, 2025
d1546f4
Feat out of credits msg (#6969)
tofarr Feb 27, 2025
c839a5f
hotfix(frontend): Truncate long conversation card titles (#7001)
amanape Feb 27, 2025
17dda08
Fix image tag inconsistency in forked-PR workflows (#6998)
zchn Feb 27, 2025
82abb23
Refactor: Moving ConversationInfo to server module (#6981)
tofarr Feb 27, 2025
57a1768
Release 0.27.0 (#6993)
mamoodi Feb 27, 2025
065ab7b
feat: add sound and browser notifications for agent state changes (#6…
xingyaoww Feb 27, 2025
9c48604
Page Refresh now restarts agent loop if status is STOPPED or ERROR (#…
tofarr Feb 27, 2025
242e5b1
add add_agent.md (#6891)
jaybutera Feb 27, 2025
033f004
chore(deps): bump the version-all group across 1 directory with 7 upd…
dependabot[bot] Feb 27, 2025
fd27d4f
Re-add separators between user messages (#7004)
enyst Feb 27, 2025
f2503fe
[agent] Add "thinking" tool only (#6977)
xingyaoww Feb 27, 2025
a74d972
Add Memory Monitor VSCode Extension (#6951)
xingyaoww Feb 27, 2025
9db439f
Separate additional_info template (#6996)
enyst Feb 27, 2025
7612a56
fix: Remove nested git repositories before adding files in SWE-bench …
magic3007 Feb 28, 2025
f5c7942
Refactor to a helper class for the agent's history (ConversationMemor…
enyst Feb 28, 2025
cdd9f58
chore(deps-dev): bump llama-index from 0.12.20 to 0.12.21 in the llam…
dependabot[bot] Feb 28, 2025
8d0e423
[agent] improve finish tool for sonnet 3.7 (#7002)
xingyaoww Feb 28, 2025
80b9552
feat: Adding sandbox property runtime_binding_address to specify whic…
fredysierra Feb 28, 2025
21ef089
Add diff for edit observation and display in UI (#7014)
ryanhoangt Feb 28, 2025
fae10c8
Fix: Update context window exceeded detection (#7024)
csmith49 Feb 28, 2025
8a9fdbe
Support docker_runtime_kwargs dict (#7025)
kripper Feb 28, 2025
69a1c9a
Keycloak changes (#6986)
chuckbutkus Feb 28, 2025
0dec0fb
Bug fixes (#6460)
kripper Feb 28, 2025
979135b
Add Docker microagent for installation and usage (#7027)
xingyaoww Feb 28, 2025
b69ecc5
Add Kubernetes microagent (#7028)
xingyaoww Feb 28, 2025
de09b36
Fix URL for staging stack (#7030)
chuckbutkus Feb 28, 2025
3e4dd38
Structured logging mode (#7034)
raymyers Mar 1, 2025
ea95639
Remove hard error on session reuse (#7026)
rbren Mar 1, 2025
06e6988
Create CITATION.cff (#7037)
kiwamizamurai Mar 1, 2025
96e4831
Separate microagent template (#7041)
enyst Mar 1, 2025
7295344
Update docker.py to support podman (#6778)
Pepsi1x1 Mar 1, 2025
92cc519
Fix argument in swe-bench grading scripts (#7046)
enyst Mar 2, 2025
d6605de
Updates to the ISSUE TRIAGE (#7043)
mamoodi Mar 2, 2025
78db84f
chore: update daytona readme (#7053)
idagelic Mar 2, 2025
9665406
chore: daytona readme quick start verbosity (#7056)
idagelic Mar 2, 2025
d050f48
Fix GitLab CI environment variable check (issue #7050) (#7052)
enyst Mar 2, 2025
3004073
More explicit feedback message about how to report errors to develope…
neubig Mar 2, 2025
869e291
[Refactor] split runtime initialization (create, connect, init) in cl…
enyst Mar 2, 2025
f73edd7
Merge remote-tracking branch 'upstream/main'
adityasoni9998 Mar 3, 2025
d071acf
Update browser tool description
adityasoni9998 Mar 3, 2025
a578cf3
Merge remote-tracking branch 'upstream/main'
adityasoni9998 Mar 13, 2025
35ab168
Merge branch 'main' into eval_fixes
adityasoni9998 Mar 13, 2025
a880f55
Added fixes for file downloads, goto action timeouts, and some other …
adityasoni9998 Mar 13, 2025
a05b39d
Added fixes for output formatting, scrolling, timeouts for actions ot…
adityasoni9998 Mar 14, 2025
b24e34c
Changes for search engine tool and minor error fix in browser process
adityasoni9998 Mar 14, 2025
00d7425
Merge remote-tracking branch 'upstream/main'
adityasoni9998 Mar 14, 2025
d518fc8
Merge branch 'main' into search_engine
adityasoni9998 Mar 14, 2025
929b971
Minor fixes
adityasoni9998 Mar 14, 2025
3a765db
Restore run_infer.sh.
adityasoni9998 Mar 14, 2025
635dc50
Rename env var to BRAVE_API_KEY and clean up dead code
adityasoni9998 Mar 14, 2025
de31294
Merge main into search_engine
openhands-agent Mar 17, 2025
05dabbb
Add SEARCH action type and SearchAction to __all__
openhands-agent Mar 17, 2025
22e13a0
Fix merge conflicts with main
openhands-agent Mar 17, 2025
1c72e2b
Add tests for search engine feature
openhands-agent Mar 17, 2025
2015c13
Address review comments
openhands-agent Mar 17, 2025
bc4e863
Sort imports alphabetically
openhands-agent Mar 17, 2025
2f3b9cf
Add documentation for search engine feature
openhands-agent Mar 17, 2025
b8f04ee
Add dedicated search configuration documentation
openhands-agent Mar 17, 2025
e6ea2c8
Merge remote-tracking branch 'aditya/search_engine'
openhands-agent Mar 17, 2025
48db2a1
Fix docs workflow to run pydoc-markdown from root directory
openhands-agent Mar 17, 2025
4972b20
Allow docs workflow to run on PRs targeting any branch and on forks
openhands-agent Mar 17, 2025
ecff077
Fix pydoc-markdown config to only document openhands module
openhands-agent Mar 17, 2025
c1c7e8d
Change onBrokenLinks to warn to allow build to complete
openhands-agent Mar 17, 2025
7051669
Revert unrelated changes to workflow and config files
openhands-agent Mar 17, 2025
89dd0a9
Update openhands/runtime/search_engine/brave_search.py
adityasoni9998 Mar 18, 2025
966580d
Update openhands/runtime/search_engine/brave_search.py
adityasoni9998 Mar 18, 2025
10297c3
Refactor brave_search.py to use SearchConfig instead of environment v…
openhands-agent Mar 18, 2025
eebf9d3
Merge main into search_engine
openhands-agent Mar 18, 2025
b61b8d5
Fix pre-commit issues
openhands-agent Mar 18, 2025
189dd1f
Add enable_search_engine to SearchConfig and update documentation
openhands-agent Mar 18, 2025
1e8959b
Fix merge conflicts with main branch
openhands-agent Mar 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions openhands/agenthub/codeact_agent/codeact_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def __init__(
codeact_enable_browsing=self.config.codeact_enable_browsing,
codeact_enable_jupyter=self.config.codeact_enable_jupyter,
codeact_enable_llm_editor=self.config.codeact_enable_llm_editor,
codeact_enable_search_engine=self.config.enable_search_engine,
llm=self.llm,
)
logger.debug(
Expand Down
14 changes: 14 additions & 0 deletions openhands/agenthub/codeact_agent/function_calling.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
FinishTool,
IPythonTool,
LLMBasedFileEditTool,
SearchEngineTool,
ThinkTool,
WebReadTool,
create_cmd_run_tool,
Expand All @@ -36,6 +37,7 @@
FileReadAction,
IPythonRunCellAction,
MessageAction,
SearchAction,
)
from openhands.events.event import FileEditSource, FileReadSource
from openhands.events.tool import ToolCallMetadata
Expand Down Expand Up @@ -191,6 +193,15 @@ def response_to_actions(response: ModelResponse) -> list[Action]:
f'Missing required argument "url" in tool call {tool_call.function.name}'
)
action = BrowseURLAction(url=arguments['url'])
# ================================================
# SearchEngineTool (search the web using text queries)
# ================================================
elif tool_call.function.name == SearchEngineTool['function']['name']:
if 'query' not in arguments:
raise FunctionCallNotExistsError(
f'Missing required argument "query" in tool call {tool_call.function.name}'
)
action = SearchAction(query=arguments['query'])
else:
raise FunctionCallNotExistsError(
f'Tool {tool_call.function.name} is not registered. (arguments: {arguments}). Please check the tool name and retry with an existing tool.'
Expand Down Expand Up @@ -223,6 +234,7 @@ def get_tools(
codeact_enable_browsing: bool = False,
codeact_enable_llm_editor: bool = False,
codeact_enable_jupyter: bool = False,
codeact_enable_search_engine: bool = False,
llm: LLM | None = None,
) -> list[ChatCompletionToolParam]:
SIMPLIFIED_TOOL_DESCRIPTION_LLM_SUBSTRS = ['gpt-', 'o3', 'o1']
Expand All @@ -239,6 +251,8 @@ def get_tools(
ThinkTool,
FinishTool,
]
if codeact_enable_search_engine:
tools.append(SearchEngineTool)
if codeact_enable_browsing:
tools.append(WebReadTool)
tools.append(BrowserTool)
Expand Down
2 changes: 2 additions & 0 deletions openhands/agenthub/codeact_agent/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .finish import FinishTool
from .ipython import IPythonTool
from .llm_based_edit import LLMBasedFileEditTool
from .search_engine import SearchEngineTool
from .str_replace_editor import create_str_replace_editor_tool
from .think import ThinkTool
from .web_read import WebReadTool
Expand All @@ -13,6 +14,7 @@
'FinishTool',
'IPythonTool',
'LLMBasedFileEditTool',
'SearchEngineTool',
'create_str_replace_editor_tool',
'WebReadTool',
'ThinkTool',
Expand Down
24 changes: 24 additions & 0 deletions openhands/agenthub/codeact_agent/tools/search_engine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from litellm import ChatCompletionToolParam, ChatCompletionToolParamFunctionChunk

_SEARCH_ENGINE_DESCRIPTION = """Execute a web search query (similar to Google search).

NOTE: When you need to search for information online, please use the `search_engine` tool rather than the `browser` or `web_read` tools. The `search_engine` tool connects directly to a search engine, which will help avoid CAPTCHA challenges that would otherwise block your access.
"""

SearchEngineTool = ChatCompletionToolParam(
type='function',
function=ChatCompletionToolParamFunctionChunk(
name='search_engine',
description=_SEARCH_ENGINE_DESCRIPTION,
parameters={
'type': 'object',
'properties': {
'query': {
'type': 'string',
'description': 'The web search query (must be a non-empty string).',
},
},
'required': ['query'],
},
),
)
6 changes: 5 additions & 1 deletion openhands/core/config/agent_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

from pydantic import BaseModel, Field, ValidationError

from openhands.core.config.condenser_config import CondenserConfig, NoOpCondenserConfig
from openhands.core.config.condenser_config import (
CondenserConfig,
NoOpCondenserConfig,
)
from openhands.core.logger import openhands_logger as logger


Expand Down Expand Up @@ -30,6 +33,7 @@ class AgentConfig(BaseModel):
disabled_microagents: list[str] = Field(default_factory=list)
enable_history_truncation: bool = Field(default=True)
enable_som_visual_browsing: bool = Field(default=False)
enable_search_engine: bool = Field(default=False)
condenser: CondenserConfig = Field(default_factory=NoOpCondenserConfig)

model_config = {'extra': 'forbid'}
Expand Down
3 changes: 3 additions & 0 deletions openhands/core/schema/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ class ActionTypeSchema(BaseModel):
SEND_PR: str = Field(default='send_pr')
"""Send a PR to github."""

SEARCH: str = Field(default='search')
"""Queries a search engine."""

RECALL: str = Field(default='recall')
"""Retrieves content from a user workspace, microagent, or other source."""

Expand Down
3 changes: 3 additions & 0 deletions openhands/core/schema/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ class ObservationTypeSchema(BaseModel):
CONDENSE: str = Field(default='condense')
"""Result of a condensation operation."""

SEARCH: str = Field(default='search')
"""Result of querying a search engine."""

RECALL: str = Field(default='recall')
"""Result of a recall operation. This can be the workspace context, a microagent, or other types of information."""

Expand Down
2 changes: 2 additions & 0 deletions openhands/events/action/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
FileWriteAction,
)
from openhands.events.action.message import MessageAction
from openhands.events.action.search_engine import SearchAction

__all__ = [
'Action',
Expand All @@ -36,5 +37,6 @@
'MessageAction',
'ActionConfirmationStatus',
'AgentThinkAction',
'SearchAction',
'RecallAction',
]
24 changes: 24 additions & 0 deletions openhands/events/action/search_engine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from dataclasses import dataclass
from typing import ClassVar

from openhands.core.schema import ActionType
from openhands.events.action.action import Action


@dataclass
class SearchAction(Action):
query: str
thought: str = ''
action: str = ActionType.SEARCH
runnable: ClassVar[bool] = True

@property
def message(self) -> str:
return f'I am querying the search engine to search for {self.query}'

def __str__(self) -> str:
ret = '**SearchAction**\n'
if self.thought:
ret += f'THOUGHT: {self.thought}\n'
ret += f'QUERY: {self.query}'
return ret
2 changes: 2 additions & 0 deletions openhands/events/observation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
AgentThinkObservation,
RecallObservation,
)
from openhands.events.observation.search_engine import SearchEngineObservation
from openhands.events.observation.browse import BrowserOutputObservation
from openhands.events.observation.commands import (
CmdOutputMetadata,
Expand Down Expand Up @@ -42,6 +43,7 @@
'SuccessObservation',
'UserRejectObservation',
'AgentCondensationObservation',
'SearchEngineObservation',
'RecallObservation',
'RecallType',
]
22 changes: 22 additions & 0 deletions openhands/events/observation/search_engine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from dataclasses import dataclass

from openhands.core.schema import ObservationType
from openhands.events.observation.observation import Observation


@dataclass
class SearchEngineObservation(Observation):
query: str
observation: str = ObservationType.SEARCH

@property
def message(self) -> str:
return f'Searched for: {self.query}'

def __str__(self) -> str:
ret = (
'**SearchEngineObservation**\n'
f'Query: {self.query}\n'
f'Search Results: {self.content}\n'
)
return ret
2 changes: 2 additions & 0 deletions openhands/events/serialization/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
FileWriteAction,
)
from openhands.events.action.message import MessageAction
from openhands.events.action.search_engine import SearchAction

actions = (
NullAction,
Expand All @@ -39,6 +40,7 @@
RecallAction,
ChangeAgentStateAction,
MessageAction,
SearchAction,
)

ACTION_TYPE_TO_CLASS = {action_class.action: action_class for action_class in actions} # type: ignore[attr-defined]
Expand Down
4 changes: 4 additions & 0 deletions openhands/memory/conversation_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
FileEditObservation,
FileReadObservation,
IPythonRunCellObservation,
SearchEngineObservation,
UserRejectObservation,
)
from openhands.events.observation.agent import (
Expand Down Expand Up @@ -385,6 +386,9 @@ def _process_observation(
elif isinstance(obs, AgentCondensationObservation):
text = truncate_content(obs.content, max_message_chars)
message = Message(role='user', content=[TextContent(text=text)])
elif isinstance(obs, SearchEngineObservation):
text = truncate_content(obs.content, max_message_chars)
message = Message(role='user', content=[TextContent(text=text)])
elif (
isinstance(obs, RecallObservation)
and self.agent_config.enable_prompt_extensions
Expand Down
7 changes: 6 additions & 1 deletion openhands/runtime/action_execution_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
FileReadAction,
FileWriteAction,
IPythonRunCellAction,
SearchAction,
)
from openhands.events.event import FileEditSource, FileReadSource
from openhands.events.observation import (
Expand All @@ -56,6 +57,7 @@
from openhands.runtime.browser import browse
from openhands.runtime.browser.browser_env import BrowserEnv
from openhands.runtime.plugins import ALL_PLUGINS, JupyterPlugin, Plugin, VSCodePlugin
from openhands.runtime.search_engine.brave_search import search
from openhands.runtime.utils.bash import BashSession
from openhands.runtime.utils.files import insert_lines, read_lines
from openhands.runtime.utils.memory_monitor import MemoryMonitor
Expand Down Expand Up @@ -163,7 +165,6 @@ def __init__(
self.start_time = time.time()
self.last_execution_time = self.start_time
self._initialized = False

self.max_memory_gb: int | None = None
if _override_max_memory_gb := os.environ.get('RUNTIME_MAX_MEMORY_GB', None):
self.max_memory_gb = int(_override_max_memory_gb)
Expand Down Expand Up @@ -464,6 +465,10 @@ async def browse(self, action: BrowseURLAction) -> Observation:
async def browse_interactive(self, action: BrowseInteractiveAction) -> Observation:
return await browse(action, self.browser)

async def search(self, action: SearchAction) -> Observation:
obs = await call_sync_from_async(search, action)
return obs

def close(self):
self.memory_monitor.stop_monitoring()
if self.bash_session is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
FileReadAction,
FileWriteAction,
IPythonRunCellAction,
SearchAction,
)
from openhands.events.action.action import Action
from openhands.events.action.files import FileEditSource
Expand Down Expand Up @@ -297,6 +298,9 @@ def browse(self, action: BrowseURLAction) -> Observation:
def browse_interactive(self, action: BrowseInteractiveAction) -> Observation:
return self.send_action_for_execution(action)

def search(self, action: SearchAction) -> Observation:
return self.send_action_for_execution(action)

def close(self) -> None:
# Make sure we don't close the session multiple times
# Can happen in evaluation
Expand Down
3 changes: 3 additions & 0 deletions openhands/runtime/search_engine/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from openhands.runtime.search_engine.brave_search import search

__all__ = ['search']
Loading
Loading