Duo adds triple backticks to autocomplete suggestions

Checklist

Summary

When editing Python files using Duo, configured to use OpenAI GPT-4o via the AI Gateway, autocomplete adds triple backticks to its suggestions (almost as though it thinks it's editing a markdown file).

This is on a self-hosted Gitlab instance. The model is configured as a self-hosted model, as follows:

Steps to reproduce

Open a .py file, start typing code, wait for Duo autocomplete to provide a suggestion.

What is the current bug behavior?

The suggestion comes wrapped in triple backticks.

What is the expected correct behavior?

The suggestion should be provided without backticks.

Relevant logs and/or screenshots

image

Possible fixes