mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-10 07:18:10 -05:00
Add branch information to repository context to prevent unwanted branch switching (#9833)
This commit is contained in:
@@ -152,6 +152,7 @@ class AgentSession:
|
||||
self.memory = await self._create_memory(
|
||||
selected_repository=selected_repository,
|
||||
repo_directory=repo_directory,
|
||||
selected_branch=selected_branch,
|
||||
conversation_instructions=conversation_instructions,
|
||||
custom_secrets_descriptions=custom_secrets_handler.get_custom_secrets_descriptions(),
|
||||
working_dir=config.workspace_mount_path_in_sandbox,
|
||||
@@ -463,6 +464,7 @@ class AgentSession:
|
||||
self,
|
||||
selected_repository: str | None,
|
||||
repo_directory: str | None,
|
||||
selected_branch: str | None,
|
||||
conversation_instructions: str | None,
|
||||
custom_secrets_descriptions: dict[str, str],
|
||||
working_dir: str,
|
||||
@@ -488,7 +490,9 @@ class AgentSession:
|
||||
memory.load_user_workspace_microagents(microagents)
|
||||
|
||||
if selected_repository and repo_directory:
|
||||
memory.set_repository_info(selected_repository, repo_directory)
|
||||
memory.set_repository_info(
|
||||
selected_repository, repo_directory, selected_branch
|
||||
)
|
||||
return memory
|
||||
|
||||
def _maybe_restore_state(self) -> State | None:
|
||||
|
||||
Reference in New Issue
Block a user