OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Add workspace setting in UI

Open johnnyaug opened this issue 1 year ago • 7 comments

Resolves #1145.

johnnyaug avatar Apr 29 '24 12:04 johnnyaug

Thanks for taking this on! Excited to add this bit

rbren avatar Apr 29 '24 14:04 rbren

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.

codecov-commenter avatar May 05 '24 10:05 codecov-commenter

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.

neubig avatar May 11 '24 15:05 neubig

Hey @neubig, sure - on it

johnnyaug avatar May 12 '24 07:05 johnnyaug

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 avatar May 14 '24 16:05 rbren

@rbren, no worries - I hope this cuts it, please take another look

johnnyaug avatar May 16 '24 08:05 johnnyaug

@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 avatar May 16 '24 13:05 rbren

@rbren, could you please take another look?

johnnyaug avatar Jun 02 '24 12:06 johnnyaug

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

There's a couple of issues:

  • A lot of the times when I select another folder, it gives me this error Screenshot 2024-06-04 at 11 24 30 AM
  • 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.

mamoodi avatar Jun 04 '24 16:06 mamoodi

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

rbren avatar Jun 04 '24 16:06 rbren

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

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.

mamoodi avatar Jun 04 '24 17:06 mamoodi

@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 avatar Jun 05 '24 08:06 johnnyaug

@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

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. Screenshot 2024-06-05 at 8 06 20 AM

mamoodi avatar Jun 05 '24 12:06 mamoodi

edit: comment outdated, removed.

tobitege avatar Jun 05 '24 12:06 tobitege

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.

neubig avatar Jun 26 '24 23:06 neubig

I'm going to close this PR for now. If you happen to continue the work, please reopen the PR again. Thank you.

mamoodi avatar Jun 30 '24 15:06 mamoodi

image

Before changing:

image

After changing:

image image

@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 avatar Jul 11 '24 14:07 SmartManoj

@SmartManoj refresh the browser containing OpenDevin and see if it shows up.

mamoodi avatar Jul 11 '24 15:07 mamoodi