Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub repository information to system prompt #6057

Merged
merged 15 commits into from
Jan 15, 2025

Conversation

rbren
Copy link
Collaborator

@rbren rbren commented Jan 5, 2025

This PR adds GitHub repository information to the system prompt when a repository is selected. This helps the agent better understand the context of the code it is working with.

Changes:

  1. Modified PromptManager to accept and store GitHub repository information
  2. Updated AgentSession to pass GitHub repository info to the prompt manager
  3. Added tests to verify the functionality

The repository information is included in the system prompt in a <REPOSITORY_INFO> block.


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:7a44e9c-nikolaik   --name openhands-app-7a44e9c   docker.all-hands.dev/all-hands-ai/openhands:7a44e9c

@rbren rbren marked this pull request as ready for review January 9, 2025 18:14
At the user's request, repository {{ repository_info.repo_name }} has been cloned to directory {{ repository_info.repo_directory }}.
</REPOSITORY_INFO>
{% endif %}
{% if repository_instructions -%}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember we inject this info in frontend as well? maybe we should remove that

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged it first and we can merge this one to clean these up from FE #6279

@xingyaoww xingyaoww merged commit fa6792e into main Jan 15, 2025
15 checks passed
@xingyaoww xingyaoww deleted the add-github-repo-to-prompt branch January 15, 2025 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants