Skip to content

Enforce AI feature dependency checks for feature flags and assistant-…#7319

Open
cstns wants to merge 10 commits into
gate-snapshot-description-and-inline-completion-behind-assistant-config-flagfrom
gate-all-ai-features-begind-ai-platform-and-team-type-flag
Open

Enforce AI feature dependency checks for feature flags and assistant-…#7319
cstns wants to merge 10 commits into
gate-snapshot-description-and-inline-completion-behind-assistant-config-flagfrom
gate-all-ai-features-begind-ai-platform-and-team-type-flag

Conversation

@cstns
Copy link
Copy Markdown
Contributor

@cstns cstns commented May 20, 2026

Description

Important

This PR is part of a nested merge list, do not merge it until its target is main

Note

The ai platform feature flag defaults to true when not set (implemented in #7317, commit 93900f4), so this is not a breaking change. AI features remain enabled by default; operators who want to disable them must explicitly set ai to false.

All AI feature flags now respect the ai flag introduced in the previous PR. If ai is disabled at either the platform or team type level, all downstream AI features are disabled.

Platform level (forge/ee/lib/index.js):

  • generatedSnapshotDescription and assistantInlineCompletions now require ai.enabled in addition to assistant configuration
  • expertAssistant and expertInsights now require ai.enabled in addition to their own config

Frontend (frontend/src/stores/account-settings.js):

  • Added dependsOn support to FEATURE_CONFIGS and buildFeatureChecks
  • isGeneratedSnapshotDescriptionFeatureEnabled and isExpertAssistantFeatureEnabled depend on isAiFeatureEnabled

Backend endpoints:

  • Added ai team feature property check to snapshot description endpoints (device.js, project.js)
  • Added ai team feature property check to the FIM inline completions endpoint (assistant.js)
  • Device and instance settings responses now report assistant.enabled: false and disable inline completions when ai is disabled for the team (deviceLive.js, project.js)

Related Issue(s)

closes #7312

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

@cstns cstns requested a review from hardillb May 20, 2026 16:09
@cstns cstns linked an issue May 20, 2026 that may be closed by this pull request
@cstns cstns marked this pull request as draft May 20, 2026 16:24
…ion-behind-assistant-config-flag' into gate-all-ai-features-begind-ai-platform-and-team-type-flag

# Conflicts:
#	forge/ee/lib/index.js
cstns added 2 commits May 21, 2026 17:14
…assistant-config-flag' into gate-all-ai-features-begind-ai-platform-and-team-type-flag
@cstns cstns self-assigned this May 21, 2026
@cstns cstns marked this pull request as ready for review May 21, 2026 16:10
@cstns cstns requested a review from Steve-Mcl May 21, 2026 16:11
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.60%. Comparing base (f4ad728) to head (62d5e70).

Additional details and impacted files
@@                                              Coverage Diff                                              @@
##           gate-snapshot-description-and-inline-completion-behind-assistant-config-flag    #7319   +/-   ##
=============================================================================================================
  Coverage                                                                         76.59%   76.60%           
=============================================================================================================
  Files                                                                               405      405           
  Lines                                                                             20615    20621    +6     
  Branches                                                                           4993     4998    +5     
=============================================================================================================
+ Hits                                                                              15790    15796    +6     
  Misses                                                                             4825     4825           
Flag Coverage Δ
backend 76.60% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hardillb
Copy link
Copy Markdown
Contributor

Caution

The ai platform feature flag must be enabled across pre-staging, staging, production, and on-premise installations before this PR is merged. Without it, all AI features will be disabled since ai.enabled defaults to false. See https://github.com/FlowFuse/CloudProject/issues/1349

We can't ship a breaking change like this, it's going to have to default to on and allow opt out

I suggest we discuss this in the Eng meeting today

@cstns
Copy link
Copy Markdown
Contributor Author

cstns commented May 26, 2026

The description needs updating, sorry for the confusion. The ai feature flag actually defaults to true when not set, so this isn't a breaking change. The only configuration operators need to make explicit is the opt-out (setting ai to false).

That default was implemented in #7317 (commit 93900f4). I'll update the description now to reflect this.

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.

Task 3: Make all AI feature flags respect the new ai flag

2 participants