<@U090ER7JPHA> when starting a conversation with a...
# slackbot-chatter
q
@nutritious-balloon-65098 when starting a conversation with a repository and a selected branch, are the microagents extracted from the main branch or the selected branch
n
I'm on it! Rohit Malhotra can track my progress here.
Summary I investigated how microagents are extracted when starting a conversation with a repository and selected branch in OpenHands. Answer: Microagents are extracted from the selected branch, not the main branch. Key Findings Through analysis of the OpenHands codebase, I discovered the execution flow: 1. Repository Setup First (
_create_runtime
): ◦ Clones the repository ◦ Checks out the specified branch using
clone_or_init_repo(git_provider_tokens, selected_repository, selected_branch)
2. Microagent Loading Second (
_create_memory
): ◦ Loads microagents from the current workspace using
get_microagents_from_selected_repo()
◦ Reads from
.openhands/microagents/
directory in the checked-out branch Technical Details The process is implemented in `openhands/server/session/agent_session.py`: • Line 135:
_create_runtime()
handles repository cloning with branch selection • Line 156:
_create_memory()
handles microagent loading from the workspace Since the repository is cloned and checked out to the selected branch before microagents are loaded, any branch-specific microagent configurations in
.openhands/microagents/
will be properly loaded for that conversation. This ensures that users get the correct microagents for their selected branch, allowing for branch-specific agent behaviors and configurations. <sub>View full conversation</sub>