actionMutation: ifVersionGte()

in src/common/chat/gitlab_chat_api.ts [447:483]


          actionMutation: ifVersionGte<ChatInputTemplate>(
            version,
            MINIMUM_CONVERSATION_TYPE_VERSION,
            () => CHAT_INPUT_TEMPLATE_17_10_AND_LATER,
            () =>
              ifVersionGte<ChatInputTemplate>(
                version,
                MINIMUM_PLATFORM_ORIGIN_FIELD_VERSION,
                () =>
                  isAdditionalContextEnabled
                    ? CHAT_INPUT_TEMPLATE_17_5_AND_LATER
                    : CHAT_INPUT_TEMPLATE_17_3_AND_LATER,
                () => CHAT_INPUT_TEMPLATE_17_2_AND_EARLIER,
              ),
          ),
        };
        this.#cachedActionMutation = settings.actionMutation;
        log.debug(`GitLabChatApi: action mutation settings: ${JSON.stringify(settings, null, 2)}`);
      } catch (e) {
        log.debug(`GitLab version check for sending chat failed:`, e);
        this.#cachedActionMutation = CHAT_INPUT_TEMPLATE_17_3_AND_LATER;
      }
    }

    return this.#cachedActionMutation;
  }

  async #messagesQuery(): Promise<string> {
    if (!this.#cachedMessagesQuery) {
      const platform = await this.#currentPlatform();

      try {
        const [{ version }, isAdditionalContextEnabled] = await Promise.all([
          platform.fetchFromApi(versionRequest),
          this.#aiContextManager.isAdditionalContextEnabled(),
        ]);
        const settings = {