Skip to content

Conditionally include nr-assistant in device snapshots based on AI flag #7326

Open
cstns wants to merge 3 commits into
gate-all-ai-features-begind-ai-platform-and-team-type-flagfrom
make-nrassistant-plugin-instalation-conditional
Open

Conditionally include nr-assistant in device snapshots based on AI flag #7326
cstns wants to merge 3 commits into
gate-all-ai-features-begind-ai-platform-and-team-type-flagfrom
make-nrassistant-plugin-instalation-conditional

Conversation

@cstns
Copy link
Copy Markdown
Contributor

@cstns cstns commented May 21, 2026

Important

This PR is part of a nested merge list. Do not merge until its target branch is main.

Description

The @flowfuse/nr-assistant plugin was previously unconditionally included in device modules. It is now only included when AI is enabled at both platform and team level.

Changes in forge/routes/api/deviceLive.js:

  • Starter snapshot (new devices): @flowfuse/nr-assistant is removed from the default modules when AI is disabled
  • Existing snapshot injection (devices with target snapshots): @flowfuse/nr-assistant is conditionally injected when AI is enabled, and actively removed from snapshot modules when AI is disabled

Both locations check app.config.features.enabled('ai') && device.Team.getFeatureProperty('ai', true).

Note

Changes to the AI flag do not take effect on running devices immediately. Devices will pick up the updated module list on their next snapshot delivery (e.g. after a new deployment or device restart).

Related Issue(s)

closes #7313

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 changed the base branch from main to gate-all-ai-features-begind-ai-platform-and-team-type-flag May 21, 2026 18:45
@cstns cstns requested a review from Steve-Mcl May 21, 2026 18:45
@cstns cstns self-assigned this May 21, 2026
@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.61%. Comparing base (62d5e70) to head (3e3a09c).

Additional details and impacted files
@@                                      Coverage Diff                                       @@
##           gate-all-ai-features-begind-ai-platform-and-team-type-flag    #7326      +/-   ##
==============================================================================================
+ Coverage                                                       76.60%   76.61%   +0.01%     
==============================================================================================
  Files                                                             405      405              
  Lines                                                           20621    20630       +9     
  Branches                                                         4998     5002       +4     
==============================================================================================
+ Hits                                                            15796    15805       +9     
  Misses                                                           4825     4825              
Flag Coverage Δ
backend 76.61% <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.

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.

Conditionally load nr-assistant plugin based on platform AI settings Task 4: Make nr-assistant plugin installation conditional (hosted and remote)

1 participant