Skip to content

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

Merged
cstns merged 27 commits into
mainfrom
gate-all-ai-features-begind-ai-platform-and-team-type-flag
Jun 2, 2026
Merged

Enforce AI feature dependency checks for feature flags and assistant-…#7319
cstns merged 27 commits into
mainfrom
gate-all-ai-features-begind-ai-platform-and-team-type-flag

Conversation

@cstns

@cstns cstns commented May 20, 2026

Copy link
Copy Markdown
Contributor

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
hardillb and others added 4 commits May 21, 2026 11:06
…ate-snapshot-description-and-inline-completion-behind-assistant-config-flag
…ion-behind-assistant-config-flag' into gate-all-ai-features-begind-ai-platform-and-team-type-flag

# Conflicts:
#	forge/ee/lib/index.js
@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

codecov Bot commented May 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.69%. Comparing base (4810241) to head (225bff9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7319      +/-   ##
==========================================
+ Coverage   76.66%   76.69%   +0.02%     
==========================================
  Files         409      409              
  Lines       20798    20804       +6     
  Branches     5034     5039       +5     
==========================================
+ Hits        15945    15955      +10     
+ Misses       4853     4849       -4     
Flag Coverage Δ
backend 76.69% <100.00%> (+0.02%) ⬆️

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

cstns commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

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.

cstns added 3 commits June 2, 2026 12:02
…ate-snapshot-description-and-inline-completion-behind-assistant-config-flag
…assistant-config-flag' into gate-all-ai-features-begind-ai-platform-and-team-type-flag
Base automatically changed from gate-snapshot-description-and-inline-completion-behind-assistant-config-flag to main June 2, 2026 09:37
…atform-and-team-type-flag

# Conflicts:
#	forge/ee/lib/index.js
#	frontend/src/stores/account-settings.js
@cstns

cstns commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

the failed BE test seems to be unrelated to this change.. re-reunning

@cstns cstns merged commit b974fab into main Jun 2, 2026
29 checks passed
@cstns cstns deleted the gate-all-ai-features-begind-ai-platform-and-team-type-flag branch June 2, 2026 11:51
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