Skip to content

Supports AI Controls for GK Organizations #4338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 12, 2025
Merged

Conversation

sergeibbb
Copy link
Member

@sergeibbb sergeibbb commented May 29, 2025

Description

Support AI Controls for GK Organizations. Fixes #4300

  1. Supports GK Organization AI config:
    1. Disables non-configured AI providers
    2. Uses configured URLs and API keys
  2. Caches GK Organization settings, so it can be used after window reload
  3. When all Organizations are disabled it's treated as AI feature is disabled

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

sergeibbb added a commit that referenced this pull request May 29, 2025
sergeibbb added a commit that referenced this pull request May 29, 2025
sergeibbb added a commit that referenced this pull request May 29, 2025
@sergeibbb sergeibbb force-pushed the 4300-ai-controls-gkdev branch from 7939a2c to c383877 Compare May 29, 2025 17:18
@sergeibbb sergeibbb requested a review from eamodio May 29, 2025 17:32
@sergeibbb sergeibbb force-pushed the 4300-ai-controls-gkdev branch from c383877 to 5659804 Compare May 30, 2025 11:40
sergeibbb added a commit that referenced this pull request May 30, 2025
sergeibbb added a commit that referenced this pull request May 30, 2025
sergeibbb added a commit that referenced this pull request May 30, 2025
@sergeibbb sergeibbb requested a review from d13 May 30, 2025 15:11
sergeibbb added a commit that referenced this pull request Jun 2, 2025
@sergeibbb sergeibbb force-pushed the 4300-ai-controls-gkdev branch from 5659804 to 4c0d9f0 Compare June 2, 2025 10:49
sergeibbb added a commit that referenced this pull request Jun 2, 2025
sergeibbb added a commit that referenced this pull request Jun 2, 2025
sergeibbb added a commit that referenced this pull request Jun 3, 2025
sergeibbb added a commit that referenced this pull request Jun 3, 2025
sergeibbb added a commit that referenced this pull request Jun 3, 2025
@sergeibbb sergeibbb force-pushed the 4300-ai-controls-gkdev branch from 4c0d9f0 to 427fe47 Compare June 3, 2025 11:03
@sergeibbb sergeibbb requested a review from axosoft-ramint June 3, 2025 15:13
sergeibbb added a commit that referenced this pull request Jun 3, 2025
@sergeibbb sergeibbb force-pushed the 4300-ai-controls-gkdev branch from 427fe47 to c0b330f Compare June 3, 2025 16:16
sergeibbb added a commit that referenced this pull request Jun 3, 2025
sergeibbb added a commit that referenced this pull request Jun 3, 2025
@sergeibbb sergeibbb force-pushed the 4300-ai-controls-gkdev branch from c0b330f to f3ba0b2 Compare June 10, 2025 17:01
sergeibbb added a commit that referenced this pull request Jun 10, 2025
sergeibbb added a commit that referenced this pull request Jun 10, 2025
Copy link
Contributor

@axosoft-ramint axosoft-ramint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, just one issue I noticed. This will need heavy testing once merged.

Comment on lines 331 to 334
if (isProviderEnabledByOrg('vscode', orgAiConf)) {
const vsCodeModels = await this.getModels('vscode');
if (vsCodeModels.length !== 0) {
chosenProviderId = 'vscode';
}
} else if (
Copy link
Contributor

@axosoft-ramint axosoft-ramint Jun 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This nested if statement changes the previous logic such that if we do not find a vscode model, it does not move to the else block and therefore does not choose the GK model. I suggest moving the existing vscode models check into the if statement to make sure that the original flow is preserved.

i.e.

Suggested change
if (isProviderEnabledByOrg('vscode', orgAiConf)) {
const vsCodeModels = await this.getModels('vscode');
if (vsCodeModels.length !== 0) {
chosenProviderId = 'vscode';
}
} else if (
const vsCodeModels = await this.getModels('vscode');
if (isProviderEnabledByOrg('vscode', orgAiConf) && vsCodeModels.length !== 0) {
chosenProviderId = 'vscode';
} else if (

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@axosoft-ramint
Agree. Fixed.

@sergeibbb sergeibbb force-pushed the 4300-ai-controls-gkdev branch from f3ba0b2 to 1e7655d Compare June 12, 2025 13:48
@sergeibbb sergeibbb requested a review from axosoft-ramint June 12, 2025 13:49
@sergeibbb sergeibbb merged commit 83e97d8 into main Jun 12, 2025
3 checks passed
sergeibbb added a commit that referenced this pull request Jun 12, 2025
sergeibbb added a commit that referenced this pull request Jun 12, 2025
sergeibbb added a commit that referenced this pull request Jun 12, 2025
@sergeibbb sergeibbb deleted the 4300-ai-controls-gkdev branch June 12, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support AI Controls for GK Organizations
2 participants