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

PR Agent shows Empty Diff when using bitbucket server token #1617

Open
nickTurano opened this issue Mar 11, 2025 · 2 comments
Open

PR Agent shows Empty Diff when using bitbucket server token #1617

nickTurano opened this issue Mar 11, 2025 · 2 comments

Comments

@nickTurano
Copy link

nickTurano commented Mar 11, 2025

Git provider

Bitbucket Server

System Info

CONFIG.git_provider = bitbucket_server
bitbucket_server.bearer_token = /my-token/
CONFIG.model = gpt-4o
OPENAI.API_TYPE = azure
OPENAI.KEY = /my-key/

Bug details

I have a bitbucket HTTP Rest token configured with Project and Repo write permissions. When I call the agent pointing to my PR, I get the following error claiming empty diff, even though my diff is not empty:
2025-03-11 15:24:47.103 | INFO | pr_agent.tools.pr_reviewer:run:111 - Reviewing PR: /pr-url/...
2025-03-11 15:24:47.223 | INFO | pr_agent.algo.pr_processing:get_pr_diff:63 - PR main language: Other
2025-03-11 15:24:47.251 | INFO | pr_agent.algo.pr_processing:get_pr_diff:74 - Tokens: 1029, total tokens under limit: 32000, returning full diff.
2025-03-11 15:24:47.252 | WARNING | pr_agent.tools.pr_reviewer:_prepare_prediction:165 - Empty diff for PR: /pr-url/

@mrT23
Copy link
Collaborator

mrT23 commented Mar 12, 2025

this is too general. Bitbucket server access works for other users.

try to run from CLI, catch breakpoints, and understand why the diff is empty. Are the PR files actually not read ? maybe they are not code files, and are filtered ? other reasons ?

after understanding that, share more details

@nickTurano
Copy link
Author

I've run this via the docker image and it is working as expected. However, I am getting errors trying to execute the pr_agent python package. Removing the verbosity setting from my configuration revealed the following error:

Failed to generate prediction with gpt-4o: Traceback (most recent call last):
File "/var/lang/lib/python3.11/site-packages/litellm/llms/azure.py", line 711, in acompletion
azure_client = AsyncAzureOpenAI(**azure_client_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/lang/lib/python3.11/site-packages/openai/lib/azure.py", line 445, in init
super().init(
File "/var/lang/lib/python3.11/site-packages/openai/_client.py", line 337, in init
super().init(
File "/var/lang/lib/python3.11/site-packages/openai/_base_client.py", line 1419, in init
self._client = http_client or AsyncHttpxClientWrapper(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/lang/lib/python3.11/site-packages/openai/_base_client.py", line 1316, in init
super().init(**kwargs)
TypeError: AsyncClient.init() got an unexpected keyword argument 'proxies'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/var/lang/lib/python3.11/site-packages/litellm/main.py", line 401, in acompletion
response = await init_response
^^^^^^^^^^^^^^^^^^^
File "/var/lang/lib/python3.11/site-packages/litellm/llms/azure.py", line 781, in acompletion
raise AzureOpenAIError(status_code=500, message=str(e))
litellm.llms.azure.AzureOpenAIError: AsyncClient.init() got an unexpected keyword argument 'proxies'

Here is the configuration I am using:
get_settings().set("CONFIG.GIT_PROVIDER", "bitbucket_server")
get_settings().set("bitbucket_server.bearer_token", user_token)
get_settings().set("CONFIG.model", "gpt-4o")
get_settings().set("OPENAI.API_TYPE", "azure")
get_settings().set("OPENAI.KEY", openai_key)
get_settings().set("OPENAI.API_VERSION", "2023-03-15-preview")
get_settings().set("OPENAI.API_BASE", api_base)

When running via docker image with the same configuration, the review successfully executes

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

No branches or pull requests

2 participants