# Interface RunAgentArgs

Arguments to `runAgent`.

`onToolCall` is the harness's tool-router; the adapter awaits its `Promise<ToolResult>` so synchronous and async harness execution both work. Per-tool timeouts are the harness's responsibility (the adapter doesn't impose one — see #2529 design notes).

`onTurn` (optional) fires once after each turn completes, giving operators incremental progress visibility.

`signal` (optional) propagates external cancellation as `stopReason: 'cancelled'`.

interface RunAgentArgs {
systemPrompt: string;
userPrompt: string;
tools: readonly ToolDefinition[];
turnBudget?: number;
onToolCall: (call: AgenticToolCall) => Promise<AgenticToolResult>;
onTurn?: (turn: AgentTurn) => void;
signal?: AbortSignal;
temperature?: number;
maxTokens?: number;
}

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

##### Index

### Properties

systemPrompt
userPrompt
tools
turnBudget?
onToolCall
onTurn?
signal?
temperature?
maxTokens?

## Properties

### `Readonly` systemPrompt

systemPrompt: string

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

### `Readonly` userPrompt

userPrompt: string

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

### `Readonly` tools

tools: readonly ToolDefinition[]

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

### `Optional` `Readonly` turnBudget

turnBudget?: number

Maximum agent turns. When omitted, the adapter uses the resolved model's `profile.maxRecommendedTurnBudget` (claude-opus = 20, o-reasoning = 25, claude-haiku / gemini-flash = 8, defaults to 10).

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

### `Readonly` onToolCall

onToolCall: (call: AgenticToolCall) => Promise<AgenticToolResult>

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

### `Optional` `Readonly` onTurn

onTurn?: (turn: AgentTurn) => void

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

### `Optional` `Readonly` signal

signal?: AbortSignal

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

### `Optional` `Readonly` temperature

temperature?: number

Sampling temperature passed through to `IModelAdapter.complete`.

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

### `Optional` `Readonly` maxTokens

maxTokens?: number

Per-turn maxTokens passed through to `IModelAdapter.complete`.

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