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.

Ignore retired Assistant provider fallback events

rcourtman11d442c083c7
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index 023cc29fe6..8734c4d7bd 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -143,7 +143,11 @@ timers when the stream already has a newer workflow/tool state.
send-time recovery or hidden provider fallback. The OpenCode reference
behavior for this slice is retries on the selected provider/model, not
silent fallback to another provider or route; Pulse must adapt that as
- explicit route choice plus visible route search/recovery. The Assistant
+ explicit route choice plus visible route search/recovery. Frontend stream
+ reducers must ignore retired `provider_fallback` workflow phases entirely
+ instead of rendering compatibility "fallback rejected" rows, because the
+ selected-route retry/error contract is the only live recovery path until an
+ operator explicitly chooses another route. The Assistant
`/model` command therefore has two owned paths: an exact `provider:model-id`
argument selects that route directly, while a partial argument opens the
shared model picker with the search text prefilled.
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/useChat.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/useChat.test.ts
index f7130ab5cf..c3bea860c2 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/useChat.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/useChat.test.ts
@@ -1332,7 +1332,7 @@ describe('useChat', () => {
dispose();
});
- it('surfaces obsolete provider route-switch workflow metadata without switching routes', async () => {
+ it('ignores obsolete provider route-switch workflow metadata without switching routes', async () => {
const { getFireEvent } = setupWithEventCapture();
const { value: chat, dispose } = withRoot(() =>
useChat({ sessionId: 's', model: 'openrouter:openai/gpt-4o-mini' }),
@@ -1353,19 +1353,13 @@ describe('useChat', () => {
const assistant = chat.messages().find((m) => m.role === 'assistant')!;
expect(assistant.model).toBe('openrouter:openai/gpt-4o-mini');
- expect(assistant.workflowStatus).toEqual(
- expect.objectContaining({
- phase: 'provider_fallback_rejected',
- message: 'Provider route-switch metadata ignored; selected route unchanged.',
- }),
- );
- expect(assistant.streamEvents).toEqual(
+ expect(assistant.workflowStatus?.phase).toBe('request_send');
+ expect(assistant.streamEvents).not.toEqual(
expect.arrayContaining([
expect.objectContaining({
type: 'workflow_status',
workflowStatus: expect.objectContaining({
- phase: 'provider_fallback_rejected',
- message: 'Provider route-switch metadata ignored; selected route unchanged.',
+ phase: 'provider_fallback',
}),
}),
]),
@@ -1452,11 +1446,16 @@ describe('useChat', () => {
const assistant = chat.messages().find((m) => m.role === 'assistant')!;
expect(assistant.model).toBe('openrouter:openai/gpt-4o-mini');
- expect(assistant.workflowStatus).toEqual(
- expect.objectContaining({
- phase: 'provider_fallback_rejected',
- message: 'Provider route-switch metadata ignored; selected route unchanged.',
- }),
+ expect(assistant.workflowStatus?.phase).toBe('request_send');
+ expect(assistant.streamEvents).not.toEqual(
+ expect.arrayContaining([
+ expect.objectContaining({
+ type: 'workflow_status',
+ workflowStatus: expect.objectContaining({
+ phase: 'provider_fallback',
+ }),
+ }),
+ ]),
);
expect(assistant.streamEvents).not.toEqual(
expect.arrayContaining([
diff --git a/frontend-modern/src/components/AI/Chat/hooks/useChat.ts b/frontend-modern/src/components/AI/Chat/hooks/useChat.ts
index ce2025c07c..7ecd131a7f 100644
--- a/frontend-modern/src/components/AI/Chat/hooks/useChat.ts
+++ b/frontend-modern/src/components/AI/Chat/hooks/useChat.ts
@@ -976,11 +976,7 @@ export function useChat(options: UseChatOptions = {}) {
const record = data as Record<string, unknown>;
const phase = typeof record.phase === 'string' ? record.phase.trim() : '';
if (phase === 'provider_fallback') {
- return {
- phase: 'provider_fallback_rejected',
- message: 'Provider route-switch metadata ignored; selected route unchanged.',
- startedAt: Date.now(),
- };
+ return null;
}
const message = typeof record.message === 'string' ? record.message.trim() : '';