# Interface AgentRunResult

Final result of a successful `runAgent` call.

`stopReason: 'agent-stopped' | 'turn-budget' | 'tool-error' | 'cancelled'` is reported via the result, NOT via `Result.err` — partial-progress runs are gradable, and the harness inspects `turns` to decide.

interface AgentRunResult {
turnsUsed: number;
stopReason: AgentStopReason;
turns: readonly AgentTurn[];
totalInputTokens?: number;
totalOutputTokens?: number;
providerId: string;
modelId: string;
adapterStrategy: string;
finalContent: string;
}

- Defined in packages/nexus-agents/src/agents/agentic/types.ts:81

##### Index

### Properties

turnsUsed
stopReason
turns
totalInputTokens?
totalOutputTokens?
providerId
modelId
adapterStrategy
finalContent

## Properties

### `Readonly` turnsUsed

turnsUsed: number

- Defined in packages/nexus-agents/src/agents/agentic/types.ts:82

### `Readonly` stopReason

stopReason: AgentStopReason

- Defined in packages/nexus-agents/src/agents/agentic/types.ts:83

### `Readonly` turns

turns: readonly AgentTurn[]

- Defined in packages/nexus-agents/src/agents/agentic/types.ts:84

### `Optional` `Readonly` totalInputTokens

totalInputTokens?: number

Aggregated token usage across all turns (sum of per-turn inputs/outputs).

- Defined in packages/nexus-agents/src/agents/agentic/types.ts:86

### `Optional` `Readonly` totalOutputTokens

totalOutputTokens?: number

- Defined in packages/nexus-agents/src/agents/agentic/types.ts:87

### `Readonly` providerId

providerId: string

Provider-id stamp from the underlying `IModelAdapter` — operators read this when comparing eval results across providers, since tool-use fidelity is provider-dependent.

- Defined in packages/nexus-agents/src/agents/agentic/types.ts:93

### `Readonly` modelId

modelId: string

Model-id stamp from the underlying `IModelAdapter`.

- Defined in packages/nexus-agents/src/agents/agentic/types.ts:95

### `Readonly` adapterStrategy

adapterStrategy: string

Strategy used to drive the loop. `native:<providerId>` when the underlying adapter is a known provider whose tool-use API is being threaded through; `wrapper` for unknown providers / custom adapters where the loop relies only on the IModelAdapter contract surface.

Eval harnesses record this so cross-provider runs are auditable.

- Defined in packages/nexus-agents/src/agents/agentic/types.ts:104

### `Readonly` finalContent

finalContent: string

The model's final assistant content (the response after the last tool result, when the model emits no further tool call). Empty string when the loop ended on `turn-budget` or `cancelled`.

- Defined in packages/nexus-agents/src/agents/agentic/types.ts:110