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.

Suppress residual self-hosted paid prompts

rcourtman66bcb49d00ce
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 87fa5c191d..cc646a3743 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -718,6 +718,10 @@ advertise agent-profile upgrades, trial prompts, or paid helper links while
`presentationPolicy.hideUpgrade` is true; it should stay on the free source
manager unless an explicit entitlement or recovery context makes the paid
lifecycle surface relevant.
+The normal Infrastructure installer also follows that contract. Agent-command
+execution controls may describe the runtime trust and command-execution effect,
+but their default labels and tooltips must not mention Pro requirements or paid
+upgrade posture while they are part of the ordinary host-install workflow.
That same demo-hidden API boundary also keeps runtime-admin operations out of
public lifecycle flows: `/api/diagnostics`,
`/api/diagnostics/docker/prepare-token`, and `/api/logs/*` must return `404`
diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.md
index 5dfe72d89f..16e519808c 100644
--- a/docs/release-control/v6/internal/subsystems/alerts.md
+++ b/docs/release-control/v6/internal/subsystems/alerts.md
@@ -157,6 +157,11 @@ the canonical `ai_alerts` destination from the shared license/commercial
contract, but it must delegate the actual open behavior to the
`frontend-primitives` typed upgrade-navigation owner instead of reintroducing
alert-local `window.open(...)` or raw external-tab assumptions.
+That same alert button must also honor the ordinary self-hosted prompt
+suppression policy: when `presentationPolicy.hideUpgrade` is true, a locked
+alert-investigation action may remain visibly unavailable, but it must not
+show Pro-required tooltip copy, track upgrade clicks, or open the commercial
+handoff route.
Alert-adjacent shared helpers also inherit the runtime-versus-commercial split
now carried by the shared licensing stores. Alert pages may consume runtime
feature truth from `frontend-modern/src/stores/license.ts`, but any
diff --git a/frontend-modern/src/components/Alerts/InvestigateAlertButton.tsx b/frontend-modern/src/components/Alerts/InvestigateAlertButton.tsx
index b006e88d64..e79a422a10 100644
--- a/frontend-modern/src/components/Alerts/InvestigateAlertButton.tsx
+++ b/frontend-modern/src/components/Alerts/InvestigateAlertButton.tsx
@@ -6,6 +6,7 @@ import { getCanonicalAlertId } from '@/features/alerts/identity';
import { formatAlertValue } from '@/utils/alertFormatters';
import { resolveAlertTargetType } from '@/utils/alertTargetTypes';
import { getUpgradeActionDestination } from '@/stores/licenseCommercial';
+import { presentationPolicyHidesUpgradePrompts } from '@/stores/sessionPresentationPolicy';
import { trackUpgradeClicked } from '@/utils/upgradeMetrics';
interface InvestigateAlertButtonProps {
@@ -27,6 +28,13 @@ export function InvestigateAlertButton(props: InvestigateAlertButtonProps) {
const [isHovered, setIsHovered] = createSignal(false);
const openUpgradeDestination = useUpgradeNavigation();
const isLocked = () => props.licenseLocked === true;
+ const canShowUpgradePrompt = () => !presentationPolicyHidesUpgradePrompts();
+ const lockedTitle = () =>
+ canShowUpgradePrompt()
+ ? 'Pro required to investigate alerts with Pulse Assistant'
+ : 'Pulse Assistant alert investigation is not available for this alert';
+ const buttonTitle = () =>
+ isLocked() ? lockedTitle() : 'Ask Pulse Assistant to investigate this alert';
// Don't render if AI is not enabled
if (aiChatStore.enabled !== true) {
return null;
@@ -36,6 +44,9 @@ export function InvestigateAlertButton(props: InvestigateAlertButtonProps) {
e.stopPropagation();
e.preventDefault();
if (isLocked()) {
+ if (!canShowUpgradePrompt()) {
+ return;
+ }
trackUpgradeClicked('investigate_alert_button', 'ai_alerts');
openUpgradeDestination(getUpgradeActionDestination('ai_alerts'));
return;
@@ -121,11 +132,7 @@ Please:
border border-border
${isLocked() ? 'opacity-60 cursor-not-allowed hover:bg-surface' : ''}
${props.class || ''}`}
- title={
- isLocked()
- ? 'Pro required to investigate alerts with Pulse Assistant'
- : 'Ask Pulse Assistant to investigate this alert'
- }
+ title={buttonTitle()}
aria-disabled={isLocked()}
>
<svg
@@ -162,11 +169,7 @@ Please:
gap-1.5
${isLocked() ? 'opacity-60 cursor-not-allowed hover:bg-surface' : ''}
${props.class || ''}`}
- title={
- isLocked()
- ? 'Pro required to investigate alerts with Pulse Assistant'
- : 'Ask Pulse Assistant to investigate this alert'
- }
+ title={buttonTitle()}
aria-disabled={isLocked()}
>
<svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
@@ -197,11 +200,7 @@ Please:
gap-2
${isLocked() ? 'opacity-60 cursor-not-allowed hover:bg-blue-600' : ''}
${props.class || ''}`}
- title={
- isLocked()
- ? 'Pro required to investigate alerts with Pulse Assistant'
- : 'Ask Pulse Assistant to investigate this alert'
- }
+ title={buttonTitle()}
aria-disabled={isLocked()}
>
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
diff --git a/frontend-modern/src/components/Alerts/__tests__/InvestigateAlertButton.test.tsx b/frontend-modern/src/components/Alerts/__tests__/InvestigateAlertButton.test.tsx
index b0a80f7d3e..904d6685c7 100644
--- a/frontend-modern/src/components/Alerts/__tests__/InvestigateAlertButton.test.tsx
+++ b/frontend-modern/src/components/Alerts/__tests__/InvestigateAlertButton.test.tsx
@@ -15,6 +15,7 @@ const {
mockAiChatStore,
getUpgradeActionDestinationMock,
getUpgradeActionUrlOrFallbackMock,
+ presentationPolicyHidesUpgradePromptsMock,
} =
vi.hoisted(() => {
const openWithPromptMock = vi.fn();
@@ -25,6 +26,7 @@ const {
);
const getUpgradeActionDestinationMock = vi.fn();
const getUpgradeActionUrlOrFallbackMock = vi.fn();
+ const presentationPolicyHidesUpgradePromptsMock = vi.fn();
const mockAiChatStore = {
enabled: true as boolean | null,
openWithPrompt: (...args: unknown[]) => openWithPromptMock(...args),
@@ -37,6 +39,7 @@ const {
mockAiChatStore,
getUpgradeActionDestinationMock,
getUpgradeActionUrlOrFallbackMock,
+ presentationPolicyHidesUpgradePromptsMock,
};
});
@@ -49,6 +52,10 @@ vi.mock('@/stores/licenseCommercial', () => ({
getUpgradeActionUrlOrFallback: (...args: unknown[]) => getUpgradeActionUrlOrFallbackMock(...args),
}));
+vi.mock('@/stores/sessionPresentationPolicy', () => ({
+ presentationPolicyHidesUpgradePrompts: () => presentationPolicyHidesUpgradePromptsMock(),
+}));
+
vi.mock('@/components/shared/useUpgradeNavigation', () => ({
useUpgradeNavigation: () => openUpgradeDestinationMock,
}));
@@ -103,7 +110,9 @@ beforeEach(() => {
openUpgradeDestinationMock.mockReset();
getUpgradeActionDestinationMock.mockReset();
getUpgradeActionUrlOrFallbackMock.mockReset();
+ presentationPolicyHidesUpgradePromptsMock.mockReset();
mockAiChatStore.enabled = true;
+ presentationPolicyHidesUpgradePromptsMock.mockReturnValue(false);
getUpgradeActionDestinationMock.mockReturnValue({
href: getPublicPricingUrl('ai_alerts'),
external: true,
@@ -235,6 +244,24 @@ describe('InvestigateAlertButton', () => {
expect(openWithPromptMock).not.toHaveBeenCalled();
});
+ it('keeps the locked state non-promotional when upgrade prompts are hidden', async () => {
+ presentationPolicyHidesUpgradePromptsMock.mockReturnValue(true);
+
+ render(() => <InvestigateAlertButton alert={makeAlert()} licenseLocked={true} />);
+ const button = screen.getByRole('button');
+
+ expect(button).toHaveAttribute(
+ 'title',
+ 'Pulse Assistant alert investigation is not available for this alert',
+ );
+
+ await fireEvent.click(button);
+
+ expect(trackUpgradeClickedMock).not.toHaveBeenCalled();
+ expect(openUpgradeDestinationMock).not.toHaveBeenCalled();
+ expect(openWithPromptMock).not.toHaveBeenCalled();
+ });
+
it('still stops propagation when locked and clicked', () => {
render(() => <InvestigateAlertButton alert={makeAlert()} licenseLocked={true} />);
const button = screen.getByRole('button');
diff --git a/frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx b/frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx
index 1f1f016a15..613bd1cedf 100644
--- a/frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx
+++ b/frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx
@@ -407,7 +407,7 @@ export const InfrastructureInstallerSection: Component = () => {
<label
class="inline-flex cursor-pointer items-center gap-2 text-sm text-base-content"
- title="Allow Pulse Patrol to execute diagnostic and fix commands on this agent (auto-fix requires Pulse Pro)"
+ title="Allow Pulse Patrol to execute diagnostic and fix commands on this agent"
>
<input
type="checkbox"
diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx
index 8215935c68..24562eed3e 100644
--- a/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx
@@ -192,6 +192,10 @@ describe('infrastructure operations model', () => {
expect(infrastructureInstallerSectionSource).toContain(
'Generate an install token first. Pulse will then build copy-ready commands',
);
+ expect(infrastructureInstallerSectionSource).toContain(
+ 'Allow Pulse Patrol to execute diagnostic and fix commands on this agent',
+ );
+ expect(infrastructureInstallerSectionSource).not.toContain('auto-fix requires Pulse Pro');
expect(infrastructureInstallerSectionSource).not.toContain('<api-token>');
expect(infrastructureInstallerSectionSource).not.toContain(
'Copy disabled until an install token is generated',