<@U06RMLQGNGM> has started designing <Multi-repo S...
# proj-agent
e
@breezy-kilobyte-39430 has started designing Multi-repo Selection interfaces - see a few initial designs here. A question that has come up is: Is the Agent smart enough to know which repos to push changes back to? I imagine the agent will successfully clone each report into
workspace/repoA
and
workspace/repoB
. But also wondering if there are scenarios where it could get confused at the time of pushing changes/creating a PR? Are there any additional system prompts or guardrails that should be considered when implementing this feature?
p
I think Cursor attempts guidance through AGENTS.md at the meta level, and a the specific project level, so a hierarchy
c
I'm very optimistic about its ability, though we could add stuff if we see a need. I'd say OH with GPT-5* is perfectly able to keep track of 3 repos, we do it quite a lot. No problems that would need addressed (other than OpenAI seemingly dumbing it down in 5.1 😅 just kidding, I hope, the jury is still out!) I remember doing 2 repos with Gemini-2.5-Pro, and I was babysitting it, but it did work, just more carefully.
Just to note, currently
I imagine the agent will successfully clone each report into
workspace/repoA
and
workspace/repoB
.
we clone automatically when the repo is selected. Not sure if that changes? And then we do inform the agent what repo it has, in a suffix to the system prompt IIRC.
I assume we'd tell it there that there are multiple repos, if the idea is that we clone repos before the agent conversation starts?
p
what if the AGENTS.md lists the repos to clone?
c
I could be wrong, but as far as I know, we only read AGENTS.md from the cloned repo
(top level in the repo)
Does Cursor have one at... idk, user-level, for all workspace?
p
c
From the page:
Cursor supports AGENTS.md in the project root and subdirectories.
This is actually a good question... Do we read "skills" (like AGENTS.md) from all repos?
a
We currently use microagents to automatically clone dependency repos (obv we have an initial repo with all this information) But this is interesting from a UI perspective. Not sure how doable from a backend perspective gracefully? Cause I'd expect • Each repo install.sh to run • Each repo pre-commit.sh to work independent of each other • Each microagent to work independent of each other as well e.g. I have 2 repos both with a
repo.md
- I wouldn't want any cross contamination of these and I'm not trying to use microagent triggers for generic repo related instructions
A simple example of the later is Application Foo has a dependency of Application Bar Foo and Bar have different commit methods (one using conventional commits, one uses standard non-descriptive commits) Foo has "use conventional commits" in the
repo.md
Bar has "use some other standard" in the
repo.md
Is OH smart enough right now to manage multiple contexts?
c
nod Good point, that's the problem. As it currently stands, it's a single agent working with multiple repos, so a single context. My first thought is that, even with multiple repos, we'd need to have one as "primary" (or we treat it as such), and only load skills from it... Are there other options? thinky spin
a
A much larger task, but wonder if it's possible to have a single conversation spin up multiple processes/docker images/pods and then have a middle-man api from them to sync context with?
p
gitlab docker services come to mind? spin non-active projects in parallel and depend on them; front them with an MCP server; and/or delegate to respective agents; could run multiple OpenHands in parallel, and swarm them together?
ha; what Brett said 😄 (simulpost)
a
😆 Great minds think a like!
I actually may tinker with that MCP idea @polite-architect-52194, that would probably be the best way to expose - I was thinking just a traditional rest endpoint
p
that would flip the script, in a sense; i.e.: there is no Agent, rather your various codebases become an agent each the codebase's agent's duty now becomes: "how do I evolve my source code", so we let it approve its own PRs 🙂 what could go wrong
😂 1
a
Can't wait till I can let AI self-approve Terraform
p
funny you should mention that, I just started working at this startup: https://www.jetscale.ai/ idea is to generate TF files that take into account cloud spend, and send you PRs to right-size your instances, etc.
❤️ 1
a
Oh nice, I'll check it out - I've reviewed a few and the whole idea of • Generating Enterprise-grade IaC Has never touched close, because most don't/can't take into account current terraform modules, etc.. your using - they all just want to spit out raw TF
which I'm not tryin to manage 😆
p
that's good feedback; spamming the founder with exactly what you said 🙂 thx!
🙌 1
a
I'll have to mess with that - haven't used it yet
s
I want to weigh in. We use open hands without a repo and provide a custom clone_repo tool. When it chooses the repos and clones them, our tool automatically outputs the contents of AGENTS.md from the newly cloned repo so it's added to the context. This has worked pretty well. We do a few hundred headless sessions a week with this structure.
👍 1
e
Thanks Peter - so if 2 or more repos are cloned, it sounds like the concatenation of AGENTS.md in both repos are added to the agent context? How do you deal with setup.sh? Engel brings up a good point that you kind of need to choose what setup.sh/pre-commit.sh you will run.
p
personally, I don't want to be choosing; as that's too much friction. I expect the high-level deps to be articulated in
AGENTS.md
, and the agent be smart enough to bring in additional context when necessary and if that dep is not up to spec, it should change the code upstream, and try again
e
I expect the high-level deps to be articulated in
AGENTS.md
, and the agent be smart enough to bring in additional context when necessary
Just so I understand this feedback better, are you questioning whether the setup.sh is effective/necessary in general? If so, I think that's an interesting discussion but prob needs to be out of scope for how we decide to handle the presence of setup.sh/pre-commit hooks when adding multiple repos 🙂
p
not really, I think
setup.sh
is good for for what people use it today; I'm only challenging the
setup.sh
solution to the topic of this thread; it's just one way to do it, IMO. But I may have misunderstood the place you're coming from(?)
we could generalize to all deps, private/owned and 3rd party open source: what if the agent finds a bug in the currently used library code, and has a ready fix? why not open a PR to the remote open source repo/library and literally fix it, instead of creating a patch in the current project? I mean, that's what a human SWE would do, don't they? (the idea is to not even have to rely on an
AGENTS.md
file existing in an upstream dependency)
e
Hmm, I think what I am trying to figure out is general system behavior if we create a feature that allows a user to select 2 or more repos. In this case, both repos are cloned to the workspace on a single runtime. Therefore, how do we handle a scenario where there are 2+ setup.sh present: • ignore it; don't run any of them • run only one of the (which one?) • run them all and hope for the best 🙂
👍 1
😂 1
p
oh, I see; yeah, my comment would still stand 🙂; I still don't want to be choosing this; my projects evolve over time, now they have 3 repos, tomorrow there may be 5. If you're asking me to manually tell OpenHands what it should load as context, that feels friction-full...
oh, in this thread: https://openhands-ai.slack.com/archives/C06R25BT5B2/p1764538810557509 I saw this nice graphic, which might help illustrate what I mean: basically, repo-level deps, I might see these much lower down this hierarchy of abstractions? And as such, more important to get right early in the development cycle(?) but I still feel the agent could do it, and as such not need my explicitly selecting context in a drop-down
s
We have a parallel
setup.sh
concept. We accomplished this by providing a custom git clone tool that will run setup.sh if present. This has been fine for our projects where we control all the setup.sh files. Our main gap has been not being able to use repo specific microagents. If we could add microagents dynamically from the sandbox that would help a lot.
💯 1
We also have a monster base image that has all our project dependencies installed already. Rust, node (multiple versions), Ruby (multiple versions), python, etc. We build and deploy that image alongside our orchestration tooling (which accepts events from Jira, Github, Pagerduty, and more and launches different workloads and jobs based on the type of event).
a
From a platform perspective, this all sounds like a pain 😆 As a user, I'm going to expect • All setup.sh scripts run • All pre-commit hooks run • All microagents to run - Think this is going to be the hardest, since you will need to support multiple contexts thinky spin By far much easier to give general guidance on how to use a microagent to clone and setup other existing repos I think - then users can use multi-repo if they want, but there isn't guaranteed "everything works out of the box" support
e
Thank you all for the discussion on this! I think for now, we will probably pause on building a GUI for selecting 2+ repos. I was also chatting with @limited-student-10747 and he thought of an idea where a new frontmatter field exists in Repo.md that specifies related repos the agent should clone. Alternatively, to the other points made in this thread, you can just include that context within the repo.md itself.
p
what is a repo.md - is this another kind of AGENTS.md emerging standard?
e
Yeah, or an agents.md should work. I am referring to this: https://docs.openhands.dev/overview/skills/repo#example-content
👍 1
Created a Doc PR for guidance here: https://github.com/OpenHands/docs/pull/153
Based on this discussion, it sounds like we should close this issue as won't fix for now: https://github.com/OpenHands/OpenHands/issues/7752
c
Just a thought on an older question here
A much larger task, but wonder if it's possible to have a single conversation spin up multiple processes/docker images/pods and then have a middle-man api from them to sync context with?
I feel this is not exactly what you meant, but it makes me think of my OpenHands-Secretary 😅 : my secretary is an OH instance, on the cloud or in cli, which sits there and connects to the cloud via REST API: it tracks my conversations, it starts new conversations when I tell it to (and give it an initial prompt; it also has some always-on instructions to add at the end), it can initiate it with a repo, and... that's it. It can poll for status, give me details about conversations like what LLM they use or how many events they have, or even what did the agent do last time over there. 😊
a
I mean that's very close , is that a custom app you built that you launch in OH or a microagent?
c
I mostly vibe it, to be honest, OH made itself a small Cloud API client, and I simply point to that code so that it learns how to do it again. It's... enough. This client: https://github.com/enyst/playground/pull/105/files#diff-f12f7094e30de8e223fde1327e1265dbcbece8406bfc9e06eb8c666f437dac32R11
👍 1
So it goes like "clone yourself enyst/playground and read PR 105 so you understand how we work with the API. Now... let's play"
There are much better ways to do it, I just find it funny that it just works anyway
(TBH now that I think of it, maybe we should make it into something more useful. It could be a skill? or it could be a more fully featured API client I guess...)
💯 1
Based on this discussion, it sounds like we should close this issue as won't fix for now
I agree, and it's fascinating to me, that this issue seems like it's... difficult to figure out some deterministic behavior that will account for the possible users' wishes here, but on the other hand... the agent can do it. We can tell it - in natural language. 😅 I said above that the agent works fine with 2-3, because those are my usual use cases, and they're in the same time, but in reality, with the CLI, I think all of us are seeing much more.
I added a few comments to the issue, where I tried to extract some "lessons learned" to account for, even if we close this one https://github.com/OpenHands/OpenHands/issues/7752#issuecomment-3621954781
Please add more if you feel something is needed, or to re-open if you see fit!
Our main gap has been not being able to use repo specific microagents. If we could add microagents dynamically from the sandbox that would help a lot.
Would this be addressed by behavior like this? https://github.com/OpenHands/software-agent-sdk/issues/1283
s
We have a prompt-based approach, but it won't support keyword based triggering. There's value in lazily including things to avoid polluting the context.
c
Ahh, I see, sorry, I was assuming permanent skills. It seems to me that maybe we could have multiple options for keyword-based? • on your side, I wonder if maybe you can use an organization's microagents/skills repo? So that those skills are always available when working with organization's repos (loaded in memory, not necessarily in context) ◦ (similar with
~/.openhands/skills
on local machine) • on openhands side, I think maybe we could have a nicer way and a not-so-nice way... ◦ if we move towards some kind of "runtime environments" that people can declaratively create/save/reuse, then maybe it could allow environment skills ◦ we could try to intercept agent's
git clone
and do this... if it's always expected... I feel this is not-so-nice, but I could be wrong
a
Is
skills
already a thing @calm-artist-7206? Did I completely miss a new feature 😂
l
We renamed “microagents” to “skills”, so it’s an old feature with a new name
a
oh, wasn't aware of that - is this with the v1 changes? v0 still says microagent
l
yep, it’s with v1
🙌 1
c
Yes, and I meant these “organization skills” https://docs.openhands.dev/overview/skills/org
🙌 1
What does everyone think, could this help? https://github.com/OpenHands/OpenHands/issues/11938
a
LGTM For that last question, I'd imagine cloning at the start of the conversation would be ideal since we're calling them "dependencies"
👍 1
e
Thank you all for the feedback!