Skip to content

Account for typed code block responses from the LLM

Gregory Havenga requested to merge ghavenga-rtv-typed-code-block-fix into master

What does this MR do and why?

There have been occasional reports of RTV failing. After a tedious bit of testing for curiosities sake, this turned out to be caused by the LLM providing a type in it's diff block.

We expected something like the following:

```
  the_new(function_call: here)
```

The LLM, only in some contexts would return this:

```java
the_new(function_call: here)
```

This MR changes the regex to account for this possibility.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

Validation is troublesome as it requires testing a specific vulnerability that resulted in a LLM response like this. I was able to replicate this by locally cloning the repo referred to in this comment thread: #435721 (comment 1760915408)

Related to #437686

Edited by Gregory Havenga

Merge request reports