199 Commits

Author SHA1 Message Date
Alex Bäuerle
cd58194d2a
docs(docs): start implementing docs website (#1372)
* docs(docs): start implementing docs website

* update video url

* add autogenerated codebase docs for backend

* precommit

* update links

* fix config and video

* gh actions

* rename

* workdirs

* path

* path

* fix doc1

* redo markdown

* docs

* change main folder name

* simplify readme

* add back architecture

* Fix lint errors

* lint

* update poetry lock

---------

Co-authored-by: Jim Su <jimsu@protonmail.com>
2024-04-29 10:00:51 -07:00
Christian Balcom
24b71927c3
fix(backend) changes to improve Command-R+ behavior, plus file i/o error improvements, attempt 2 (#1417)
* Some improvements to prompts, some better exception handling for various file IO errors, added timeout and max return token configurations for the LLM api.

* More monologue prompt improvements

* Dynamically set username provided in prompt.

* Remove absolute paths from llm prompts, fetch working directory from sandbox when resolving paths in fileio operations, add customizable timeout for bash commands, mention said timeout in llm prompt.

* Switched ssh_box to disabling tty echo and removed the logic attempting to delete it from the response afterwards, fixed get_working_directory for ssh_box.

* Update prompts in integration tests to match monologue agent changes.

* Minor tweaks to make merge easier.

* Another minor prompt tweak, better invalid json handling.

* Fix lint error

* More catch-up to fix lint errors introduced by merge.

* Force WORKSPACE_MOUNT_PATH_IN_SANDBOX to match WORKSPACE_MOUNT_PATH in local sandbox mode, combine exception handlers in prompts.py.

---------

Co-authored-by: Jim Su <jimsu@protonmail.com>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2024-04-28 21:58:53 -04:00
Graham Neubig
a5f61caae9
Add actions for github push and send PR (#1415)
* Added a push action

* Tests

* Add tests

* Fix capitalization

* Update

* Fix typo

* Fix integration tests

* Added poetry.lock

* Set lock

* Fix action parsing

* Update integration test output

* Updated prompt

* Update integration test

* Add github token to default config

---------

Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2024-04-29 00:56:23 +00:00
Xingyao Wang
a7e42ff0a3
allow interaction with local box (#1429) 2024-04-28 23:24:01 +08:00
Robert Brennan
9c9aee29f0
Revert "fix(backend) changes to improve Command-R+ behavior, plus file i/o er…" (#1405)
This reverts commit 44aea95ddee766dd25d20aa6eeab8759d383966f.
2024-04-27 08:57:04 -04:00
Christian Balcom
546be7ca8e
Handle Unicode errors (#1388)
* Add errors for non-unicode file data or command return, trim excessively long command returns.

* Fix lint issue.

* Fix lint issue (try 2).

* Realized that prompts were trimmed elsewhere and dropped the new addition.
2024-04-27 08:15:16 -04:00
Christian Balcom
44aea95dde
fix(backend) changes to improve Command-R+ behavior, plus file i/o error improvements. (#1347)
* Some improvements to prompts, some better exception handling for various file IO errors, added timeout and max return token configurations for the LLM api.

* More monologue prompt improvements

* Dynamically set username provided in prompt.

* Remove absolute paths from llm prompts, fetch working directory from sandbox when resolving paths in fileio operations, add customizable timeout for bash commands, mention said timeout in llm prompt.

* Switched ssh_box to disabling tty echo and removed the logic attempting to delete it from the response afterwards, fixed get_working_directory for ssh_box.

* Update prompts in integration tests to match monologue agent changes.

* Minor tweaks to make merge easier.

* Another minor prompt tweak, better invalid json handling.

* Fix lint error

* More catch-up to fix lint errors introduced by merge.

---------

Co-authored-by: Jim Su <jimsu@protonmail.com>
Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-04-27 11:58:34 +00:00
Boxuan Li
7d5856e36b
local sandbox: Create workspace base during init (#1377) 2024-04-27 11:50:58 +08:00
Robert Brennan
fd9e598136
add options for controlling memory (#1364)
* add options for controlling memory

* Update agenthub/monologue_agent/utils/memory.py

Co-authored-by: Jim Su <jimsu@protonmail.com>

* move memory initialization switch back

* fix lint

* fix type

---------

Co-authored-by: Jim Su <jimsu@protonmail.com>
2024-04-26 21:53:54 +00:00
Jim Su
c0adb55bfa
Fix mock server (#1392) 2024-04-26 17:16:29 -04:00
Boxuan Li
831e934dab
Refactor: Use enum for config keys (#1376) 2024-04-26 10:26:01 -04:00
Robert Brennan
f407382a5a
handle IsADirectory errors (#1365) 2024-04-25 15:15:06 -04:00
Xingyao Wang
110e7f0c4c
make WORKSPACE_MOUNT_PATH as abspath (#1361) 2024-04-25 13:31:05 -04:00
Boxuan Li
e7b5ddfe06
Add integration test framework with mock llm (#1301)
* Add integration test framework with mock llm

* Fix MonologueAgent and PlannerAgent tests

* Remove adhoc logging

* Use existing logs

* Fix SWEAgent and PlannerAgent

* Check-in test log files

* conftest: look up under test name folder only

* Add docstring to conftest

* Finish dev doc

* Avoid non-determinism

* Remove dependency on llm embedding model

* Init embedding model only for MonologueAgent

* Add adhoc fix for sandbox discrepancy

* Test ssh and exec sandboxes

* CI: fix missing sandbox type

* conftest: Remove hack

* Reword comment for TODO
2024-04-25 10:56:53 -04:00
Leo
bf5a2afd83
Refactor browser style. (#1358)
* delete useless assets and css class.
* add waiting for page loaded (networkidle with 3s timeout)
2024-04-25 10:48:19 -04:00
Xingyao Wang
88397e0469
add back cache dir and default to /tmp (#1359) 2024-04-25 10:46:15 -04:00
Boxuan Li
c45e2ae4d9
Fix output strip behavior discrepancy among sandboxes (#1355) 2024-04-25 14:38:01 +08:00
Robert Brennan
bc84482c48
Update ssh_box.py (#1346) 2024-04-24 18:30:05 -04:00
Robert Brennan
6972ea0089
Go back to no host network by default (#1349) 2024-04-24 18:29:30 -04:00
Robert Brennan
43214a69a0
Better version management (#1313)
* better version management

* Update opendevin/config.py
2024-04-24 21:53:49 +00:00
Engel Nyst
2318ceae35
Send JSON parsing exceptions to LLM (#1342)
* Add malformed JSON where we don't even start finding actions

* Send any exception during JSON parsing back

* Use specific exceptions

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-04-24 17:51:09 -04:00
Engel Nyst
f4ce7e7862
Update description (#1337)
* Update base.py

* Update opendevin/action/base.py

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-04-24 17:50:51 -04:00
Engel Nyst
bd470e8076
Send the permission error to the llm (#1343)
* Send the permission error to the llm

* Update opendevin/action/fileop.py

* Update opendevin/action/fileop.py

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-04-24 17:50:32 -04:00
Xingyao Wang
fde0392457
Default for sandbox to use the host network (#1334)
* default to use host network

* make host network as default
2024-04-24 21:48:11 +00:00
Robert Brennan
1e95fa435d
Microagents and Delegation (#1238)
* basic microagent structure

* start on jinja

* add instructions parser

* add action instructions

* add history instructions

* fix a few issues

* fix a few issues

* fix issues

* fix agent encoding

* fix up anon class

* prompt to fix errors

* less debug info when errors happen

* add another traceback

* add output to finish

* fix math prompt

* fix pg prompt

* fix up json prompt

* fix math prompt

* fix math prompt

* fix repo prompt

* fix up repo explorer

* update lock

* revert changes to agent_controller

* refactor microagent registration a bit

* create delegate action

* delegation working

* add finish action to manager

* fix tests

* rename microagents registry

* rename fn

* logspam

* add metadata to manager agent

* fix message

* move repo_explorer

* add delegator agent

* rename agent_definition

* fix up input-output plumbing

* fix tests

* Update agenthub/micro/math_agent/agent.yaml

Co-authored-by: Boxuan Li <liboxuan@connect.hku.hk>

* Update agenthub/delegator_agent/prompt.py

Co-authored-by: Boxuan Li <liboxuan@connect.hku.hk>

* Update agenthub/delegator_agent/prompt.py

Co-authored-by: Boxuan Li <liboxuan@connect.hku.hk>

* remove prompt.py

* fix lint

* Update agenthub/micro/postgres_agent/agent.yaml

Co-authored-by: Boxuan Li <liboxuan@connect.hku.hk>

* Update agenthub/micro/postgres_agent/agent.yaml

Co-authored-by: Boxuan Li <liboxuan@connect.hku.hk>

* fix error

---------

Co-authored-by: Boxuan Li <liboxuan@connect.hku.hk>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2024-04-24 17:46:14 -04:00
Robert Brennan
236b7bf6ea
refactor error handling so not all exceptions are caught (#1296)
* refactor error handling so not all exceptions are caught

* revert

* Send the failed decoding back to the LLM (#1322)

* fix quotes

---------

Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2024-04-24 16:44:06 +00:00
Xingyao Wang
e6ecbd5510
fix(sandbox): mount_dir for ssh_box (#1333)
* fix mount_dir for ssh_box

* move logic to config.py
2024-04-24 12:10:14 -04:00
Christian Balcom
b48f440476
Add sanitization against malformed paths used in fileop actions. Added tests for resolve_path. (#1338) 2024-04-24 15:46:16 +00:00
Xingyao Wang
a0e8fcb19a
Add SWE-agent tools as sandbox plugins (#1305)
* add initial version of swe-agent plugin;

* rename swe cursors

* split setup script into two and create two requirements

* print SWE-agent command documentation

* update swe-agent to default to no custom docs

* update dockerfile with dependency from swe-agent

* make env setup a separate script for .bashrc source

* fix swe-tool plugins;
add missing _split_string

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-04-24 22:50:14 +08:00
Xingyao Wang
3eea6de546
fix(sandbox): SSH box .execute misalign issue (#1304)
* fix weird behavior of pxssh where the output would not flush correctly

* make ssh box can handle exit_code properly as well

* Update opendevin/sandbox/docker/ssh_box.py

Co-authored-by: Robert Brennan <accounts@rbren.io>

* fix typo

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-04-24 12:27:44 +08:00
Engel Nyst
d1551c3097
Add checks to stop infinite loops (#1293)
* Add checks to stop infinite loops

* Send an AgentErrorObservation for the user to see an oops loop

* (NullAction, Obs) problem should be (NullAction, error Obs)

* Merge the two with AgentErrorObs.

* Update opendevin/controller/agent_controller.py
2024-04-23 17:52:32 -04:00
Vasek Mlejnsky
a2a86e84f0
Integrate copy_to in E2BBox (#1298)
* initialize plugin definition

* initialize plugin definition

* simplify mixin

* further improve plugin mixin

* add cache dir for pip

* support clean up cache

* add script for setup jupyter and execution server

* integrate JupyterRequirement to ssh_box

* source bashrc at the end of plugin load

* add execute_cli that accept code via stdin

* make JUPYTER_EXEC_SERVER_PORT configurable via env var

* increase background cmd sleep time

* Update opendevin/sandbox/plugins/mixin.py

Co-authored-by: Robert Brennan <accounts@rbren.io>

* add mixin to base class

* make jupyter requirement a dataclass

* source plugins only when >0 requirements

* add `sandbox_plugins` for each agent & have controller take care of it

* update build.sh to make logs available in /opendevin/logs

* switch to use config for lib and cache dir

* fix permission issue with /workspace

* use python to implement execute_cli to avoid stdin escape issue

* wait until jupyter is avaialble

* support plugin via copying instead of mounting

* Fix linter issue

---------

Co-authored-by: Xingyao Wang <xingyao6@illinois.edu>
Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-04-23 07:55:27 -04:00
Xingyao Wang
fc5e075ea0
feat(sandbox): Implementation of Sandbox Plugin to Support Jupyter (#1255)
* initialize plugin definition

* initialize plugin definition

* simplify mixin

* further improve plugin mixin

* add cache dir for pip

* support clean up cache

* add script for setup jupyter and execution server

* integrate JupyterRequirement to ssh_box

* source bashrc at the end of plugin load

* add execute_cli that accept code via stdin

* make JUPYTER_EXEC_SERVER_PORT configurable via env var

* increase background cmd sleep time

* Update opendevin/sandbox/plugins/mixin.py

Co-authored-by: Robert Brennan <accounts@rbren.io>

* add mixin to base class

* make jupyter requirement a dataclass

* source plugins only when >0 requirements

* add `sandbox_plugins` for each agent & have controller take care of it

* update build.sh to make logs available in /opendevin/logs

* switch to use config for lib and cache dir

* fix permission issue with /workspace

* use python to implement execute_cli to avoid stdin escape issue

* wait until jupyter is avaialble

* support plugin via copying instead of mounting

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-04-23 08:45:53 +08:00
Engel Nyst
39a851bd95
Message property sent to llm (#1273)
* Add to_memory for observations

* Don't send 'message' property to the llm from observation; fix other agents
2024-04-22 12:14:45 -04:00
Engel Nyst
464bf7ee23
Tweak connect exceptions (#1120)
* Clean up manual sleep

* Add default retries and document them.

* Add doctrings to llm

* Add exponential backoff for rate limiting errors

* Get embeddings for the action and its own content, not the user message

* Add a few bad exceptions to stop loop

* Stop loop when the step has no action

* Add action with content, no message, to history

* make retry settings customizable

* fix condense to stop the loop for the same reasons as completion

* Add 500-504 exception to retries

* document the retry variables

* Add retries and limits for embeddings. Replaces llama-index hard-coded decorator.

* Rename to retry_min_wait and retry_max_wait
2024-04-22 04:00:01 +02:00
yaroslavMain
454e9613b0
Add pydantic (#868)
* Update action.py

* Update observation.py

* Update observation.py

* Update action.py

* Update observation.py

* Update opendevin/schema/action.py

* Update action.py

* Update observation.py

* Update action.py

* Update observation.py

* Update observation.py

* Update observation.py

* Update observation.py

* Update action.py

* Update action.py

* Update action.py

* Update observation.py

* Update observation.py

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2024-04-21 19:41:04 +00:00
Xingyao Wang
dffbeec45a
Add SANDBOX_WORKSPACE_DIR into config (#1266)
* Add SANDBOX_WORKSPACE_DIR into config

* Add SANDBOX_WORKSPACE_DIR into config

* fix occurence of /workspace
2024-04-21 15:17:10 -04:00
Leo
0e572c3e41
feat: support tls. #1234 (#1248)
* feat: support tls.

* update the frontend README.

* Update frontend/README.md

Co-authored-by: Boxuan Li <liboxuan@connect.hku.hk>

---------

Co-authored-by: Boxuan Li <liboxuan@connect.hku.hk>
2024-04-21 14:50:48 -04:00
Boxuan Li
cf3372a5fe
Fix arg parser help message display (#1247)
* Fix arg parser help message display

* Add unittest
2024-04-20 09:23:19 -04:00
மனோஜ்குமார் பழனிச்சாமி
0356f6ec89
Azure LLM fix (#1227)
* azure embedding fix

* corrected embedding config

* fixed doc
2024-04-20 01:05:14 +02:00
Robert Brennan
7675b3ca34
fix manager ref (#1241) 2024-04-19 16:18:30 -04:00
Robert Brennan
d61fdb8bba
less debug info when errors happen (#1233)
* less debug info when errors happen

* add another traceback

* better prompt debugs

* remove unuse arg
2024-04-19 15:15:38 -04:00
Vasek Mlejnsky
76b81ca0ed
Integrate E2B sandbox as an alternative to a Docker container (#727)
* add e2b sandbox [wip]

* Install e2b package

* Add basic E2B sandbox integration

* Update dependencies and fix command execution in E2BSandbox

* Udpate e2b

* Add comment

* Lint

* Remove unnecessary type conversion

* Lint

* Fix linting

* Resolve comments

* Update opendevin/action/fileop.py

* Update opendevin/action/fileop.py

* Fix log

* Update E2B readme

* poetry lock

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-04-19 14:21:58 -04:00
Alex Bäuerle
e6d91affc6
refactor: remove the previously implemented shallow file fetch (#1231)
Removing because the new filetree implementation is fast enough as is and fetching partial trees adds a lot of complexity that we probably don't need. For example, if we still want to automatically open the tree location of a changed file, we need to make sure all the parent folders are fetched first.
2024-04-19 17:25:40 +00:00
Alex Bäuerle
959d91c9d6
feat: implement basic planner UI (#1173)
* feat: implement basic planner UI

* update planner UI

* lint

* fix type

* fixes

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-04-19 13:09:14 -04:00
Xingyao Wang
871eefe801
Revert "feat(sandbox): Add Jupyter Kernel for Interactive Python Interpreter for Sandbox (#1215)" (#1229)
This reverts commit 492feecb67e825e9cf27d363c1de27edd65accc7.
2024-04-19 16:49:24 +00:00
Xingyao Wang
492feecb67
feat(sandbox): Add Jupyter Kernel for Interactive Python Interpreter for Sandbox (#1215)
* add initial version of py interpreter

* fix bug

* fix async issue

* remove debugging print statement

* initialize kernel & update printing

* fix port mapping

* uncomment debug lines

* fix poetry lock

* make jupyter py interpreter into a subclass
2024-04-19 16:55:51 +08:00
Engel Nyst
fe3d4b129d
Path in observation (#1216)
* create observation with the workspace path

* rename the whole path whole_path
2024-04-18 15:06:51 -04:00
RaGe
2bf34093b0
Add new endpoint for shallow file listing - backend only (#1174)
* Add /api/list-files endpoint

Returns files at the path specified by query parameter relpath, relative to base path, with a depth of 1

* Add method in services
2024-04-18 11:22:39 -07:00
Robert Brennan
9e85550b46
fix initialize (#1214) 2024-04-18 13:19:33 -04:00