ai-code-review:sometimes ai-code-review can not work.

233 views
Skip to first unread message

Yingchun Li

unread,
Feb 20, 2025, 8:33:28 AMFeb 20
to Repo and Gerrit Discussion
     I have setup the ai-code-review plugin on my gerrit server(3.10.4), currently there
are two issues.
     1, Sometimes it can not find the repo, it add a specific path git/ on my repo path, the
log shows:

java.lang.RuntimeException: Failed to retrieve files in master branch:
    at com.googlesource.gerrit.plugins.aicodereview.mode.stateful.client.api.git.GitRepoFiles.getGitRepoFiles(GitRepoFiles.java:58)
    at com.googlesource.gerrit.plugins.aicodereview.mode.stateful.client.api.chatgpt.ChatGptAssistant.uploadRepoFiles(ChatGptAssistant.java:114)
    at com.googlesource.gerrit.plugins.aicodereview.mode.stateful.client.api.chatgpt.ChatGptAssistant.createVectorStore(ChatGptAssistant.java:96)
    at com.googlesource.gerrit.plugins.aicodereview.listener.EventHandlerTypeChangeMerged.processEvent(EventHandlerTypeChangeMerged.java:61)
    at com.googlesource.gerrit.plugins.aicodereview.listener.EventHandlerTask.execute(EventHandlerTask.java:106)
    at com.googlesource.gerrit.plugins.aicodereview.listener.EventHandlerTask.run(EventHandlerTask.java:95)
    at com.google.gerrit.server.logging.LoggingContextAwareRunnable.run(LoggingContextAwareRunnable.java:113)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
    at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:703)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: org.eclipse.jgit.errors.RepositoryNotFoundException: repository not found: git/aos/bsp-src.git
    at org.eclipse.jgit.storage.file.FileRepositoryBuilder.build(FileRepositoryBuilder.java:57)
    at com.googlesource.gerrit.plugins.aicodereview.mode.stateful.client.api.git.GitRepoFiles.openRepository(GitRepoFiles.java:98)

    Can not figure out why it add a 'git' path to my repo. but most of time it is right.

    2, Sometimes there is a error log '"java.util.List.size()" because "toolCalls" is null'.
     The related log:

      java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "toolCalls" is null
    at com.googlesource.gerrit.plugins.aicodereview.mode.common.client.api.openai.AIChatClient.getResponseContent(AIChatClient.java:79)
    at com.googlesource.gerrit.plugins.aicodereview.mode.common.client.api.openai.AIChatClient.extractContent(AIChatClient.java:56)
    at com.googlesource.gerrit.plugins.aicodereview.mode.stateless.client.api.chatai.AIChatClientStateless.ask(AIChatClientStateless.java:77)
    at com.googlesource.gerrit.plugins.aicodereview.PatchSetReviewer.getReviewReply(PatchSetReviewer.java:172)
    at com.googlesource.gerrit.plugins.aicodereview.PatchSetReviewer.review(PatchSetReviewer.java:92)
    at com.googlesource.gerrit.plugins.aicodereview.listener.EventHandlerTypePatchSetReview.processEvent(EventHandlerTypePatchSetReview.java:64)
    at com.googlesource.gerrit.plugins.aicodereview.listener.EventHandlerTask.execute(EventHandlerTask.java:106)
    at com.googlesource.gerrit.plugins.aicodereview.listener.EventHandlerTask.run(EventHandlerTask.java:95)
    at com.google.gerrit.server.logging.LoggingContextAwareRunnable.run(LoggingContextAwareRunnable.java:113)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
    at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:703)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1583)

    My gerrit.config settings:
[plugin "ai-code-review"]
    # Required parameters
    aiType = OLLAMA
    aiDomain = http://172.16.10.37:11434/
    aiModel = "qwen2.5-coder:latest"
    gerritUserName = codeGPT
    enableMessageDebugging = true
    #gptFullFileReview = false
    #enabledVoting = true
    globalEnable = false
    enabledProjects="aos/bsp-src"

Br,
Yingchun Li

Maria Helena Braga

unread,
Sep 16, 2025, 8:04:48 AMSep 16
to Repo and Gerrit Discussion
Hi Yingchun Li, 

Were you able to fix the  java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "toolCalls" is null ?
I'm having the same issue but can't find what is wrong, My gerrit.config is:


[plugin "ai-code-review"]
    # Required parameters
    aiType = OLLAMA
    aiModel = qwen2.5-coder
    aiDomain = http://ollama:11434/
    gerritUserName = gertst1
    globalEnable = true
    enableMessageDebugging = true

Michael Nazzareno Trimarchi

unread,
Sep 16, 2025, 12:50:49 PMSep 16
to Maria Helena Braga, Repo and Gerrit Discussion
Hi Maria and Yingchun Li

