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 active Assistant model route during turns

rcourtmanbf1d5ceeaf90
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index 8b27630a23..d44ae3c2e0 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -135,6 +135,12 @@ runtime cost control, and shared AI transport surfaces.
user turn as well as final assistant turns, and the browser chat runtime must
restore the latest explicit `provider:model` route from loaded session
messages before publishing the loaded session ID to drawer/session storage.
+ During an active Assistant turn, the drawer must keep the effective model
+ route visible next to the live turn status using the route recorded on the
+ streaming assistant message first and the selected route only as a fallback;
+ live progress text remains the activity description, while route identity is
+ separate compact chrome so provider/model state stays inspectable without
+ polluting status copy.
Legacy bare model names, provider response IDs without a Pulse route prefix,
URLs, and malformed route strings must be ignored so loading older sessions
cannot corrupt the active selector. The referenced OpenCode source at fetched
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 5ebfebcd3c..3db80de73f 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx
+++ b/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx
@@ -5151,6 +5151,39 @@ describe('AIChat', () => {
expect(screen.queryByText('Generating response...')).not.toBeInTheDocument();
});
+ it('shows the active model route beside active turn progress', () => {
+ mockChat.isLoading.mockReturnValue(true);
+ mockChat.messages.mockReturnValue([
+ {
+ id: 'msg-1',
+ role: 'assistant' as const,
+ content: '',
+ timestamp: new Date(),
+ isStreaming: true,
+ model: 'openrouter:qwen/qwen3.7-plus',
+ streamEvents: [],
+ workflowStatus: {
+ phase: 'context',
+ message: 'Reading current Pulse inventory.',
+ state: 'READING',
+ tool: 'pulse_query',
+ },
+ },
+ ]);
+ renderChat();
+
+ const status = screen.getByLabelText('Assistant active turn status');
+ expect(status).toHaveTextContent('Reading current Pulse inventory.');
+ expect(status).not.toHaveTextContent('Qwen');
+
+ const route = screen.getByLabelText('Assistant active model route');
+ expect(route).toHaveTextContent('Qwen: Qwen3.7 Plus via OpenRouter');
+ expect(route).toHaveAttribute(
+ 'title',
+ expect.stringContaining('Active Assistant model route'),
+ );
+ });
+
it('shows live provider retry countdowns in the active turn status', () => {
vi.useFakeTimers();
vi.setSystemTime(2_300);
diff --git a/frontend-modern/src/components/AI/Chat/index.tsx b/frontend-modern/src/components/AI/Chat/index.tsx
index 2c00bfca2c..0c7a35378b 100644
--- a/frontend-modern/src/components/AI/Chat/index.tsx
+++ b/frontend-modern/src/components/AI/Chat/index.tsx
@@ -15,6 +15,7 @@ import SquareIcon from 'lucide-solid/icons/square';
import ClockIcon from 'lucide-solid/icons/clock';
import ClipboardCopyIcon from 'lucide-solid/icons/clipboard-copy';
import CopyIcon from 'lucide-solid/icons/copy';
+import CpuIcon from 'lucide-solid/icons/cpu';
import DownloadIcon from 'lucide-solid/icons/download';
import GitForkIcon from 'lucide-solid/icons/git-fork';
import PencilIcon from 'lucide-solid/icons/pencil';
@@ -232,6 +233,11 @@ interface AssistantProviderRouteHealthPresentation {
dotClassName: string;
}
+interface AssistantActiveRoutePresentation {
+ label: string;
+ title: string;
+}
+
interface PromptHistoryEntry {
prompt: string;
mentions: MentionResource[];
@@ -2501,6 +2507,23 @@ export const AIChat: Component<AIChatProps> = (props) => {
if (elapsedSeconds < 2) return status.text;
return `${status.text} (${elapsedSeconds}s)`;
});
+ const activeTurnRoute = createMemo<AssistantActiveRoutePresentation | null>(() => {
+ if (!currentStatus()) return null;
+ const model = activeAssistantMessage()?.model?.trim() || selectedChatModel().trim();
+ if (!model) return null;
+ const label = formatChatMessageModelRoute(model);
+ if (!label) return null;
+ const provider = providerForModelRoute(model);
+ const providerLabel = provider ? getAIProviderDisplayName(provider) : '';
+ return {
+ label,
+ title: compactText([
+ 'Active Assistant model route',
+ label,
+ providerLabel ? `Provider: ${providerLabel}` : undefined,
+ ]).join('. '),
+ };
+ });
const lastAssistantUsage = createMemo(() => {
const messages = chat.messages();
for (let index = messages.length - 1; index >= 0; index -= 1) {
@@ -4504,6 +4527,19 @@ export const AIChat: Component<AIChatProps> = (props) => {
/>
</span>
</div>
+ <Show when={activeTurnRoute()}>
+ {(route) => (
+ <div
+ class="inline-flex h-7 min-w-0 max-w-[42%] shrink items-center gap-1.5 rounded-md border border-border-subtle bg-surface px-2 text-[10px] font-medium text-muted"
+ role="status"
+ aria-label="Assistant active model route"
+ title={route().title}
+ >
+ <CpuIcon class="h-3 w-3 shrink-0 text-blue-500" aria-hidden="true" />
+ <span class="min-w-0 truncate">{route().label}</span>
+ </div>
+ )}
+ </Show>
<button
type="button"
onClick={stopActiveResponse}