wooden-umbrella-84098
09/28/2025, 1:55 PMrepositories parameter to the Conversation class
If we're calling ourselves a "Coding Agent SDK", git repos should be a first-class feature. We're going to want to work with them in a variety of contexts. And we need some centralized logic for pulling microagents out of the repo.
The Conversation could be responsible for cloning the repo into the /workspace/projects dir, and loading microagents.
The one weird thing is that currently Conversations don't really have a concept of a working directory--but the tools do 🤔chilly-france-44439
09/28/2025, 3:33 PMsetup_fn that relies on some bash execution functionality?wooden-umbrella-84098
09/28/2025, 3:36 PMwooden-umbrella-84098
09/28/2025, 3:37 PM.openhands/microagents/ and load those into the AgentContextwooden-umbrella-84098
09/28/2025, 3:37 PMchilly-france-44439
09/28/2025, 3:43 PMbash file upload/download endpoints, i'm trying to get these working over ConversationInterface although they seems to belongs to system level
https://github.com/All-Hands-AI/agent-sdk/pull/510#issuecomment-3343786617chilly-france-44439
09/28/2025, 3:44 PMconversation = Conversation(agent=agent, host=xyz)
setup_git_repo(conversation, repo=XXX)
conversation.send_message("hi checkout repo")
conversation.run()chilly-france-44439
09/28/2025, 3:45 PMconversation.execute_bash("git clone XXX")wooden-umbrella-84098
09/28/2025, 4:23 PMconversation.setup_git_repo ?chilly-france-44439
09/28/2025, 4:46 PMsetup_git_repo becomes more and more complex if you have more types of repo to support (eg gh gitlab, with authentication, with different setup, etc), and i don't want that to happen in Conversation classchilly-france-44439
09/28/2025, 4:47 PMwooden-umbrella-84098
09/28/2025, 4:59 PMwooden-umbrella-84098
09/28/2025, 4:59 PMwooden-umbrella-84098
09/28/2025, 5:00 PMwooden-umbrella-84098
09/28/2025, 5:00 PMwooden-umbrella-84098
09/28/2025, 5:01 PMchilly-france-44439
09/28/2025, 5:22 PMchilly-france-44439
09/28/2025, 5:24 PMwooden-umbrella-84098
09/28/2025, 5:38 PMwooden-umbrella-84098
09/28/2025, 5:38 PMclone_repo and have it run wherever the conversation is runningwooden-umbrella-84098
09/28/2025, 5:39 PMwooden-umbrella-84098
09/28/2025, 5:39 PMwooden-umbrella-84098
09/28/2025, 5:40 PMwooden-umbrella-84098
09/28/2025, 5:40 PMwooden-umbrella-84098
09/28/2025, 5:41 PMwooden-umbrella-84098
09/28/2025, 5:45 PMwooden-umbrella-84098
09/28/2025, 5:46 PMopenhands/sandboxwooden-umbrella-84098
09/28/2025, 5:49 PMwooden-umbrella-84098
09/28/2025, 6:17 PMcalm-artist-7206
09/28/2025, 6:39 PMIf we're calling ourselves a "Coding Agent SDK", git repos should be a first-class feature. We're going to want to work with them in a variety of contexts. And we need some centralized logic for pulling microagents out of the repo.Is it possible to have a concept of repos, but: - without a concept of user/org/perms - without ... github tokens? This
I need to be able to callseems like the answer is "no" at least to the second, it's not only public repos, right?and have it run wherever the conversation is runningclone_repo
calm-artist-7206
09/28/2025, 6:46 PMwooden-umbrella-84098
09/28/2025, 7:33 PMwooden-umbrella-84098
09/28/2025, 7:33 PMhttps://ghp_234@github.com/my/repowooden-umbrella-84098
09/28/2025, 7:34 PMcalm-artist-7206
09/28/2025, 8:04 PMwooden-umbrella-84098
09/28/2025, 8:22 PMchilly-france-44439
09/28/2025, 8:45 PMat the very least we might need a local interface for these operationsthis is exactly what i'm proposing in this comment here though https://github.com/All-Hands-AI/agent-sdk/pull/510#issuecomment-3343786617
chilly-france-44439
09/28/2025, 8:46 PMThe issue is that I do think this logic needs to be replicated both locally and remotelyif a function
clone_git_repo takes in a BaseConversation which can either be Local or Remote -- why do we need to attach clone_git_repo as a method of BaseConversation to be able to do that thoughwooden-umbrella-84098
09/28/2025, 8:47 PMwooden-umbrella-84098
09/28/2025, 8:48 PMwooden-umbrella-84098
09/28/2025, 8:48 PMclone_git_repo but I think logistically this makes sensewooden-umbrella-84098
09/28/2025, 8:49 PMclone loading microagents, which needs to modify the AgentContextchilly-france-44439
09/28/2025, 8:50 PMI don't love the aesthetics of having floating methods likeI think we can put these to a separate mixin though, so you can still dobut I think logistically this makes senseclone_git_repo
conv.clone_git_repo but have it not been the part of core methodschilly-france-44439
09/28/2025, 8:51 PMclone loading microagents, which needs to modify the AgentContext
🤔 yeah.. this seems will break our assumption that Agent should be immutable..wooden-umbrella-84098
09/28/2025, 9:10 PMwooden-umbrella-84098
09/28/2025, 9:11 PMwooden-umbrella-84098
09/28/2025, 9:11 PMwooden-umbrella-84098
09/28/2025, 9:12 PMwooden-umbrella-84098
09/28/2025, 9:12 PMclone_repo and gather_microagentswooden-umbrella-84098
09/28/2025, 9:13 PMworkspace.start_converastion(Conversation())wooden-umbrella-84098
09/28/2025, 9:13 PMwooden-umbrella-84098
09/28/2025, 9:18 PMConversation(workspace=workspace, agent=agent)wooden-umbrella-84098
09/28/2025, 9:18 PMworkspace would decide if it's local or remotechilly-france-44439
09/28/2025, 9:47 PMworking_dir and persistence_dir to different tools - since Conversation doesn't set the `working_dir`/ persistence_dir. and we have no single source-of-truth on these from the client side.
On agent server side, we even have a global variable for conversation working_dir and persistence_dir. Got a PR here, my tentative plan was to add working_dir and persistence_dir to the ConversationState and pass it to the tool initializers & server. CC @straight-sundown-84319: I would love to hear your thoughts here, as this will likely mean we will remove the global configuration for working_dir and persistence_dir.
It seems to me that `working_dir`/`persistence_dir` should be configurable at the conversation level rather than one level above (e.g., we might want conversation A to look at the X folder, while conversation B looks at the Y folder, and they should not interfere with each other).
In our current setting, our conversation doesn't really start until you hit conversation.run(), so i think having each conversation maintain its own Workspace is probably a better idea? e.g., we just pass c=Conversation(working_dir=XX, persistence_dir=YY) and we make .workspace to be an attribute of Conversation similar to .state?chilly-france-44439
09/28/2025, 9:50 PMWe could have LocalWorkspace, DockerWorkspace, or KubernetesWorkspacethis kinda makes me feel that "Runtime" class from V0 is backed again lolsob
calm-artist-7206
09/28/2025, 9:50 PMchilly-france-44439
09/28/2025, 9:51 PMcalm-artist-7206
09/28/2025, 9:51 PMso i think having each conversation maintain its ownThis sounds right to me...is probably a better ideaWorkspace
chilly-france-44439
09/28/2025, 9:55 PMcalm-artist-7206
09/28/2025, 10:01 PMpersistence_dir, Xingyao? Locally, that one seems different: there has to be a place (a filestore) where we can find conversations, and we may load one; that's known at runtime (or maybe it's partially recomputed, but achievable), so we can also save events as they come?
(Sorry, just reading the links)calm-artist-7206
09/28/2025, 10:31 PMpersistence dir changes, for the same conversation, including after it stopped/paused, or was restored?calm-artist-7206
09/28/2025, 11:30 PMconversation_id, maybe it can't be the location for all of themchilly-france-44439
09/29/2025, 12:27 AMIs it possible that for the cloud, theIn the cloud, i believe we have nested runtime and just store all conversation events underchanges, for the same conversation, including after it stopped/paused, or was restored?persistence dir
/workspace which is mounted as a persistent volume. At resume time, we simply restore /workspace. So i think this pattern will still work therecalm-artist-7206
09/29/2025, 12:44 AMchilly-france-44439
09/29/2025, 12:47 AMstraight-sundown-84319
09/29/2025, 12:48 AMchilly-france-44439
09/29/2025, 12:50 AMpersistence_dir for LocalConversation and keep this logic in server side unchanged. i think it does make sense to have server manage these metadata by itself. Will poke on the PR and hopefully we have smth to discuss tmrchilly-france-44439
09/29/2025, 12:52 AM.state.persistence_dir and .state.working_dir interface -- it will unblock other stuff i'm trying to do herecurved-angle-80449
09/29/2025, 11:19 AMwooden-umbrella-84098
09/29/2025, 12:26 PMpersistence_dir and working_dir seem like very different things to me...
Just to check my knowledge:
• persistence dir is where we store e.g. conversation state
• working dir is where the agent does its work
is that right?wooden-umbrella-84098
09/29/2025, 12:26 PMpersistence_dir to be set process-widewooden-umbrella-84098
09/29/2025, 12:27 PMworking_dir to be set per-conversationwooden-umbrella-84098
09/29/2025, 12:28 PMopenhands/sdk but they're critically important and probably do belong in the OpenHands/agent-sdk repochilly-france-44439
09/29/2025, 1:07 PMchilly-france-44439
09/29/2025, 1:08 PMpersistence_dir to be set process-wide
> ans working_dir to be set per-conversation
Yep, this is basically the approach i'm taking now in the PR above