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.

Show Patrol recommendations in Assistant sessions

rcourtmana4cdd02c3658
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index 710e08ee31..c7ea587561 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -357,7 +357,10 @@ runtime cost control, and shared AI transport surfaces.
omit raw commands, preflight bodies, and execution output.
The Assistant drawer must also fetch that current session list before
opening the session picker instead of presenting mount-time cached
- summaries as the operator's decision surface.
+ summaries as the operator's decision surface. For restored Patrol
+ assessment sessions, that picker must present the safe recommended
+ next-step/action label from `handoff_summary` when one is available instead
+ of reducing the saved session to generic assessment context.
Browser-originated `handoff_context`, `handoff_resources`, and
`handoff_actions` plus safe `handoff_metadata` are one-shot request seeds
for the first successful chat turn. After that send succeeds, the drawer
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index c5d1962d2d..549f52b96d 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -204,9 +204,9 @@ work extends shared components instead of creating new local variants.
it must not infer a finding target from bounded action references or
reconstruct hidden model context, provider details, retry payloads, commands,
preflight output, or action results in the browser. If the safe summary
- includes a Patrol assessment recommended next step or action label, restored
- drawer briefing and action copy must use that recommendation rather than
- falling back to generic assessment copy.
+ includes a Patrol assessment recommended next step or action label, the
+ session picker plus restored drawer briefing and action copy must use that
+ recommendation rather than falling back to generic assessment copy.
Session-load and new-conversation transitions must be success-bound: if the
underlying session operation fails, the shared drawer store must not clear or
replace the current scoped handoff context.
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx b/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx
index 2ebbe53911..8d88022a44 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx
+++ b/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx
@@ -902,6 +902,7 @@ describe('AIChat', () => {
await waitFor(() => {
expect(screen.getByText('Pulse Patrol')).toBeInTheDocument();
expect(screen.getByText('Assessment context')).toBeInTheDocument();
+ expect(screen.getByText('Recommended: Run Patrol')).toBeInTheDocument();
});
fireEvent.click(screen.getByText('Assessment follow-up'));
diff --git a/frontend-modern/src/components/AI/Chat/index.tsx b/frontend-modern/src/components/AI/Chat/index.tsx
index 559bdf0531..30fcc89a3c 100644
--- a/frontend-modern/src/components/AI/Chat/index.tsx
+++ b/frontend-modern/src/components/AI/Chat/index.tsx
@@ -145,6 +145,14 @@ const getSessionHandoffBadgeLabel = (summary: ChatSessionHandoffSummary) => {
return summary.has_model_context ? 'Context attached' : 'Scoped handoff';
};
+const formatSessionHandoffRecommendationLabel = (summary: ChatSessionHandoffSummary) => {
+ if (!isPatrolAssessmentSessionHandoff(summary)) return '';
+ const action = summary.recommended_next_step_action?.trim();
+ if (action) return `Recommended: ${action}`;
+ const nextStep = summary.recommended_next_step?.trim();
+ return nextStep ? `Recommended: ${nextStep}` : '';
+};
+
const buildSessionHandoffContext = (session?: ChatSession): AIChatContext | undefined => {
const summary = session?.handoff_summary;
if (!summary) return undefined;
@@ -1388,6 +1396,13 @@ export const AIChat: Component<AIChatProps> = (props) => {
</span>
)}
</Show>
+ <Show when={formatSessionHandoffRecommendationLabel(summary())}>
+ {(recommendation) => (
+ <span class="max-w-full truncate rounded border border-emerald-200 bg-emerald-50 px-1.5 py-0.5 text-[10px] font-medium text-emerald-700 dark:border-emerald-800 dark:bg-emerald-950 dark:text-emerald-200">
+ {recommendation()}
+ </span>
+ )}
+ </Show>
</div>
)}
</Show>