Consolidate 'anthropic_proxy' UP usage and ensure service mapping for relevant UPs

To proceed with the Refactor AiGateway.headers to accept unit_primitive and use pass it to Tokens.get issue, we need to ensure that every Unit Primitive that is explicitly used from permission checks has corresponding service with the same name (either defined explicitly in CC library config or virtually through AvailableServicesGenerator).

We tackle this in steps.

This issue is dedicated to UPs used in anthropic_proxy service/endpoint. Vertex issue is here.

Currently, anthropic_proxy service lists these UPs:

Unit Primitive name In use? Appears in AI GW logs? References Action

categorize_duo_chat_question

N
  • groupduo chat
  • I see that This should not be an unit primitive. It is used to categorize user questions for the purpose of product analytics. in UP

Shinya told that it's no longer used through proxy. We can remove it from service yml defintion (not blocking):

▶️ gitlab-org/cloud-connector/gitlab-cloud-connector!184 (merged)

generate_commit_message

Y

Y

16 uses over 2w

Nothing - it's not in IGNORE_UNIT_PRIMITIVES

generate_issue_description

Y N

Nothing from Anthropic perspective

▶️ Not related to Anthropic: MR to move it out of IGNORE_UNIT_PRIMITIVES: gitlab-org/cloud-connector/gitlab-cloud-connector!182 (merged) - waiting for 18.2 release

glab_ask_git_command

Y N

Team told me it no longer uses Anthropic proxy - we can remove it from service yml (not blocking):

▶️ gitlab-org/cloud-connector/gitlab-cloud-connector!184 (merged)

resolve_vulnerability

Y

Y

4 uses over 2w

  • group::threat insights (prob renamed, can't find label)

Nothing - it's not in IGNORE_UNIT_PRIMITIVES

review_merge_request

Y

Y

by far most used

14k uses over 2w

Nothing - it's not in IGNORE_UNIT_PRIMITIVES

summarize_issue_discussions

Y

Y

1 use over 2w

▶️ MR that removes it from IGNORE_UNIT_PRIMITIVES: gitlab-org/cloud-connector/gitlab-cloud-connector!183 (merged) - waiting for 18.2 to be released

summarize_new_merge_request

Y N

Team told me it no longer uses Anthropic proxy - we can remove it from service yml (not blocking):

▶️ gitlab-org/cloud-connector/gitlab-cloud-connector!184 (merged)

summarize_review

Y N

Team told me it no longer uses Anthropic proxy - we can remove it from service yml (not blocking):

▶️ gitlab-org/cloud-connector/gitlab-cloud-connector!184 (merged)

description_composer

Y N

Team mentioned that it is a future feature, WIP. So we keep it in service yml. It's not in ignore list so all good.

We need to carefully review the usage of the listed UPs and for each of them:

We should grep the codebase and use the logs from AI GW - https://log.gprd.gitlab.net/app/r/s/jRNVG - to understand the usage.

For safety, we need to wait until 18.2 final version is released before bumping the library (as it can be picked up by renovate and we can introduce the regression if there is a problem with the change).

We will use the table to receive approval from stakeholders and for transparency during the rollout.

Edited by Aleksei Lipniagov