Skip to content

Correct loading state after failing prompt

Lukas Eipert requested to merge leipert-fix-indefinite-loading-on-ai-ban into master

What does this MR do and why?

We currently only update the loading state of duo chat after the an assistant message has been sent from the backend.

In the case of banned AI, we actually never get an assistant message, but an error directly in the prompt leading to a indefinite loading state.

Now we double check that if the user message has errors, we just set loading to false.

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.

Screenshots or screen recordings

Before After
before after

How to set up and validate locally

  1. have AI working
  2. enable Project.find_by_full_path('gitlab-org/gitlab-test').update(duo_features_enabled: false)
  3. enable Feature.enable(:duo_features_enabled_setting)
Edited by Lukas Eipert

Merge request reports