# detectZeroProgress

**Kind:** Function

**Source:** [`atloria-monorepo/libs/agent-core/src/benchmark/agent-hardening.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/agent-core/src/benchmark/agent-hardening.ts#L118)

Detect consecutive turns with zero tokens (likely API failures).

If the last N turns all produced 0 tokens, the agent is stuck —
probably hitting rate limits or auth errors silently.

## Signature

```ts
function detectZeroProgress(turnHistory: Array<{ tokens: number }>, threshold: number): boolean
```

## Parameters

| Name | Type |
|---|---|
| `turnHistory` | `Array<{ tokens: number }>` |
| `threshold` | `number` |

**Returns:** `boolean`
