ProviderFallbackEvent
Emitted when a provider fallback chain swaps the active provider.
Defined in: src/core/events/types.ts:1173
Emitted when a provider fallback chain swaps the active provider.
Remarks
Fallback chains (e.g. FallbackSTT) wrap an ordered list of providers and automatically fail over when the active one cannot connect, times out, or errors mid-session. This event tells the application that a swap happened — useful for status indicators, alerting, and post-incident review.
The pipeline keeps running through the swap; this event is informational, not an error. If the whole chain is exhausted, the normal error events (transcription.error, agent.error) fire instead.
Example
agent.on('provider.fallback', (event) => {
console.warn(`${event.role} failed over: ${event.from} -> ${event.to} (${event.reason})`);
showDegradedBanner(`Using backup ${event.role} provider`);
});
See
ProviderEvent for all provider event types
Extends
BaseEvent
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
error | Error | The error that triggered the swap. | - | src/core/events/types.ts:1194 |
from | string | Class name of the provider that failed (e.g. 'DeepgramSTT'). | - | src/core/events/types.ts:1181 |
metadata? | Record<string, unknown> | Optional metadata associated with the event. Remarks May contain provider-specific data or debugging information. | BaseEvent.metadata | src/core/events/types.ts:94 |
reason | ProviderFallbackReason | Why the swap happened. See ProviderFallbackReason | - | src/core/events/types.ts:1191 |
role | ProviderRole | The pipeline role the swap occurred in (currently always 'stt'). | - | src/core/events/types.ts:1178 |
timestamp | number | Unix timestamp (in milliseconds) when the event occurred. Remarks Useful for latency measurements and debugging the pipeline timing. | BaseEvent.timestamp | src/core/events/types.ts:86 |
to | string | Class name of the provider now active (e.g. 'AssemblyAISTT'). | - | src/core/events/types.ts:1184 |
type | "provider.fallback" | Discriminant for this event type. | - | src/core/events/types.ts:1175 |