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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Show prompt-send activity immediately
rcourtman9e9d08d2ff29
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.mdindex 36abb5a783..5ff89eca19 100644--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md@@ -633,6 +633,10 @@ runtime cost control, and shared AI transport surfaces.The local `stream-idle` fixture must exercise the real `stream_idle`workflow state after selected-provider startup so browser proof of visibleidle liveness does not depend on making a real provider pause on demand.+ The local `send-hold` fixture must exercise the local prompt-send boundary+ by emitting the session event and then holding before the first backend+ `workflow_state`, so browser proof can capture `Sending prompt.` without+ depending on real provider latency.This fixture is a local development primitive, not a product mode: it mustnot bypass backend governance in production, persist as a server session, orintroduce any UI-only event shape that real providers cannot emit.@@ -2137,6 +2141,23 @@ transcript row and the active-turn composer footer so the two live surfaces showthe latest canonical workflow state immediately. The transcript and footertherefore show current motion while the provider is starting, retrying, orreasoning, but completed answers do not retain stale internal-progress prose.+Prompt dispatch itself is also a visible live state: before any backend+workflow event returns, the frontend seeds the active assistant turn with a+local `request_send` / `Sending prompt.` workflow row after any selected-model+row. That row is explicitly transient: it is the current live state but does+not enter the paced backend workflow history, the first backend workflow state+may replace it, and content, thinking, tool, approval, question, model-route,+done, or error evidence removes it from the durable transcript. This adapts the+referenced OpenCode source at fetched `dev` commit+`e82542b8023a8374f29c23b70ec019c8f256354e`, where+`packages/opencode/src/cli/cmd/run/runtime.queue.ts` emits `turn.send` with+`sending prompt` at lines 174-184, `packages/opencode/src/cli/cmd/run/footer.ts`+maps `turn.send` and `turn.wait` to live footer status at lines 133-145, and+`packages/opencode/src/cli/cmd/run/stream.transport.ts` promotes quiet+post-send periods to `waiting for assistant` at lines 1350-1357. Pulse keeps+that send/wait distinction in the live chat turn while preserving the Pulse+transcript rule that only backend workflow, route, content, and tool evidence+remain once real activity exists.Assistant drawer shell status follows the same OpenCode-referenced separationbetween prompt-adjacent operational status and transcript content. Thediff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex 8da7e0b861..fb816a2a2e 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -610,7 +610,10 @@ payload shape change when the portal presents compact client rows.provider request, VPN dependency, or API spend. At least one fixture-backedAssistant sequence must exercise `stream_idle` after selected-providerstartup, so browser proof can verify visible idle liveness without forcing a- real provider to pause on demand.+ real provider to pause on demand. At least one fixture-backed Assistant+ sequence must exercise the local prompt-send state by emitting `session`,+ then pacing the first backend `workflow_state` long enough for browser proof+ to verify immediate visible activity without opening a provider request.34. `internal/api/ai_handlers.go` shared with `ai-runtime`: AI settings and remediation handlers are both an AI runtime control surface and a canonical API payload contract boundary.Legacy Assistant SSE routes in this handler that still use the olderexecute envelope, including `/api/ai/execute/stream` anddiff --git a/frontend-modern/src/api/__tests__/aiChat.test.ts b/frontend-modern/src/api/__tests__/aiChat.test.tsindex 0606665188..ea5b882f3e 100644--- a/frontend-modern/src/api/__tests__/aiChat.test.ts+++ b/frontend-modern/src/api/__tests__/aiChat.test.ts@@ -241,6 +241,52 @@ describe('AIChatAPI', () => {});});+ it('runs the send-hold dev stream fixture without opening a provider request', async () => {+ const onEvent = vi.fn();++ await AIChatAPI.chat(+ '/fixture send-hold',+ undefined,+ 'openrouter:qwen/qwen3.7-plus',+ onEvent,+ );++ expect(apiFetchMock).not.toHaveBeenCalled();+ expect(onEvent.mock.calls.map(([event]) => event.type)).toEqual([+ 'session',+ 'workflow_state',+ 'workflow_state',+ 'content',+ 'done',+ ]);+ expect(onEvent.mock.calls[0][0]).toMatchObject({+ type: 'session',+ data: { id: 'dev-fixture-send-hold' },+ });+ expect(onEvent.mock.calls[2][0]).toMatchObject({+ type: 'workflow_state',+ data: {+ phase: 'provider_start',+ message: 'OpenRouter is starting the response.',+ provider: 'openrouter',+ model: 'openrouter:qwen/qwen3.7-plus',+ },+ });+ expect(onEvent.mock.calls[3][0]).toMatchObject({+ type: 'content',+ data: {+ text: expect.stringContaining('inspect the local prompt-send state'),+ },+ });+ expect(onEvent.mock.calls[4][0]).toMatchObject({+ type: 'done',+ data: {+ session_id: 'dev-fixture-send-hold',+ model: 'openrouter:qwen/qwen3.7-plus',+ },+ });+ });+it('accepts the burst-tool alias for the tool-burst dev stream fixture', async () => {const onEvent = vi.fn();diff --git a/frontend-modern/src/api/aiChatDevStreamFixture.ts b/frontend-modern/src/api/aiChatDevStreamFixture.tsindex 5137120665..3c8965417d 100644--- a/frontend-modern/src/api/aiChatDevStreamFixture.ts+++ b/frontend-modern/src/api/aiChatDevStreamFixture.ts@@ -3,6 +3,7 @@ import type { AIChatStreamEvent } from './generated/aiChatEvents';export const AI_CHAT_DEV_STREAM_FIXTURE_PROMPTS = ['/fixture devices','/fixture assistant-stream',+ '/fixture send-hold','/fixture tool-burst','/fixture context-group','/fixture status-boundary',@@ -193,6 +194,44 @@ const buildDeviceCountFixtureEvents = (model?: string): AIChatStreamEvent[] => [},];+const buildSendHoldFixtureEvents = (model?: string): AIChatStreamEvent[] => [+ {+ type: 'session',+ data: { id: 'dev-fixture-send-hold' },+ },+ {+ type: 'workflow_state',+ data: {+ phase: 'request_start',+ message: 'Preparing Pulse context.',+ },+ },+ {+ type: 'workflow_state',+ data: {+ phase: 'provider_start',+ message: 'OpenRouter is starting the response.',+ provider: 'openrouter',+ model: assistantFixtureModel(model),+ },+ },+ {+ type: 'content',+ data: {+ text: 'The send-hold fixture paused long enough to inspect the local prompt-send state before backend workflow activity.',+ },+ },+ {+ type: 'done',+ data: {+ session_id: 'dev-fixture-send-hold',+ model: assistantFixtureModel(model),+ input_tokens: 32,+ output_tokens: 18,+ },+ },+];+const buildSkippedToolFixtureEvents = (model?: string): AIChatStreamEvent[] => [{type: 'session',@@ -780,6 +819,9 @@ const buildFixtureEvents = (prompt: string, model?: string): AIChatStreamEvent[]if (normalized === '/fixture tool-burst') {return buildToolBurstFixtureEvents(model);}+ if (normalized === '/fixture send-hold') {+ return buildSendHoldFixtureEvents(model);+ }if (normalized === '/fixture context-group') {return buildContextGroupFixtureEvents(model);}@@ -820,6 +862,9 @@ const fixtureStepDelay = (if (normalizedPrompt === '/fixture pending-tool' && event.type === 'tool_progress') {return 2200;}+ if (normalizedPrompt === '/fixture send-hold' && event.type === 'session') {+ return 1400;+ }if (normalizedPrompt === '/fixture context-group' && event.type === 'tool_start') {return 900;}diff --git a/frontend-modern/src/components/AI/Chat/__tests__/useChat.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/useChat.test.tsindex 5520bd4437..826046a4b0 100644--- a/frontend-modern/src/components/AI/Chat/__tests__/useChat.test.ts+++ b/frontend-modern/src/components/AI/Chat/__tests__/useChat.test.ts@@ -205,9 +205,10 @@ describe('useChat', () => {content: '',isStreaming: true,pendingTools: [],+ workflowStatusHistory: [],workflowStatus: {- phase: 'request_start',- message: 'Preparing Pulse context.',+ phase: 'request_send',+ message: 'Sending prompt.',},});expect(mockCreateSession).not.toHaveBeenCalled();@@ -305,9 +306,10 @@ describe('useChat', () => {role: 'assistant',model: 'openrouter:qwen/qwen3.7-plus',isStreaming: true,+ workflowStatusHistory: [],workflowStatus: {- phase: 'request_start',- message: 'Preparing Pulse context.',+ phase: 'request_send',+ message: 'Sending prompt.',},});expect(assistant.streamEvents).toEqual([@@ -316,6 +318,13 @@ describe('useChat', () => {model: 'openrouter:qwen/qwen3.7-plus',modelEvent: 'selected',}),+ expect.objectContaining({+ type: 'workflow_status',+ workflowStatus: expect.objectContaining({+ phase: 'request_send',+ message: 'Sending prompt.',+ }),+ }),]);resolveChat();@@ -1465,7 +1474,6 @@ describe('useChat', () => {}),]);expect(assistant.workflowStatusHistory?.map((status) => status.message)).toEqual([- 'Preparing Pulse context.','Reading current Pulse inventory with pulse_query.','Built compact inventory context for the model.','OpenRouter is starting the response.',@@ -1587,6 +1595,13 @@ describe('useChat', () => {model: 'openrouter:qwen/qwen3.7-plus',modelEvent: 'selected',}),+ expect.objectContaining({+ type: 'workflow_status',+ workflowStatus: expect.objectContaining({+ phase: 'request_send',+ message: 'Sending prompt.',+ }),+ }),]);const fire = getFireEvent();diff --git a/frontend-modern/src/components/AI/Chat/hooks/useChat.ts b/frontend-modern/src/components/AI/Chat/hooks/useChat.tsindex ed04f65a32..2348342393 100644--- a/frontend-modern/src/components/AI/Chat/hooks/useChat.ts+++ b/frontend-modern/src/components/AI/Chat/hooks/useChat.ts@@ -53,8 +53,8 @@ const latestExplicitModelRouteFromTranscript = (messages: ChatMessage[]): string};const createInitialAssistantWorkflowStatus = (startedAt = Date.now()): WorkflowStatus => ({- phase: 'request_start',- message: 'Preparing Pulse context.',+ phase: 'request_send',+ message: 'Sending prompt.',startedAt,});@@ -222,6 +222,13 @@ export function useChat(options: UseChatOptions = {}) {return events.filter((event) => event.type !== 'workflow_status');};+ const isLocalPromptSendEvent = (event: StreamDisplayEvent) =>+ event.type === 'workflow_status' && event.workflowStatus?.phase === 'request_send';++ const streamEventsWithoutLocalPromptSendRows = (+ events: StreamDisplayEvent[] | undefined,+ ): StreamDisplayEvent[] => (events || []).filter((event) => !isLocalPromptSendEvent(event));+const streamEventsWithoutTransientRows = (events: StreamDisplayEvent[] | undefined,): StreamDisplayEvent[] | undefined => {@@ -377,7 +384,10 @@ export function useChat(options: UseChatOptions = {}) {const addStreamEvent = (msg: ChatMessage, event: StreamDisplayEvent): ChatMessage => {const nextEvent = withStreamEventTiming(event);- const events = msg.streamEvents || [];+ const events =+ nextEvent.type === 'workflow_status' || nextEvent.type === 'model_switch'+ ? msg.streamEvents || []+ : streamEventsWithoutLocalPromptSendRows(msg.streamEvents);// For content events, merge consecutive content into oneif (nextEvent.type === 'content' && events.length > 0) {@@ -518,7 +528,8 @@ export function useChat(options: UseChatOptions = {}) {const model = route.trim();if (!model) return msg;const failedModel = options.failedModel?.trim();- const duplicate = (msg.streamEvents || []).some(+ const streamEvents = streamEventsWithoutLocalPromptSendRows(msg.streamEvents);+ const duplicate = streamEvents.some((event) =>event.type === 'model_switch' &&event.model?.trim() === model &&@@ -526,9 +537,9 @@ export function useChat(options: UseChatOptions = {}) {streamModelEventKind(event) === options.modelEvent,);if (duplicate) {- return { ...msg, model };+ return { ...msg, model, streamEvents };}- const events = msg.streamEvents || [];+ const events = streamEvents;if (options.modelEvent === 'selected' && !failedModel) {const replaceableIndex = replaceableSelectedModelEventIndex(events);if (replaceableIndex >= 0) {@@ -1786,18 +1797,29 @@ export function useChat(options: UseChatOptions = {}) {const assistantId = generateId();const initialWorkflowStatus = createInitialAssistantWorkflowStatus(turnStartedAt);- const initialStreamEvents: StreamDisplayEvent[] = requestModel- ? [- withStreamEventTiming(- {- type: 'model_switch',- model: requestModel,- modelEvent: 'selected',- },- turnStartedAt,- ),- ]- : [];+ const initialStreamEvents: StreamDisplayEvent[] = [+ ...(requestModel+ ? [+ withStreamEventTiming(+ {+ type: 'model_switch' as const,+ model: requestModel,+ modelEvent: 'selected' as const,+ },+ turnStartedAt,+ ),+ ]+ : []),+ withStreamEventTiming(+ {+ type: 'workflow_status',+ workflowStatus: initialWorkflowStatus,+ startedAt: initialWorkflowStatus.startedAt,+ updatedAt: initialWorkflowStatus.startedAt,+ },+ turnStartedAt,+ ),+ ];const streamingMessage: ChatMessage = {id: assistantId,role: 'assistant',@@ -1809,7 +1831,7 @@ export function useChat(options: UseChatOptions = {}) {toolCalls: [],streamEvents: initialStreamEvents,workflowStatus: initialWorkflowStatus,- workflowStatusHistory: [initialWorkflowStatus],+ workflowStatusHistory: [],};if (options?.queuedMessageId) {