* This has been a headache for a long time, and we had #1071 and #1100 with the hope to fix the inconsistent behaviour across linters and environments. However, we recently found out that double-quote-string-fixer plugin in pre-commit-hook has inconsistent behaviour on python 3.11 and 3.12. See discussion here. This is sad because while this plugin enforces single quote behaviour with 3.11, it doesn't always enforce so with 3.12. Specifically, with fstr syntax, this plugin allows both single quotes and double quotes with python 3.12.
The problem is, some developers have black linter installed/integrated with their IDE, which is probably the most popular linter in python world (ranked by GitHub stars). This linter insists on always using double quotes. Now we have black and double-quote-string-fixer fight each other (iff the developer uses python 3.12) for some quotes (fstr syntax).
After a lot of research, I couldn't find a way to enforce single quote behaviour without introducing a new dependency, flake8, together with a plugin for it to enforce quotes' behavior. I believe it's better off introducing the more popular black if we have to introduce a new linter. Since black and autopep8 sometimes fight each other, and they mostly overlap, I further remove autopep8.
The unfortunate consequence of this PR is that I had to revert all single quotes back to double quotes. This might cause some inconvenience to existing PRs as they have to resolve conflicts, but I believe the headache will be gone soon. That being said, I am open to abandon this PR if anyone has a better idea to solve the headache.
* Remove black
* Prevent black from changing quotes
* Use flake8 to enforce single quotes
* Fix quotes in config.py
* Add back autopep8
* Add make lint to run linters
* 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>
* test(frontend): add unit tests for getCachedConfig
* test(frontend): add unit tests for getCachedConfig
* add unit test for the useTypingEffect hook
* add unit test for the useInputComposition hook
* create unit test for auth service
* remove outdated and failing component test
* create unit test for session service
* break down saveSettings into smaller functions for testability and create unit test for new mergeAndUpdateSettings
---------
Co-authored-by: Robert Brennan <accounts@rbren.io>
* added retry
* filtered API errors
* fixed decorator
* used litellm retries
* added custom backoff too
* Apply suggestions from code review
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
* added custom backoff too
* retried only if certain Exceptions
---------
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
Co-authored-by: Robert Brennan <accounts@rbren.io>
* refactor: Added docstrings to BackgroundCommand(#1083)
* refactor: Added Docstring with example for BackgroundCommand
* fixed typo
Co-authored-by: Graham Neubig <neubig@gmail.com>
---------
Co-authored-by: Graham Neubig <neubig@gmail.com>
* Fix pre-commit and linter versions to avoid surprise
To avoid surprising results on GitHub Actions, e.g. a new release of pre-commit starts to
reject all PRs, fix it to the latest version, 3.7.0. This PR also fixes ruff and mypy
versions in pyproject.toml since we very likely don't really need latest upgrades from
linters, and upgrades can always bring surprise.
* pre-commit-config: Use v0.3.7 for Ruff as in pyproject.toml
* 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
* Tweak for weak llms
* Update to the latest commits
* Update to the latest commits
* Fix lint errors
* Remove merge artifact
---------
Co-authored-by: Jim Su <jimsu@protonmail.com>
* 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>
* Fix: local files in the browser (at least for Windows)
The Browser works for screenshoting websites, but when the LLM tries to display a local file that he created, it can't access the full directory on Windows.
* Update browse.py
---------
Co-authored-by: Robert Brennan <accounts@rbren.io>