What do you think about this feature: > Allow ...
# proj-agent-canvas
c
What do you think about this feature:
Allow '.openhands/microagents/*.md' in any directory in the workspace. The microagents there should only apply to that folder and its subdirectories. So load the respective microagent only when openhands reads/writes to files in that directory.
Source is our understanding of
.cursor/rules
in this issue, and it concerns migrating other AI systems instructions files: https://github.com/All-Hands-AI/OpenHands/issues/9878 I can see several options 1. implement it in code, as described 2. write a microagent to tell the agent to read those files itself, before working on a directory 3. write a microagent to tell the agent to read the README.md file in any directory it goes into (and maybe a script to migrate those to README.md) 4. do nothing about this, too weird. Re: 1. Pretty sure Cursor and others are using RAG, they don’t load all context all the time.
w
yesss I started doing this at one point
I was creating
*.openhands.md
files in every directory
and then loading them into context if the agent touched a file in that dir
💯 this would be amazing
The bigger idea was to index repos by looking at all the code and the git history to understand all the context about a given directory, including e.g. where major bugs have occurred in the past, and condense that all into a 2-3 paragraph
dir.openhands.md
👀 1
I could see putting a whole
.openhands
directory into each directory too
c
That makes sense! I do feel like the whole
.openhands/microagents/stuff.md
is a bit too verbose though... Maybe because I need to tell the agent sometimes about these, and might dumbly prefer to type rather than see it confused 🤔 😅 What if we start reading microagents from • particular name patterns on top-level workspace (repo.md, AGENT.md, .cursorrules) •
.openhands
directory at any level, without necessarily limited to sub-directory microagents/ (rule becomes all .md files in)
w
I do like the idea of supporting AGENT.md and .cursorrules as "microagents"
I hear you on the verbosity, but I think maybe better to stick with the current pattern than introduce a change and potentially confuse people?
soft opinion though
c
We already have .cursorrules I think, and a ticket to add others
Well, we would read all .md files in subdirs, so the current behavior would still work
nod 1
It would just allow us to add .md files directly under .openhands going forward
w
yeah I guess main question is, do we want to support + document that behavior?
seems pretty harmless I guess
esp. if we continue to document using a subdirectory as convention
c
"Microagents are read from: • the workspace, if you define at workspace level particular files, repo.md, .cursorrules... etc • .openhands directory • (recommendation) use .openhands/microagents for the microagents you define"
👍 2
c
Just confirm 1 more thing in the previous review: Should the .cursorrules and other rules related files still triggers if Microagent directory not exists?
c
Yes I think so? It means the user is trying OH, coming from e.g. Cursor, and hasn’t yet created OH-specific rules
👍 1
c
Let me summary all current status of Openhands legacy .openhands/repo.md/cursorrules related data flow with diagram. And I will draft a design for it. It will be easier to discuss and implement then.(1 week required for the diagram and summary.)
n
the problem there is the same sorta problem one has with .htaccess files
it becomes a dumping ground for insecure stuff that can be exploited
... not to mention the somewhat downside of ending up with a bunch of repeated data all over the place that needs to be updated as patterns evolve..... I'd THINK a better strategy would be to use the workspace... or someplace outside the codebase that can be adjusted ... to influence the microagent selectors ....