> This page is for version 0.2.1.
> For other versions, use one of these documentation indexes:
> - Main (default): https://docs.nvidia.com/nemo/gym/main/llms.txt
> - 0.7.0: https://docs.nvidia.com/nemo/gym/v0.7.0/llms.txt
> - 0.6.0: https://docs.nvidia.com/nemo/gym/v0.6.0/llms.txt
> - 0.5.1: https://docs.nvidia.com/nemo/gym/v0.5.1/llms.txt
> - 0.5.0: https://docs.nvidia.com/nemo/gym/v0.5.0/llms.txt
> - 0.4.0: https://docs.nvidia.com/nemo/gym/v0.4.0/llms.txt
> - 0.3.0: https://docs.nvidia.com/nemo/gym/v0.3.0/llms.txt
> - 0.2.1: https://docs.nvidia.com/nemo/gym/v0.2.1/llms.txt

> 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.agents.utils.verify_call

An agent's verify call, with a bounded retry of a verify call lost in transport.

A verify call whose reply was lost (the body cut off mid-read, the peer dropped the connection, a timeout) has no
verdict, and an agent that masks its row then keeps a completed answer ungraded. The call is tried again, up to
`VERIFY_CALL_MAX_ATTEMPTS` attempts with the judge call's full-jitter backoff, before the failure reaches the agent.
A verify request that may have been delivered is sent again only to a verifier that reports itself `STATELESS`
(`GET /reverify_mode`): grading the same saved answer again is then safe. An HTTP reply (any status) is the
verifier's own answer and is never retried here.

## Module Contents

### Functions

| Name                                                                                            | Description                                                                                                  |
| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| [`_retry_wait_s`](#nemo_gym-agents-utils-verify_call-_retry_wait_s)                             | Full-jitter exponential backoff after failed attempt `attempt` (1-based), as a judge call waits.             |
| [`_stateless_verifier`](#nemo_gym-agents-utils-verify_call-_stateless_verifier)                 | Whether the verifier reports `STATELESS`; a verifier that cannot say is not resent a delivered request.      |
| [`is_verify_transport_error`](#nemo_gym-agents-utils-verify_call-is_verify_transport_error)     | Whether a failed verify call lost its reply in transport, so another attempt can succeed.                    |
| [`masked_verify_failure`](#nemo_gym-agents-utils-verify_call-masked_verify_failure)             | `answer` (the verify request, with the generated response) as a masked zero for a verify call that failed.   |
| [`verify_route_failure`](#nemo_gym-agents-utils-verify_call-verify_route_failure)               | The agent boundary's failure of one verify attempt, caused by `error`; `agent_route_failure` for verify with |
| [`verify_with_transport_retry`](#nemo_gym-agents-utils-verify_call-verify_with_transport_retry) | Await `call` (one verify request and its parsed reply), retrying a reply lost in transport.                  |

### Data

[`VERIFY_CALL_MAX_ATTEMPTS`](#nemo_gym-agents-utils-verify_call-VERIFY_CALL_MAX_ATTEMPTS)

[`_TRANSPORT_ERRORS`](#nemo_gym-agents-utils-verify_call-_TRANSPORT_ERRORS)

### API

```python
nemo_gym.agents.utils.verify_call._retry_wait_s(
    attempt: int
) -> float
```

Full-jitter exponential backoff after failed attempt `attempt` (1-based), as a judge call waits.

```python
nemo_gym.agents.utils.verify_call._stateless_verifier(
    server_client: nemo_gym.client.server_client.ServerClient,
    server_name: str
) -> bool
```

async

Whether the verifier reports `STATELESS`; a verifier that cannot say is not resent a delivered request.

```python
nemo_gym.agents.utils.verify_call.is_verify_transport_error(
    error: BaseException
) -> bool
```

Whether a failed verify call lost its reply in transport, so another attempt can succeed.

```python
nemo_gym.agents.utils.verify_call.masked_verify_failure(
    answer: dict[str, typing.Any],
    failure: nemo_gym.core.typed_exceptions.NgFailureEvent,
    regradable: bool = True
) -> dict[str, typing.Any]
```

`answer` (the verify request, with the generated response) as a masked zero for a verify call that failed.

Return this from `/run` instead of raising: the HTTP boundary would drop the generated answer, and a resume
would generate again. The typed failure is the one `verify_with_transport_retry` raised.

A verifier that replied with a server error or a rate limit could not grade the answer: the row is a
`judge_failed` mask, which recovery grades again from the saved answer with `/verify` only. A call lost in
transport keeps its `agent_route_failed` kind, which recovery selects too. A verifier that cannot grade one saved
answer alone (`regradable=False`, a verifier that grades only full batches) keeps `agent_route_failed` for
every cause, so recovery does not claim it can settle the row.

```python
nemo_gym.agents.utils.verify_call.verify_route_failure(
    error: BaseException,
    operation_id: str,
    attempt: int
) -> nemo_gym.core.typed_exceptions.NgFailureEvent
```

The agent boundary's failure of one verify attempt, caused by `error`; `agent_route_failure` for verify with
the attempt named, so a retried call keeps every attempt as an observation.

```python
nemo_gym.agents.utils.verify_call.verify_with_transport_retry(
    call: collections.abc.Callable[[], collections.abc.Awaitable[typing.Any]],
    server_client: nemo_gym.client.server_client.ServerClient,
    server_name: str
) -> typing.Any
```

async

Await `call` (one verify request and its parsed reply), retrying a reply lost in transport.

Every failed attempt is observed as its own `agent_route_failed` event of operation `verify` (one
`operation_id` per call, the attempt in `attempt_id`). A transport failure is tried again, up to
`VERIFY_CALL_MAX_ATTEMPTS` attempts, only against a `STATELESS` verifier. The last failure is raised as that
event, `from` its cause; any other failure is raised the same way at once.

```python
nemo_gym.agents.utils.verify_call.VERIFY_CALL_MAX_ATTEMPTS = JUDGE_CALL_MAX_ATTEMPTS
```

Attempts of one verify call (the first one included) before its transport failure reaches the agent.

```python
nemo_gym.agents.utils.verify_call._TRANSPORT_ERRORS = (ClientPayloadError, ClientConnectionError, ConnectionError, TimeoutError)
```