---
title: OfflineTestRunner
seo:
  title: OfflineTestRunner — TypeScript SDK
  description: >-
    Executes the offline-test lifecycle for a test config: resolve the dataset
    version, optionally run the agent to produce offline traces, create the test
    run, wait for terminal status, fetch results, evaluate the pass condition,
    and report successes. (TypeScript SDK)
description: >-
  Executes the offline-test lifecycle for a test config: resolve the dataset
  version, optionally run the agent to produce offline traces, create the test
  run, wait for terminal status, fetch results, evaluate the pass condition, and
  report successes.
deprecated: true
---

> **Offline tests end on November 12, 2026**
>
> Test configs and dataset test runs are deprecated and stop working for every organization on November 12, 2026.
> Use [test suites](/documentation/tests/overview) instead; see
> [Move from test configs](/documentation/tests/overview#move-from-test-configs).

## runAgent()

Run the agent once per dataset example, producing one offline trace each.

Up to `concurrency` examples run at a time; the default of 1 runs them
sequentially in dataset order. Each example id rides on the OTel context,
so the offline span processor can pair it with the root span it starts
regardless of completion order.

```typescript
async function runAgent(agentFunction: AgentFunction, examples: ExampleRow[], concurrency: number = 1): Promise<Record<string, string>>
```

### Parameters

| Prop | Type | Default | Description |
| - | - | - | - |
| `agentFunction` | `AgentFunction` | - | |
| `examples` | `ExampleRow[]` | - | |
| `concurrency?` | `number` | `1` | |

### Returns

`Promise<Record<string, string>>`
