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.

Add provider settings action to Assistant model picker

rcourtmana8833dca2c99
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index e1ba93381e..9e2011e3e9 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -218,7 +218,14 @@ timers when the stream already has a newer workflow/tool state.
search/listbox surface, focus search on open, move keyboard focus from
search into the current or filtered model row, and keep every actionable
list row, including catalog-disclosure rows, navigable without requiring
- mouse clicks. Stop is the explicit
+ mouse clicks. The 2026-06-07 model-provider slice rechecked OpenCode
+ `origin/dev` commit `914a643`: `packages/app/src/components/dialog-select-model.tsx`
+ exposes provider connection and model management actions directly inside
+ the model picker, while `packages/tui/src/component/dialog-model.tsx`
+ exposes a provider action in the same dialog. Pulse adapts that by wiring
+ the Assistant model chooser's provider action to the governed Assistant &
+ Patrol provider settings route instead of hiding provider repair behind a
+ separate slash command or silently switching model routes. Stop is the explicit
interruption path: it must abort the active stream, clear queued follow-ups
and pending tool/approval/question affordances, preserve any partial model
text, return focus to the composer, and render a neutral transcript marker
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 2ff3789007..af3a0fb86e 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -1564,7 +1564,11 @@ The shared AI model picker owns model route search and presentation for
Assistant surfaces. External open requests may seed an initial search query,
but filtering, current/default route badges, recent routes, and custom route
selection must remain inside `AIModelPicker`; callers should not duplicate that
-logic in command handlers or feature-local model selectors.
+logic in command handlers or feature-local model selectors. Optional provider
+management actions belong in the same picker header as model refresh so
+Assistant and settings surfaces can expose provider repair without forking the
+model-list shell; callers own the destination, while the shared picker owns the
+button placement, labeling, close behavior, and keyboard-safe dropdown state.
The Patrol alert-trigger severity selector under
`frontend-modern/src/features/patrol/` is built on the shared `FormSelect`
diff --git a/frontend-modern/src/components/AI/Chat/ModelSelector.tsx b/frontend-modern/src/components/AI/Chat/ModelSelector.tsx
index 3e3038632f..f20d89d910 100644
--- a/frontend-modern/src/components/AI/Chat/ModelSelector.tsx
+++ b/frontend-modern/src/components/AI/Chat/ModelSelector.tsx
@@ -21,6 +21,7 @@ export interface ModelSelectorProps {
initialSearchQuery?: string;
onModelSelect: (modelId: string) => void;
onRefresh?: () => void;
+ onManageProviders?: () => void;
}
/**
@@ -94,6 +95,8 @@ export const ModelSelector: Component<ModelSelectorProps> = (props) => {
openRequest={props.openRequest}
initialSearchQuery={props.initialSearchQuery}
onRefresh={props.onRefresh}
+ onManageProviders={props.onManageProviders}
+ manageProvidersLabel="Open Assistant provider settings"
align="left"
buttonClass="flex flex-shrink-0 items-center gap-1.5 rounded-md border border-border bg-surface px-2.5 py-1.5 text-[11px] text-muted transition-colors hover:border-border hover:text-base-content"
buttonLabelClass="max-w-[90px] truncate font-medium sm:max-w-[180px]"
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 37abb41dc3..bd68caaa62 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx
+++ b/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx
@@ -36,6 +36,7 @@ const {
recentModelIds?: string[];
openRequest?: number;
initialSearchQuery?: string;
+ onManageProviders?: () => void;
onModelSelect?: (modelId: string) => void;
}> = [];
const mockChat = {
@@ -306,6 +307,7 @@ vi.mock('../ModelSelector', () => ({
recentModelIds?: string[];
openRequest?: number;
initialSearchQuery?: string;
+ onManageProviders?: () => void;
onModelSelect?: (modelId: string) => void;
}) => {
mockModelSelectorProps.push(props);
@@ -1864,6 +1866,19 @@ describe('AIChat', () => {
expect(mockChat.sendMessage).not.toHaveBeenCalled();
});
+ it('wires Assistant provider settings into the model selector', () => {
+ const onClose = vi.fn();
+ renderChat(onClose);
+
+ const selectorProps = mockModelSelectorProps[mockModelSelectorProps.length - 1];
+ expect(selectorProps.onManageProviders).toEqual(expect.any(Function));
+
+ selectorProps.onManageProviders?.();
+
+ expect(mockNavigate).toHaveBeenCalledWith('/settings/system-ai');
+ expect(onClose).toHaveBeenCalledTimes(1);
+ });
+
it('filters slash command suggestions by alias and runs clicked commands', async () => {
renderChat();
await waitFor(() => {
diff --git a/frontend-modern/src/components/AI/Chat/index.tsx b/frontend-modern/src/components/AI/Chat/index.tsx
index 6a1dc73a6e..8cf36532ce 100644
--- a/frontend-modern/src/components/AI/Chat/index.tsx
+++ b/frontend-modern/src/components/AI/Chat/index.tsx
@@ -4593,6 +4593,7 @@ export const AIChat: Component<AIChatProps> = (props) => {
initialSearchQuery={modelSelectorInitialSearch()}
onModelSelect={selectModel}
onRefresh={() => loadModels(true)}
+ onManageProviders={openAssistantProviderSettings}
/>
<Show when={providerRouteHealth()}>
{(health) => (
diff --git a/frontend-modern/src/components/shared/AIModelPicker.tsx b/frontend-modern/src/components/shared/AIModelPicker.tsx
index 4a9ae196a1..ebdb092ead 100644
--- a/frontend-modern/src/components/shared/AIModelPicker.tsx
+++ b/frontend-modern/src/components/shared/AIModelPicker.tsx
@@ -12,6 +12,7 @@ import {
import ChevronDownIcon from 'lucide-solid/icons/chevron-down';
import MonitorIcon from 'lucide-solid/icons/monitor';
import RefreshCwIcon from 'lucide-solid/icons/refresh-cw';
+import SettingsIcon from 'lucide-solid/icons/settings';
import { SearchField } from '@/components/shared/SearchField';
import type { ModelInfo } from '@/types/ai';
import { AI_CHAT_MODEL_SELECTOR_EMPTY_STATE } from '@/utils/aiChatPresentation';
@@ -56,6 +57,8 @@ export interface AIModelPickerProps {
isLoading?: boolean;
error?: string;
onRefresh?: () => void;
+ onManageProviders?: () => void;
+ manageProvidersLabel?: string;
openRequest?: number;
initialSearchQuery?: string;
align?: 'left' | 'right';
@@ -413,6 +416,10 @@ export const AIModelPicker: Component<AIModelPickerProps> = (props) => {
props.onModelSelect(modelId);
closePicker();
};
+ const handleManageProviders = () => {
+ closePicker();
+ props.onManageProviders?.();
+ };
const isSelectedRoute = (modelId: string) => selectedModel() === modelId;
const optionClass = (isSelected: boolean) =>
`w-full px-3 py-2 text-left text-sm hover:bg-surface-hover ${
@@ -648,6 +655,17 @@ export const AIModelPicker: Component<AIModelPickerProps> = (props) => {
searchInputRef = el;
}}
/>
+ <Show when={props.onManageProviders}>
+ <button
+ type="button"
+ onClick={handleManageProviders}
+ class="rounded-md p-1.5 text-muted hover:bg-surface-hover hover:text-base-content"
+ title={props.manageProvidersLabel || 'Open provider settings'}
+ aria-label={props.manageProvidersLabel || 'Open provider settings'}
+ >
+ <SettingsIcon class="h-3.5 w-3.5" />
+ </button>
+ </Show>
<Show when={props.onRefresh}>
<button
type="button"
diff --git a/frontend-modern/src/components/shared/__tests__/AIModelPicker.test.tsx b/frontend-modern/src/components/shared/__tests__/AIModelPicker.test.tsx
index 1969c8cfb5..473f8f449c 100644
--- a/frontend-modern/src/components/shared/__tests__/AIModelPicker.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/AIModelPicker.test.tsx
@@ -201,6 +201,28 @@ describe('AIModelPicker', () => {
).toBeInTheDocument();
});
+ it('opens provider management from the model chooser header', () => {
+ const onManageProviders = vi.fn();
+ render(() => (
+ <AIModelPicker
+ models={models}
+ selectedModel="openrouter:minimax/minimax-m2.5"
+ onModelSelect={vi.fn()}
+ onManageProviders={onManageProviders}
+ manageProvidersLabel="Open Assistant provider settings"
+ title="Select shared default model"
+ />
+ ));
+
+ fireEvent.click(screen.getByTitle('Select shared default model'));
+ fireEvent.click(screen.getByRole('button', { name: 'Open Assistant provider settings' }));
+
+ expect(onManageProviders).toHaveBeenCalledTimes(1);
+ expect(
+ screen.queryByRole('dialog', { name: 'Select shared default model' }),
+ ).not.toBeInTheDocument();
+ });
+
it('prefills search when opened by an external request', async () => {
const [openRequest, setOpenRequest] = createSignal(0);
const [initialSearchQuery, setInitialSearchQuery] = createSignal('');