> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/gym/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/gym/_mcp/server.

# nemo_gym.failure_kinds

Shared names for why a rollout failed.

Gym describes failures with free text and component-local labels, so the same failure
arrives at a collector, a log line and a metric under three different names and cannot be
grouped. This module holds the one vocabulary those producers share.

A name says *what kind of thing went wrong* and nothing else. Whether to retry, whether
the request may be replayed, whether a completed result should be masked, and what to tell
a person are all properties of the occurrence, not of the name — they live on the failure
record, on the verify response, and in `failure_reason` respectively. Keeping them out is
deliberate: metadata attached to a name goes stale the moment one caller wants to retry
what another caller does not.

Names are low cardinality on purpose. They are safe as a metric label or a span dimension;
`failure_reason` never is, because it carries occurrence detail and can be unbounded.

This module imports only the standard library so that data tooling can read the vocabulary
without installing any server's requirements.

## Module Contents

### Functions

| Name                                                                     | Description                                                                     |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
| [`is_namespaced`](#nemo_gym-failure_kinds-is_namespaced)                 | Whether `name` is an environment's own `&lt;server&gt;:&lt;kind&gt;` extension. |
| [`is_registered`](#nemo_gym-failure_kinds-is_registered)                 | Whether `name` is part of the shared vocabulary.                                |
| [`validate_failure_kind`](#nemo_gym-failure_kinds-validate_failure_kind) | Return `name` unchanged, warning once per unregistered value.                   |

### Data

[`AGENT_COMMAND_NOT_ALLOWED`](#nemo_gym-failure_kinds-AGENT_COMMAND_NOT_ALLOWED)

[`AGENT_REQUEST_FAILED`](#nemo_gym-failure_kinds-AGENT_REQUEST_FAILED)

[`AGENT_RUN_ERROR`](#nemo_gym-failure_kinds-AGENT_RUN_ERROR)

[`AGENT_TIMEOUT`](#nemo_gym-failure_kinds-AGENT_TIMEOUT)

[`CANCELLED`](#nemo_gym-failure_kinds-CANCELLED)

[`COHORT_INCOMPLETE`](#nemo_gym-failure_kinds-COHORT_INCOMPLETE)

[`FAILURE_KINDS`](#nemo_gym-failure_kinds-FAILURE_KINDS)

[`JUDGE_FAILED`](#nemo_gym-failure_kinds-JUDGE_FAILED)

[`JUDGE_UNPARSEABLE`](#nemo_gym-failure_kinds-JUDGE_UNPARSEABLE)

[`KILL_SHAPED`](#nemo_gym-failure_kinds-KILL_SHAPED)

[`PERSISTENCE_FAILED`](#nemo_gym-failure_kinds-PERSISTENCE_FAILED)

[`PROVIDER_OOM_KILLED`](#nemo_gym-failure_kinds-PROVIDER_OOM_KILLED)

[`PROVIDER_QUOTA_EXHAUSTED`](#nemo_gym-failure_kinds-PROVIDER_QUOTA_EXHAUSTED)

[`PROVIDER_UNAVAILABLE`](#nemo_gym-failure_kinds-PROVIDER_UNAVAILABLE)

[`SESSION_EXPIRED`](#nemo_gym-failure_kinds-SESSION_EXPIRED)

[`SESSION_LOST`](#nemo_gym-failure_kinds-SESSION_LOST)

[`SESSION_RELEASE_FAILED`](#nemo_gym-failure_kinds-SESSION_RELEASE_FAILED)

[`SHUTDOWN`](#nemo_gym-failure_kinds-SHUTDOWN)

[`TRANSPORT_LOCAL_RESOURCE`](#nemo_gym-failure_kinds-TRANSPORT_LOCAL_RESOURCE)

[`TRANSPORT_PEER_DROP`](#nemo_gym-failure_kinds-TRANSPORT_PEER_DROP)

[`TRANSPORT_TIMEOUT`](#nemo_gym-failure_kinds-TRANSPORT_TIMEOUT)

[`TRANSPORT_UNREACHABLE`](#nemo_gym-failure_kinds-TRANSPORT_UNREACHABLE)

[`VERIFIER_ERROR`](#nemo_gym-failure_kinds-VERIFIER_ERROR)

[`_NAMESPACED_PATTERN`](#nemo_gym-failure_kinds-_NAMESPACED_PATTERN)

[`_NAME_PATTERN`](#nemo_gym-failure_kinds-_NAME_PATTERN)

[`_WARNED_UNKNOWN`](#nemo_gym-failure_kinds-_WARNED_UNKNOWN)

[`logger`](#nemo_gym-failure_kinds-logger)

### API

```python
nemo_gym.failure_kinds.is_namespaced(
    name: str
) -> bool
```

Whether `name` is an environment's own `&lt;server&gt;:&lt;kind&gt;` extension.

```python
nemo_gym.failure_kinds.is_registered(
    name: str
) -> bool
```

Whether `name` is part of the shared vocabulary.

```python
nemo_gym.failure_kinds.validate_failure_kind(
    name: str | None
) -> str | None
```

Return `name` unchanged, warning once per unregistered value.

Producers call this at their boundary. It warns rather than raises so a component that
still emits an old label stays visible during migration — rejecting it outright would
replace an observable wrong name with an invisible dropped failure, which is worse than
the problem this vocabulary exists to fix.

```python
nemo_gym.failure_kinds.AGENT_COMMAND_NOT_ALLOWED = 'agent_command_not_allowed'
```

```python
nemo_gym.failure_kinds.AGENT_REQUEST_FAILED = 'agent_request_failed'
```

```python
nemo_gym.failure_kinds.AGENT_RUN_ERROR = 'agent_run_error'
```

```python
nemo_gym.failure_kinds.AGENT_TIMEOUT = 'agent_timeout'
```

```python
nemo_gym.failure_kinds.CANCELLED = 'cancelled'
```

```python
nemo_gym.failure_kinds.COHORT_INCOMPLETE = 'cohort_incomplete'
```

```python
nemo_gym.failure_kinds.FAILURE_KINDS: frozenset[str] = frozenset({TRANSPORT_UNREACHABLE, TRANSPORT_PEER_DROP, TRANSPORT_TIMEOUT, TRANSP...
```

```python
nemo_gym.failure_kinds.JUDGE_FAILED = 'judge_failed'
```

```python
nemo_gym.failure_kinds.JUDGE_UNPARSEABLE = 'judge_unparseable'
```

```python
nemo_gym.failure_kinds.KILL_SHAPED = 'kill_shaped'
```

```python
nemo_gym.failure_kinds.PERSISTENCE_FAILED = 'persistence_failed'
```

```python
nemo_gym.failure_kinds.PROVIDER_OOM_KILLED = 'provider_oom_killed'
```

```python
nemo_gym.failure_kinds.PROVIDER_QUOTA_EXHAUSTED = 'provider_quota_exhausted'
```

```python
nemo_gym.failure_kinds.PROVIDER_UNAVAILABLE = 'provider_unavailable'
```

```python
nemo_gym.failure_kinds.SESSION_EXPIRED = 'session_expired'
```

```python
nemo_gym.failure_kinds.SESSION_LOST = 'session_lost'
```

```python
nemo_gym.failure_kinds.SESSION_RELEASE_FAILED = 'session_release_failed'
```

```python
nemo_gym.failure_kinds.SHUTDOWN = 'shutdown'
```

```python
nemo_gym.failure_kinds.TRANSPORT_LOCAL_RESOURCE = 'transport_local_resource'
```

```python
nemo_gym.failure_kinds.TRANSPORT_PEER_DROP = 'transport_peer_drop'
```

```python
nemo_gym.failure_kinds.TRANSPORT_TIMEOUT = 'transport_timeout'
```

```python
nemo_gym.failure_kinds.TRANSPORT_UNREACHABLE = 'transport_unreachable'
```

```python
nemo_gym.failure_kinds.VERIFIER_ERROR = 'verifier_error'
```

```python
nemo_gym.failure_kinds._NAMESPACED_PATTERN = re.compile('[a-z][a-z0-9_]*:[a-z][a-z0-9_]*')
```

```python
nemo_gym.failure_kinds._NAME_PATTERN = re.compile('[a-z][a-z0-9_]*')
```

```python
nemo_gym.failure_kinds._WARNED_UNKNOWN: set[str] = set()
```

```python
nemo_gym.failure_kinds.logger = logging.getLogger(__name__)
```