29 Commits

Author SHA1 Message Date
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
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
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
Robert Brennan
af262c17f1
properly exit loop on finish (#1210) 2024-04-18 11:03:29 -04:00
Leo
1356da8795
feat: support controlling agent task state. (#1094)
* feat: support controlling agent task state.

* feat: add agent task state to agent status bar.

* feat: add agent task control bar to FE.

* Remove stop agent task action.

* Merge pause and resume buttons into one button; Add loading and disabled status for action buttons.

* Apply suggestions from code review

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-04-18 11:09:00 +00:00
Yoni
c8c1eed5be
Reset agent between tasks (#1182)
Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-04-17 12:13:54 -04:00
Robert Brennan
a663302ba2
Refactor actions a bit (#1165)
* refactor to action_manager

* make all actions awaitable

* move task logic into tasks

* Update opendevin/action/tasks.py
2024-04-16 21:29:38 -04:00
Engel Nyst
1115b60a74
Logging additions and fixes (#1139)
* Refactor print_to_color into a color formatter

misc fixes

catch ValueErrors and others from Router initialization

add default methods

* Tweak console log formatting, clean up after rebasing exceptions out

* Fix prompts/responses

* clean up

* keep regular colors when no msg_type

* fix filename

* handle file log first

* happy mypy

* ok, mypy

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-04-16 12:55:22 -04:00
Robert Brennan
342302ceef
Add Docker DOOD setup (#1023)
* simplified get

* resolved merge conflicts

* removed default param for get

* add dood setup

* add readme

* better build process

* multi-stage build

* revert makefile

* rm entrypoint.sh

* adjust ssh box for docker

* update readme

* update readme

* fix hostname

* change workspace setting

* add workspace_mount_base

* fixes for workspace dir

* clean up frontend

* refactor dockerfile

* try download.py

* change docker order a bit

* remove workspace_dir from frontend settings

* fix merge issues

* Update opendevin/config.py

* remove relpath logic from server

* rename workspace_mount_base to workspace_base

* remove workspace dir plumbing for now

* delint

* delint

* move workspace base dir

* remove refs to workspace_dir

* factor out constant

* fix local directory usage

* dont require dir

* fix docs

* fix arg parsing for task

* implement WORKSPACE_MOUNT_PATH

* fix workspace dir

* fix ports

* fix merge issues

* add makefile

* revert settingsService

* fix string

* Add address

* Update Dockerfile

* Update local_box.py

* fix lint

* move to port 3000

---------

Co-authored-by: மனோஜ்குமார் பழனிச்சாமி <smartmanoj42857@gmail.com>
Co-authored-by: enyst <engel.nyst@gmail.com>
2024-04-15 14:19:02 +02:00
Xia Zhenhua
8450b47609
fix: action.run executed twice if action is not awaitable (#1021) 2024-04-15 12:12:07 +00:00
Boxuan Li
53f95056de
Revamp Exception handling (#1080)
* Revamp exception handling

* Agent controller: sleep 3 seconds if APIConnection error

* Fix AuthenticationError capture

* Revert unrelated style fixes

* Add type enforcement for action_from_dict call
2024-04-14 06:51:17 +02:00
Boxuan Li
dd32fa6f4a
Unify linter behaviour across CI and pre-commit-hook (#1071)
* CI: Add autopep8 linter

Currently, we have autopep8 as part of pre-commit-hook. To ensure
consistent behaviour, we should have it in CI as well.

Moreover, pre-commit-hook contains a double-quote-string-fixer hook
which changes all double quotes to single quotes, but I do observe
some PRs with massive changes that do the opposite way. I suspect
that these authors 1) disable or circumvent the pre-commit-hook,
and 2) have other linters such as black in their IDE, which
automatically change all single quotes to double quotes. This
has caused a lot of unnecessary diff, made review really hard,
and led to a lot of conflicts.

* Use -diff for autopep8

* autopep8: Freeze version in CI

* Ultimate fix

* Remove pep8 long line disable workaround

* Fix lint.yml

* Fix all files under opendevin and agenthub
2024-04-14 00:19:56 -04:00
Boxuan Li
e0c7492609
Traffic Control: Add new config MAX_CHARS (#1015)
* Add new config MAX_CHARS

* Fix mypy linting issues
2024-04-12 19:01:52 +00:00
மனோஜ்குமார் பழனிச்சாமி
70534f203e
simplified get (#962)
* simplified get

* resolved merge conflicts

* removed default param for get

* Update opendevin/config.py

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-04-12 09:18:41 -04:00
Leo
494a1b6872
Feat add agent manager (#904)
* feat: add agent manager to manage all agents;

* extract the host ssh port to prevent conflict.

* clean all containers with prefix is sandbox-

* merge from upstream/main

* merge from upstream/main

* Update frontend/src/state/settingsSlice.ts

* Update opendevin/sandbox/ssh_box.py

* Update opendevin/sandbox/exec_box.py

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-04-12 07:53:47 -04:00
Robert Brennan
7f5d9c7d92
Update agent_controller.py (#1004) 2024-04-10 19:28:30 -04:00
Robert Brennan
9846e24299
Fix logger import (#985)
* fix logger import
* fix mypy version
* make mypy happy (#994)

---------

Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2024-04-10 21:48:40 +02:00
Engel Nyst
8ab9c6fb86
Revert the use of Router, good ole completion works. (#910)
* Revert the use of Router, good ole completion works.

* Stopgap exception message

* Get the updated dependencies.
2024-04-08 22:21:30 -04:00
Engel Nyst
4b4ce20f2d
Add logging (#660)
* Add logging config for the app and for llm debug

* - switch to python, add special llm logger

- add logging to sandbox.py

- add session.py

- add a directory per session

- small additions for AgentController

* - add sys log, but try to exclude litellm; log llm responses as json

* Update opendevin/_logging.py

Co-authored-by: Anas DORBANI <95044293+dorbanianas@users.noreply.github.com>

* - use standard file naming
- quick pass through a few more files

* fix ruff

* clean up

* mypy types

* make mypy happy

---------

Co-authored-by: Anas DORBANI <95044293+dorbanianas@users.noreply.github.com>
2024-04-07 05:43:25 +02:00
Leo
adbcfefd8c
feat: websocket connection management and sandbox bound to session. (#559)
* feat: websocket connection management and sandbox bound to session.

* fix: set default value to id

* feat: add session management.

* fix for mypy

* fix for mypy

* fix the pnpm-lock.

* fix the default model is empty will throw error.
2024-04-05 12:19:52 -05:00
Engel Nyst
66031a67ba
Make max_iterations configurable (#676) 2024-04-03 16:28:56 -04:00
universea
5f29df088a
Add playwright and show screenshoots on web browser (#547)
* add playwright and show screenshoots on web browser

* fix lints

* fix lint issues

* fix lint issues

* fix lint issues

* fix lint issues

* fix lint issues
2024-04-02 18:46:01 -04:00
Xingyao Wang
16fe8303e7
support disable color printing via environment variable in config.toml (#545) 2024-04-02 07:21:30 -04:00
Xingyao Wang
fe736013cc
Print with color in controller (#176)
* and color-coded printing action abd obs

* fix langchains agent's observation

* remove color printing from codeact agent

* fix mypy

* fix ruff

* resolve conflict

* fix ruff
2024-04-02 13:13:19 +08:00
George Balch
a9f469f0e7
fix: Handle api key error (#488)
* Propagate exception up to task coroutine instead of breaking the for loop manually, await coroutine so exception is returned to caller

* Remove redundant traceback as is already called in step function lower on the stack

* Change message as error could occur in middle of task also

* Fix linter errors

* Raise exception only on api key error

* Add TODO
2024-04-01 22:49:06 -04:00
Yufan Song
2d8cb973a8
add container image (#408) 2024-03-30 14:58:31 -04:00
Robert Brennan
a6f0c066b5
Implement Planning (#267)
* add outline of agent

* add plan class

* add initial prompt

* plumb plan through a bit

* refactor state management

* move task into state

* fix errors

* add prompt parsing

* add task actions

* better serialization

* more serialization hacks

* fix fn

* fix recursion error

* refine prompt

* better description of run

* update prompt

* tighter planning mechanism

* prompt tweaks

* fix merge

* fix lint issues

* add error handling for tasks

* add graphic for plans

* remove base_path from file actions

* rename subtask to task

* better planning

* prompt updates for verification

* remove verify field

* ruff

* mypy

* fix actions
2024-03-29 11:47:29 -04:00
Robert Brennan
0322693ec2
remove base_path from file actions (#320)
* remove base_path from file actions

* unused imports
2024-03-29 11:55:25 +08:00
Yufan Song
e6633e6aae
refactor (#318) 2024-03-28 15:51:28 -04:00