Another part pulled out of the git PR (<@U06QJHRBL...
# proj-sdk
s
Another part pulled out of the git PR (@chilly-france-44439 / @calm-artist-7206 - I'd love your input): https://github.com/OpenHands/agent-sdk/pull/888 Establishing parity between the AsyncRemoteWorkspace and the RemoteWorkspace. (Added working_dir) 🙏
c
I was thinking about this, and wonder if it's time to introduce enforcement under the workspace... Since git could act or start or receive requests with paths outside conversation's directory, do we want to secure those inside workspace? This is a PR to your PR, to see how it could be like, tied to LocalWorkspace https://github.com/OpenHands/agent-sdk/pull/889
s
Interesting - one thing that may put a wrench in this is we allow executing arbitrary bash commands - and these may affect things outside the workspace directory
so we don't limit it for now
c
This is what is weird for me: • I actually feel that it's fine to let the agent-server ... quite free, because it's the box of the agent anyway, the LLM will do stuff • but it still feels weird to accept random paths from a web client
s
Yeah - OpenHands flagged this in a code review for me yesterday too
c
I think it's fine if we're not worried yet, and let them relative for now / no enforcement. I think what I wanted to figure out, is where it's better to do this, under agent-sdk design. And I think it's in Workspace or LocalWorkspace maybe, rather than a server thing. Thinking of CLI, but also of VScode, there's a concept of workspace, and another of workspaceFolder(s), and they're different. 🤔
s
Yeah - that is sort of what I was originally thinking about with the working_dir in config vs in conversations
But after the review I figured I'd punt on that for now
c
I don't have issues with your PR, I am just slightly wondering: • since we always run a LocalWorkspace (I think?), is it a convenience for RemoteWorkspace or necessary? • if it's nice to have in both, should it be in the base class?
s
The remote workspace executes similar logic to the local workspace. Since we don't limit the workspace directory in the agent server - you can use the download function to read any file you want. We do limit this in the remote workspace to match the same logic in the local workspace. These decisions make it even more important to never run the agent server without a SESSION_API_KEY,
s
Yes - the reason I added it to the mixin was so that it would also be present in the async version.
(To make them the same)
c
Oh, now I see, the async doesn't inherit from base. But are you fine with this: https://github.com/OpenHands/agent-sdk/blob/b57f8316e4f706bbaa0f33478edfeb5c71450f21/openhands-sdk/openhands/sdk/workspace/remote/base.py#L13 This gets
working_dir
from both if we add it to this mixin?
I hate multiple inheritance. So I'm concerned that we will not realize this, and code may rely silently on the one that is shadowed
s
The async signatures are different from the regular class - 🤔 I suppose we could add async methods to the RemoteWorkspace class and then remove the async variant altogether
(And the mixin along with it)
c
I'd like that! It is expected to have a- prefixes
nod 1
s
ok - I'll put together a PR for that next - right now I'm finishing up a PR for encrypting secrets as we discussed earlier this week
(I still need to be able to serialize secrets so that docker containers can be restarted)
nod 1