Skip to content

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

PropertyTypeDescriptionInherited fromDefined in
errorErrorThe error that triggered the swap.-src/core/events/types.ts:1194
fromstringClass 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.metadatasrc/core/events/types.ts:94
reasonProviderFallbackReasonWhy the swap happened. See ProviderFallbackReason-src/core/events/types.ts:1191
roleProviderRoleThe pipeline role the swap occurred in (currently always 'stt').-src/core/events/types.ts:1178
timestampnumberUnix timestamp (in milliseconds) when the event occurred. Remarks Useful for latency measurements and debugging the pipeline timing.BaseEvent.timestampsrc/core/events/types.ts:86
tostringClass 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

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency