> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentium.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Recover a voice connection

> Configure bounded reconnects without replaying uncertain audio or tool effects.

Recovery is off by default. Enable it when your host can handle continuity changes and require new input after reconnection.

```typescript theme={null}
import { GoogleLiveProvider, VoiceAgent } from "@agentium/core/voice";

export const voice = new VoiceAgent({
  name: "recoverable-voice",
  provider: new GoogleLiveProvider(),
  recovery: {
    fallback: "stop", maxAttempts: 3,
    initialDelayMs: 500, maxDelayMs: 3000,
    connectTimeoutMs: 10_000, maxElapsedMs: 30_000,
  },
});
```

`maxAttempts` applies across the logical session, including successful reconnects. `maxElapsedMs` bounds one recovery incident, including backoff. Observe the session's `recovery` event to update your UI and media handling.

| Provider / outcome | Continuity |
| - | - |
| Gemini with a usable safe checkpoint | Provider session resumption |
| OpenAI with `fallback: "fresh"` | A fresh provider conversation; remote context is lost |
| No safe checkpoint and fallback is `stop` | Recovery ends |
| Uncertain tool effects | Recovery stops rather than repeating the effect |

Replacement sessions do not resend audio, user input, or tool results. They require new user input before forwarding output. A successful socket reconnect is not proof of restored conversation state.

For an interrupted turn, retain the difference between generated text and playback-confirmed text. If a tool may already have acted, reconcile the effect through your application before starting new work. See [playback history](/voice/overview#playback-confirmed-history), [call recovery](/telephony/callbacks), and [service recovery](/ship/recovery).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.