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.

Allow Assistant sends during provider warnings

rcourtman1f1ab45b329e
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index da9cdc1a8f..98af8d2c94 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -71,17 +71,20 @@ runtime cost control, and shared AI transport surfaces.
key-management links must not be streamed or persisted as chat-visible
assistant output.
Assistant provider readiness is part of that same request flow: when the
- drawer opens or the selected chat model changes, the frontend must verify
- the selected provider/model through `/api/ai/test/{provider}` before the
- next user send. That check must use neutral provider diagnostic copy owned
- by `internal/ai/`, not Patrol runtime-finding wording, and the drawer may
- surface the result as actionable retry/settings status plus same-model
- configured-provider alternatives without converting it into
+ drawer opens or the selected chat model changes, the frontend must start a
+ background verification of the selected provider/model through
+ `/api/ai/test/{provider}`. That check must use neutral provider diagnostic
+ copy owned by `internal/ai/`, not Patrol runtime-finding wording, and the
+ drawer may surface the result as actionable retry/settings status plus
+ same-model configured-provider alternatives without converting it into
assistant-authored output. Provider checking is a background diagnostic and
must not delay the user's first useful chat turn; a confirmed selected-route
- provider error must keep typed text and focus while blocking dispatch until
- the route is rechecked successfully or the operator chooses a ready
- alternative.
+ provider error must keep typed text and focus without blocking normal chat
+ dispatch. If the operator sends while that warning is still visible, the
+ send path owns the attempt and any retryable provider failure is handled as
+ a normal failed turn with draft restoration. Same-model configured-provider
+ alternatives remain one-click route changes, not required preconditions for
+ sending.
Follow-up sends during an active Assistant response are chat-runtime queue
state by default. The drawer must accept and echo the user's follow-up as a
queued user turn without aborting or replacing the active model stream, must
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 9a9499ad13..17bf579cdc 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx
+++ b/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx
@@ -448,7 +448,7 @@ describe('AIChat', () => {
expect(document.activeElement).toBe(textarea);
});
- it('keeps user input queued while a selected provider issue is unresolved', async () => {
+ it('sends user input while a selected provider issue is unresolved', async () => {
mockAIAPI.getSettings.mockResolvedValue({
model: 'deepseek:deepseek-v4-pro',
chat_model: '',
@@ -475,15 +475,19 @@ describe('AIChat', () => {
) as HTMLTextAreaElement;
fireEvent.input(textarea, { target: { value: 'summarize the cluster' } });
- expect(screen.getByRole('button', { name: 'Send message' })).toBeDisabled();
+ expect(screen.getByRole('button', { name: 'Send message' })).not.toBeDisabled();
fireEvent.keyDown(textarea, { key: 'Enter' });
- expect(mockChat.sendMessage).not.toHaveBeenCalled();
- expect(textarea.value).toBe('summarize the cluster');
+ expect(mockChat.sendMessage).toHaveBeenCalledWith(
+ 'summarize the cluster',
+ undefined,
+ undefined,
+ );
+ expect(textarea.value).toBe('');
expect(document.activeElement).toBe(textarea);
});
- it('keeps user input queued when the readiness issue reports a provider-qualified model', async () => {
+ it('sends user input when the readiness issue reports a provider-qualified model', async () => {
mockAIAPI.getSettings.mockResolvedValue({
model: 'gpt-4',
chat_model: '',
@@ -510,11 +514,15 @@ describe('AIChat', () => {
) as HTMLTextAreaElement;
fireEvent.input(textarea, { target: { value: 'summarize the cluster' } });
- expect(screen.getByRole('button', { name: 'Send message' })).toBeDisabled();
+ expect(screen.getByRole('button', { name: 'Send message' })).not.toBeDisabled();
fireEvent.keyDown(textarea, { key: 'Enter' });
- expect(mockChat.sendMessage).not.toHaveBeenCalled();
- expect(textarea.value).toBe('summarize the cluster');
+ expect(mockChat.sendMessage).toHaveBeenCalledWith(
+ 'summarize the cluster',
+ undefined,
+ undefined,
+ );
+ expect(textarea.value).toBe('');
expect(document.activeElement).toBe(textarea);
});
diff --git a/frontend-modern/src/components/AI/Chat/index.tsx b/frontend-modern/src/components/AI/Chat/index.tsx
index 8a6971ef10..9be72bdc6e 100644
--- a/frontend-modern/src/components/AI/Chat/index.tsx
+++ b/frontend-modern/src/components/AI/Chat/index.tsx
@@ -754,23 +754,6 @@ export const AIChat: Component<AIChatProps> = (props) => {
});
});
- const providerReadinessMatchesSelection = (readiness: ChatProviderReadinessState) => {
- const selectedProvider = selectedChatProvider().trim();
- const selectedModel = selectedChatModel().trim();
- if (!selectedProvider || !selectedModel) return false;
- if (readiness.provider.trim() !== selectedProvider) return false;
- return (
- !readiness.model ||
- normalizeComparableModelKey(readiness.model) === normalizeComparableModelKey(selectedModel)
- );
- };
-
- const providerReadinessHasBlockingError = createMemo(() => {
- const readiness = providerReadiness();
- if (readiness.status !== 'error') return false;
- return providerReadinessMatchesSelection(readiness);
- });
-
let providerReadinessRequestId = 0;
let lastProviderReadinessKey = '';
@@ -1404,10 +1387,6 @@ export const AIChat: Component<AIChatProps> = (props) => {
const submittedInput = input();
const prompt = submittedInput.trim();
if (!prompt) return;
- if (providerReadinessHasBlockingError()) {
- focusComposer();
- return;
- }
const mentions = accumulatedMentions();
const submittedMentions = cloneMentions(mentions);
const mentionsForAPI =
@@ -2363,7 +2342,7 @@ export const AIChat: Component<AIChatProps> = (props) => {
</Show>
<button
type="submit"
- disabled={!input().trim() || providerReadinessHasBlockingError()}
+ disabled={!input().trim()}
class="flex h-9 w-9 items-center justify-center rounded-md bg-blue-600 text-white shadow-sm transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-45"
title={chat.isLoading() ? 'Queue follow-up' : 'Send'}
aria-label={chat.isLoading() ? 'Queue follow-up' : 'Send message'}