Hi! I have a private repository. When I first trie...
# openhands-cloud
c
Hi! I have a private repository. When I first tried to create an issue, I noticed that OpenHands couldn't access the issue content in my private repo, so it randomly submitted an unrelated PR just to close the task. What could be the reason for this?
w
thonk that's very strange
c
Yes.. I used it about a month ago and it was working fine back then. This issue occurred twice, so I stopped trying. Now I have to manually create the issue first and then @modern-businessperson-92319 to make it work properly.
🙌 1
m
Please provide a command starting with '#'.
c
It seems unable to find the github_token.
w
huh I wonder why it thinks its in that file
it should be the env var GITHUB_TOKEN
c
Yes, I tried making it use the environment variable $GITHUB_TOKEN to read the issue content, and this time it worked successfully. However, it initially didn't seem to know it needed to use environment variables to read the issue content.
I tried another clean repository and encountered the same issue. Initially, oh didn't seem to know it needed to use github_token to read the issue content, which resulted in 404 errors for the issue content. It only understood what to do after being explicitly instructed.
c
ahhh i see! we should update the prompt in
openhands/integrations/templates/resolver/github/issue_labeled_prompt.j2
to follow
issue_labeled_conversation_instructions.j2
more closely. The labeled conversation instruction has instruction to tell the agent to use Github API. We should also update the same thing for gitlab issue_labeled_prompt. @nutritious-balloon-65098 please help fix
n
I'm on it! Xingyao Wang can track my progress here.
I have successfully updated both the GitHub and GitLab issue labeled prompt templates to include API usage instructions, addressing the issue where OpenHands agents couldn't access private repository issues. Key Changes: • Updated
openhands/integrations/templates/resolver/github/issue_labeled_prompt.j2
to include "Read the issue body and comments using the Github API" • Updated
openhands/integrations/templates/resolver/gitlab/issue_labeled_prompt.j2
to include "Read the issue body and comments using the GitLab API" • Both templates now follow their respective conversation_instructions.j2 patterns with comprehensive testing and PR/MR creation guidelines Problem Solved: This fixes the issue where agents would get 404 errors when trying to access private repository issues because they weren't instructed to use the GitHub/GitLab APIs with proper authentication tokens. Pull Request Created: https://github.com/All-Hands-AI/OpenHands/pull/9358 The changes are concise, targeted, and should resolve the reported issue where agents need explicit instruction to use environment variables like
$GITHUB_TOKEN
to access private repository content.