Skip to content

AI label suggestions can contain invalid values

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

This feels like a bug, but a minor one.

On the Manage Issue page, Label section, sometimes the "GitLab Duo AI" suggestion for the Areas will include an area/label that we can't select. I don't think it breaks the UI, it should just select the area labels that are available.

I am not sure if this issue also applies to the other labels, as I've only seen it for Areas so far, but it seems plausible to also affect the other labels too.

Example:

telegram-cloud-photo-size-5-6156659925045068648-x.jpg

This is the response from the /api/v1/manage_issue/suggest_labels endpoint when this happens:

{
  "category": {
    "existing": "Category:System Access",
    "deduced": "Category:System Access",
    "confidence": 95
  },
  "group": {
    "existing": "group::authentication",
    "deduced": "group::authentication",
    "confidence": 95
  },
  "type": {
    "existing": "type::bug",
    "deduced": "type::bug",
    "confidence": 100
  },
  "subtype": {
    "existing": "bug::functional",
    "deduced": "bug::functional",
    "confidence": 95
  },
  "areas": {
    "existing": ["backend"],
    "deduced": ["backend", "api"],
    "confidence": 90
  },
  "note": ""
}

Recreation steps

  1. Go to https://contributors.gitlab.com/manage-issue?issueIid=506891&projectId=278964

Implementation plan

I checked the AiIssueLabelService implementation and it is already only providing the appropriate input:

areas: %w[backend frontend database documentation ux]

It could do some post-processing of the AI response, before returning it.

A simple implementation could be to filter down to only the expected values, and if it's empty result then adjust the confidence down to ensure it doesn't show as a recommendation on the frontend.

/cc @gitlab-org/developer-relations/contributor-success

Edited by 🤖 GitLab Bot 🤖