Add workspace setting in UI
Resolves #1145.
Thanks for taking this on! Excited to add this bit
Codecov Report
Attention: Patch coverage is 63.15789% with 14 lines in your changes are missing coverage. Please review.
:exclamation: No coverage uploaded for pull request base (
main@755a407). Click here to learn what that means.
| Files | Patch % | Lines |
|---|---|---|
| opendevin/server/listen.py | 0.00% | 8 Missing :warning: |
| opendevin/runtime/files.py | 0.00% | 5 Missing :warning: |
| opendevin/server/agent/agent.py | 0.00% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #1448 +/- ##
=======================================
Coverage ? 64.24%
=======================================
Files ? 99
Lines ? 4072
Branches ? 0
=======================================
Hits ? 2616
Misses ? 1456
Partials ? 0
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hey @johnnyaug , thanks for this! It seems that this is now out of sync, so if you could bring it back in sync with main we can take a look.
Hey @neubig, sure - on it
Sorry @johnnyaug I should have tried to get this in before my PR.
The plumbing is a little different now--the runtime is instantiated outside the AgentController. Hopefully not too much work to merge
@rbren, no worries - I hope this cuts it, please take another look
@johnnyaug unfortunately the agent appears to continue editing the root directory even when I select a subdirectory...
Every time we save new settings, the agent controller and runtime are recreated--maybe instead of setting subdir on the fly, it should be passed directly into the sandbox init?
@rbren, could you please take another look?
Hi @johnnyaug, I have been tasked with testing this PR and will try to keep on top of testing it when you make changes. I'm running on MacOS. Here is my current structure:
- workspace root
- test-dir
- booboo.rb
- deep dir
- another test-dir
- file.rb
- test-dir
There's a couple of issues:
- A lot of the times when I select another folder, it gives me this error
- If I switch to test-dir folder and then to deep dir folder, it creates a deep dir folder at the workspace root. This seems to be an issue.
- If I want to select deep dir, I first have to select test-dir then let the Agent initialize. Then select deep dir because this is two levels deep. In general what happens when I want to select a directory 6 levels deep. CC: @rbren
I tested the Workspace root and one level deep directories and it works well.
What I suggest is in the PR description, you describe how you expect the behavior of setting a new workspace directory should work. For example how you expect setting a directory one level deep vs three level deep should work. Make sure maintainers approve of that and then work out the issues. I will continue testing it as you resolve the issues as this seems like it would be very valuable.
IMO we only really need to go one directory deep here. I think the best experience would be:
- Start in the root dir
- In settings, provide options for:
- /
- /foo
- /bar
- etc
IMO we only really need to go one directory deep here. I think the best experience would be:
Start in the root dir
In settings, provide options for:
- /
- /foo
- /bar
- etc
@johnnyaug in that case things will be simpler. So if you have this directory structure:
- Workspace Root
- sub-folder-1
- deep-folder-1
- sub-folder-2
- deep-folder-2
- sub-folder-3
- sub-folder-1
The UI will always remain the same and always shows:
- Workspace Root
- sub-folder-1
- sub-folder-2
- sub-folder-3
Even if you select sub-folder-1.
I believe you have most of it working. Just need to address the error and always only show the level1 folders.
@rbren @mamoodi Just so we're all on the same page - the feature allows exactly what @rbren is suggesting and allows to go only one level deep in the setting. When using the file explorer, you can go as many levels deep as you like, but this is unrelated to this feature.
@mamoodi Hey and thank you for looking into it! I added the PR description, I hope this makes sense.
In your comments, when you refer to "selecting another directory" I wasn't sure whether you meant using the new subdirectory setting, or selecting using the file explorer. Please try to be unambiguous about it in the future.
Anyway I will take a look at the issues you're describing and report back here.
@johnnyaug my apologies if I wasn't clear! I am only using the new dropdown added in settings called "OpenDevin Workspace directory". I am unsure what you mean by using the file explorer.
My Workspace structure is like so:
- workspace root
- test-dir
- booboo.rb
- deep dir
- test-dir
Notice that I've already selected test-dir for my workspace but now it allows me to select deep dir which is two levels deep compared to my workspace root.
edit: comment outdated, removed.
Hi! @johnnyaug , are you still interested in this? If so we'd appreciate getting it in, but if not maybe we can close the PR.
I'm going to close this PR for now. If you happen to continue the work, please reopen the PR again. Thank you.
Before changing:
After changing:
@mamoodi, I couldn't reproduce it.
I selected test-dir and click saved. Then I reopen the settings, I got a tick sign in the dropdown values for the selected one and deep dir is not listed for me. Did I miss any step?
@SmartManoj refresh the browser containing OpenDevin and see if it shows up.