wooden-umbrella-84098
09/29/2025, 8:54 PMwooden-umbrella-84098
09/29/2025, 8:54 PM# ... same as "hello world" above
workspace = Workspace(directory=os.getcwd())
workspace.execute_bash("git clone https://github.com/All-Hands-AI/OpenHands")
workspace.execute_bash("git config --global user.name OpenHands")
conversation = Conversation(agent=agent, workspace=workspace)
# ... same as "hello world" above
Remote Conversations
What’s magic 🪄 is that OpenHands Workspaces can run locally, or they can run remotely, inside of a container! So you can scale up to thousands of OpenHands agents, where each one has its own sandbox—and control them all via the same local Python script.
To start a remote AgentServer:
docker run ghcr.io/all-hands-ai/agent-server:1.0.0 -p 3000:3000
The Python code stays entirely the same! We just need to pass a host field to the Workspace. There’s a /workspace/project folder built into the image.
# ... same as "hello world" above
workspace = Workspace(host="localhost:3000", directory="/workspace/project")
conversation = Conversation(agent=agent, workspace=workspace)
# ... same as "hello world" above
You can also use Docker volumes to mount a local directory into the image, so you can work with local files, but keep your bash execution sandboxed.chilly-france-44439
09/29/2025, 8:58 PMchilly-france-44439
09/30/2025, 2:57 AMwooden-umbrella-84098
09/30/2025, 1:33 PMworking_dir for? Is it to set up the tools?wooden-umbrella-84098
09/30/2025, 1:34 PMworking_dir=Workspace() but we could just rename that param to workspacewooden-umbrella-84098
09/30/2025, 1:35 PMchilly-france-44439
09/30/2025, 2:04 PMWhat does Conversation useyepfor? Is it to set up the tools?working_dir
chilly-france-44439
09/30/2025, 2:04 PMWe should definitely not haveI will rename and get it merged!but we could just rename that param toworking_dir=Workspace()workspace
wooden-umbrella-84098
09/30/2025, 2:21 PMworking_dir back into Workspace, and I feel like we're eventually going to end up there. But I'm OK with making workspace: str | Workspace for nowwooden-umbrella-84098
09/30/2025, 2:22 PMchilly-france-44439
09/30/2025, 2:40 PMI feel like we're eventually going to end up there. But I'm OK with makingI really want to get rid of thefor nowworkspace: str | Workspace
str | too -- if you are ok with forcing user to always put in workspace=Workspace(cwd) when they start a conversation, i'd be ok with thatwooden-umbrella-84098
09/30/2025, 3:00 PMwooden-umbrella-84098
09/30/2025, 3:00 PMwooden-umbrella-84098
09/30/2025, 3:00 PMwooden-umbrella-84098
09/30/2025, 3:00 PMchilly-france-44439
09/30/2025, 3:07 PMcan it be None (e.g. if you're not using tools, or default to cwd?)we can default to cwd if we want, though i do hope we make this optional so user is aware that the agent can modify their file system to prevent accidents..
wooden-umbrella-84098
09/30/2025, 3:29 PM