diff --git a/backend/src/__tests__/monitor-service.test.ts b/backend/src/__tests__/monitor-service.test.ts index 6afc9a9e..b522cada 100644 --- a/backend/src/__tests__/monitor-service.test.ts +++ b/backend/src/__tests__/monitor-service.test.ts @@ -1453,7 +1453,7 @@ describe('MonitorService - janitor cycle and circuit breaker', () => { expect(mockGetDiskUsage).not.toHaveBeenCalled(); }); - it('dispatches an alert when reclaimable exceeds the threshold', async () => { + it('dispatches a node-neutral janitor alert', async () => { mockGetGlobalSettings.mockReturnValue({ docker_janitor_gb: '0.5' }); mockGetDiskUsage.mockResolvedValue(RECLAIMABLE_3GB); mockGetSystemState.mockReturnValue('0'); // No prior alert; cooldown elapsed. @@ -1462,7 +1462,10 @@ describe('MonitorService - janitor cycle and circuit breaker', () => { await (svc as any).evaluateJanitor(); expect(mockDispatchAlert).toHaveBeenCalledWith( - 'info', 'system', expect.stringContaining('3.0 GB'), { stackName: undefined, actor: 'system:monitor' }, + 'info', + 'system', + 'This node has accumulated 3.0 GB of unused Docker data. Open Resources to reclaim space, or set up a Prune Node Resources schedule.', + { stackName: undefined, actor: 'system:monitor' }, ); }); diff --git a/backend/src/services/MonitorService.ts b/backend/src/services/MonitorService.ts index 2651d2c1..608a9208 100644 --- a/backend/src/services/MonitorService.ts +++ b/backend/src/services/MonitorService.ts @@ -439,15 +439,14 @@ export class MonitorService { const MIN_RECLAIMABLE_GB = 0.1; if (reclaimGb >= janitorLimitGb && reclaimGb >= MIN_RECLAIMABLE_GB) { - const registry = NodeRegistry.getInstance(); - const localNode = registry.getNode(registry.getDefaultNodeId()); - const nodeLabel = localNode?.name ?? 'this node'; + // Node-neutral body: the hub bell badge attributes remotes. + // Embedding the local seed name ("Local") made fleet alerts look wrong. await this.dispatchWithCooldown( HOST_ALERT_KEYS.janitor, JANITOR_COOLDOWN_MS, 'info', 'system', - `Node "${nodeLabel}" has accumulated ${reclaimGb.toFixed(1)} GB of unused Docker data. Open Resources to reclaim space, or set up a Prune Node Resources schedule.`, + `This node has accumulated ${reclaimGb.toFixed(1)} GB of unused Docker data. Open Resources to reclaim space, or set up a Prune Node Resources schedule.`, ); } } finally { diff --git a/docs/features/alerts-notifications.mdx b/docs/features/alerts-notifications.mdx index c49819c3..4046ec7c 100644 --- a/docs/features/alerts-notifications.mdx +++ b/docs/features/alerts-notifications.mdx @@ -324,7 +324,7 @@ The entire host threshold evaluation can be silenced per node from **Settings ยท ### Reclaimable Docker data -`info`/`system`: `Node "" has accumulated GB of unused Docker data. Open Resources to reclaim space, or set up a Prune Node Resources schedule.` 24-hour cooldown. +`info`/`system`: `This node has accumulated GB of unused Docker data. Open Resources to reclaim space, or set up a Prune Node Resources schedule.` 24-hour cooldown. On a multi-node fleet the bell attributes remotes with a node-name badge rather than embedding the name in the message. ### Sencho version availability