> 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.agent_utils.task_timeout

Resolve the per-task agent budget carried by materialized task rows.

## Module Contents

### Functions

| Name                                                                                | Description                                                              |
| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [`resolve_agent_timeout`](#nemo_gym-agent_utils-task_timeout-resolve_agent_timeout) | Cap a positive, finite task timeout by the configured execution ceiling. |

### Data

[`AGENT_TIMEOUT_METADATA_KEY`](#nemo_gym-agent_utils-task_timeout-AGENT_TIMEOUT_METADATA_KEY)

[`LOG`](#nemo_gym-agent_utils-task_timeout-LOG)

### API

```python
nemo_gym.agent_utils.task_timeout.resolve_agent_timeout(
    metadata: collections.abc.Mapping[str, str] | None,
    ceiling: float
) -> float
```

Cap a positive, finite task timeout by the configured execution ceiling.

Missing or invalid metadata keeps the configured timeout, matching Hermes.
The execution budget includes model and tool calls. Their individual timeouts,
and the separate setup and cleanup limits, remain unchanged.

```python
nemo_gym.agent_utils.task_timeout.AGENT_TIMEOUT_METADATA_KEY = 'agent_timeout_sec'
```

```python
nemo_gym.agent_utils.task_timeout.LOG = logging.getLogger(__name__)
```