On Tue, Sep 16, 2025 at 2:04 PM Maria Helena Braga
<mariab...@gmail.com> wrote:
>
> Hi Yingchun Li,
>
> Were you able to fix the java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "toolCalls" is null ?
> I'm having the same issue but can't find what is wrong, My gerrit.config is:
>
> [plugin "ai-code-review"]
> # Required parameters
> aiType = OLLAMA
> aiModel = qwen2.5-coder
> aiDomain = http://ollama:11434/
> gerritUserName = gertst1
> globalEnable = true
> enableMessageDebugging = true

As I mention on another thread the original project [1] is evolving to
support multiple AI. As a company
we are not going to support the ai-code-review fork and continue to
deploy the original one. Will be nice
to test this scenario when the other AI will be added

Michael

[1] https://gerrithub.io/admin/repos/amarula/chatgpt-code-review-gerrit-plugin,general
> --
> --
> To unsubscribe, email repo-discuss...@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/09d6226d-0a35-416c-8946-5683d324b672n%40googlegroups.com.



--
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
mic...@amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
in...@amarulasolutions.com
www.amarulasolutions.com

Luca Milanesio

unread,
Sep 16, 2025, 1:08:39 PMSep 16
to Repo and Gerrit Discussion, Luca Milanesio


> On 16 Sep 2025, at 17:50, Michael Nazzareno Trimarchi <mic...@amarulasolutions.com> wrote:
>
> Hi Maria and Yingchun Li
>
> On Tue, Sep 16, 2025 at 2:04 PM Maria Helena Braga
> <mariab...@gmail.com> wrote:
>>
>> Hi Yingchun Li,
>>
>> Were you able to fix the java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "toolCalls" is null ?
>> I'm having the same issue but can't find what is wrong, My gerrit.config is:
>>
>> [plugin "ai-code-review"]
>> # Required parameters
>> aiType = OLLAMA
>> aiModel = qwen2.5-coder
>> aiDomain = http://ollama:11434/
>> gerritUserName = gertst1
>> globalEnable = true
>> enableMessageDebugging = true
>
> As I mention on another thread the original project [1] is evolving to
> support multiple AI. As a company
> we are not going to support the ai-code-review fork and continue to
> deploy the original one. Will be nice
> to test this scenario when the other AI will be added

I don’t personally believe it’s a good idea for the community to have two plugins, which are almost identical BUT different.
Can we merge them together and keep on developing one?

We may end up with mixed bugs here and there, and people will be confused.

Luca.
> To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/CAOf5uwm5ZatSG4fAdC%2B-XXBH8doPEfdED-0c4wc2mSWjhnEOzQ%40mail.gmail.com.

Michael Nazzareno Trimarchi

unread,
Sep 16, 2025, 1:20:01 PMSep 16
to Luca Milanesio, Repo and Gerrit Discussion
Hi Luca

On Tue, Sep 16, 2025 at 7:08 PM Luca Milanesio <luca.mi...@gmail.com> wrote:
>
>
>
> > On 16 Sep 2025, at 17:50, Michael Nazzareno Trimarchi <mic...@amarulasolutions.com> wrote:
> >
> > Hi Maria and Yingchun Li
> >
> > On Tue, Sep 16, 2025 at 2:04 PM Maria Helena Braga
> > <mariab...@gmail.com> wrote:
> >>
> >> Hi Yingchun Li,
> >>
> >> Were you able to fix the java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "toolCalls" is null ?
> >> I'm having the same issue but can't find what is wrong, My gerrit.config is:
> >>
> >> [plugin "ai-code-review"]
> >> # Required parameters
> >> aiType = OLLAMA
> >> aiModel = qwen2.5-coder
> >> aiDomain = http://ollama:11434/
> >> gerritUserName = gertst1
> >> globalEnable = true
> >> enableMessageDebugging = true
> >
> > As I mention on another thread the original project [1] is evolving to
> > support multiple AI. As a company
> > we are not going to support the ai-code-review fork and continue to
> > deploy the original one. Will be nice
> > to test this scenario when the other AI will be added
>
> I don’t personally believe it’s a good idea for the community to have two plugins, which are almost identical BUT different.
> Can we merge them together and keep on developing one?
>
> We may end up with mixed bugs here and there, and people will be confused.

Yes it is possible to have one plugin, both are opensource, I think
that as soon we finish to have Langchain [1] integrated
and working on few AI, we can discuss how to make this happen. There
are few idea right now but this is our roadmap defined in next 4
weeks:

- drop stateless
- move to langchain to support multiple AI (at least Gemini and OpenAI)
- compare performance from the original one and the new on top of
Langchain and in case drop the first one for the one on top of
langchain

More users we get, the more we start to have a better understanding on
what should be done next. I think that we can have community calls
or thread discussions on what to do next.

Michael

[1] https://github.com/langchain4j/langchain4j
> To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/9606DCDF-B302-4EBB-94D2-39EDDBE90CBE%40gmail.com.
Reply all
Reply to author
Forward
0 new messages