Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Hide Pro-only autonomous control by default

rcourtmane4cab2b88f59
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index d51c698fc5..4acd0064a0 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -573,6 +573,11 @@ work extends shared components instead of creating new local variants.
the shared settings shell. Shared/default model choices may remain on the
combined shell only when Assistant and Patrol overrides are presented as
explicit per-surface overrides instead of a generic advanced AI bucket.
+ The shared shell must not show Pro-only autonomous execution as a default
+ free-user control when upgrade prompts are suppressed; it may surface that
+ option only when the entitlement is present, commercial prompts are
+ explicitly allowed, or the current saved setting already uses autonomous
+ mode and needs to remain visible for operator review.
Provider model catalogs must remain curated on that same shell:
`frontend-modern/src/components/shared/AIModelPicker.tsx` owns the
searchable, notable-first model picker pattern, and
diff --git a/frontend-modern/src/components/Settings/AIRuntimeControlsSection.tsx b/frontend-modern/src/components/Settings/AIRuntimeControlsSection.tsx
index d2e392e231..7761372745 100644
--- a/frontend-modern/src/components/Settings/AIRuntimeControlsSection.tsx
+++ b/frontend-modern/src/components/Settings/AIRuntimeControlsSection.tsx
@@ -24,6 +24,8 @@ interface AIRuntimeControlsSectionProps {
export const AIRuntimeControlsSection: Component<AIRuntimeControlsSectionProps> = (props) => {
const { state } = props;
+ const showAutonomousControlOption = () =>
+ !state.autoFixLocked() || state.showUpgradePrompts() || state.form.controlLevel === 'autonomous';
return (
<>
@@ -245,9 +247,12 @@ export const AIRuntimeControlsSection: Component<AIRuntimeControlsSectionProps>
<option value="controlled">
Controlled - Pulse Assistant executes with your approval
</option>
- <option value="autonomous">
- Autonomous - Pulse Assistant executes without approval (Pro)
- </option>
+ <Show when={showAutonomousControlOption()}>
+ <option value="autonomous">
+ Autonomous - Pulse Assistant executes without approval
+ {state.autoFixLocked() && state.showUpgradePrompts() ? ' (Pro)' : ''}
+ </option>
+ </Show>
</select>
</div>
<p class="text-[10px] text-muted ml-[7.5rem]">
diff --git a/frontend-modern/src/components/Settings/__tests__/AISettings.test.tsx b/frontend-modern/src/components/Settings/__tests__/AISettings.test.tsx
index 98239f5fa4..c2852dda0a 100644
--- a/frontend-modern/src/components/Settings/__tests__/AISettings.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/AISettings.test.tsx
@@ -329,6 +329,38 @@ describe('AISettings model loading error states', () => {
expect(screen.getByText('Legacy Model V1')).toBeInTheDocument();
});
+
+ it('hides autonomous controls when auto-fix is locked and upgrade prompts are hidden', async () => {
+ hasFeatureMock.mockImplementation((feature: string) => feature !== 'ai_autofix');
+ presentationPolicyHidesUpgradePromptsMock.mockReturnValue(true);
+
+ renderComponent();
+
+ await waitFor(() => {
+ expect(getSettingsMock).toHaveBeenCalledTimes(1);
+ });
+
+ expect(screen.queryByRole('option', { name: /Autonomous/i })).not.toBeInTheDocument();
+ expect(trackPaywallViewedMock).not.toHaveBeenCalled();
+ });
+
+ it('keeps an existing autonomous setting visible even when upgrade prompts are hidden', async () => {
+ hasFeatureMock.mockImplementation((feature: string) => feature !== 'ai_autofix');
+ presentationPolicyHidesUpgradePromptsMock.mockReturnValue(true);
+ getSettingsMock.mockResolvedValue({
+ ...baseSettings(),
+ control_level: 'autonomous',
+ });
+
+ renderComponent();
+
+ await waitFor(() => {
+ expect(getSettingsMock).toHaveBeenCalledTimes(1);
+ });
+
+ expect(screen.getByRole('option', { name: /Autonomous/i })).toBeInTheDocument();
+ expect(screen.queryByText('(Pro)')).not.toBeInTheDocument();
+ });
});
describe('AISettings load failure error state', () => {
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index 1931a96811..f3ec18fa7c 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -4,6 +4,7 @@ import settingsDialogsSource from '../SettingsDialogs.tsx?raw';
import settingsPageShellSource from '../SettingsPageShell.tsx?raw';
import aiSettingsDialogsSource from '../AISettingsDialogs.tsx?raw';
import aiModelSelectionSectionSource from '../AIModelSelectionSection.tsx?raw';
+import aiRuntimeControlsSectionSource from '../AIRuntimeControlsSection.tsx?raw';
import aiSettingsModelSource from '../aiSettingsModel.ts?raw';
import generalSettingsPanelSource from '../GeneralSettingsPanel.tsx?raw';
import settingsHeaderMetaSource from '../settingsHeaderMeta.ts?raw';
@@ -150,6 +151,9 @@ describe('settings architecture guardrails', () => {
expect(dataHandlingPanelSource).not.toContain('higher limits');
expect(dataHandlingPanelSource).not.toContain('Upgrade');
expect(dataHandlingPanelSource).not.toContain('Pro');
+ expect(aiRuntimeControlsSectionSource).toContain('showAutonomousControlOption');
+ expect(aiRuntimeControlsSectionSource).toContain("state.form.controlLevel === 'autonomous'");
+ expect(aiRuntimeControlsSectionSource).not.toContain('without approval (Pro)');
});
it('keeps system AI model catalogs on the shared searchable picker boundary', () => {