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

# Is Recoverable • AI Agent SDK

> is_recoverable: Classify a connect-error code as recoverable (transient) or terminal.

# is\_recoverable

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**protocols**](../modules/protocols) module.

Classify a connect-error code as recoverable (transient) or terminal.

A single source of truth shared by the bundled gateway client and any
alternative client so terminal-versus-transient handling stays consistent.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def is_recoverable(code: 'ConnectErrorCode | str') -> bool
```

## Parameters

<ParamField query="code" type="'ConnectErrorCode \| str'" required={true}>
  A :class:`ConnectErrorCode` or its string value.
</ParamField>

### Returns

<ResponseField name="Returns" type="bool">
  `True` when an auto-reconnecting client should back off and retry
  (e.g. `RATE_LIMITED`, or an unknown/future code — fail open to
  retry). `False` for terminal auth/pairing/protocol/origin/config
  failures (and `AGENT_NOT_FOUND`, which the server emits with a
  do-not-retry recovery step) where reconnecting will not help until
  an operator intervenes.
</ResponseField>

## Uses

* `ConnectErrorCode`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L143">
  `praisonaiagents/gateway/protocols.py` at line 143
</Card>
