Skip to content

AgentRunInput

AgentRunInput<ToolProviderContext> = object

Defined in: packages/core/src/agent/types.ts:167

ToolProviderContext = unknown

optional maxRetries?: number

Defined in: packages/core/src/agent/types.ts:190

Per-call override of AgentDefinition.maxRetries. Wins over the definition, including 0. Omit both to keep the AI SDK default (2).


optional memoryScope?: string

Defined in: packages/core/src/agent/types.ts:173

Conversation key in MessageStore. Omit to allocate a random scope for this call — later episodes will not share history unless the caller reuses the resolved scope from the handle / result.


optional messages?: ModelMessage[]

Defined in: packages/core/src/agent/types.ts:181

Turn messages appended after user (if set) and any transcript already stored on AgentRunInput.memoryScope. Combine with a scope to inject extra turns into an existing conversation; omit the scope for a one-shot list on a generated id.


optional model?: LanguageModel

Defined in: packages/core/src/agent/types.ts:203

Per-call live LanguageModel override. Wins over AgentDefinition.model and the runtime defaults.model. Nothing is persisted for later reconstruction — only a read-only { modelId, provider } descriptor is recorded on agent_started.


optional outputSchema?: z.ZodType<unknown>

Defined in: packages/core/src/agent/types.ts:183

Per-episode override of the agent’s outputSchema.


optional stopWhen?: AgentStopWhen

Defined in: packages/core/src/agent/types.ts:185

Per-call override of the agent’s stopWhen.


optional streamRetries?: number

Defined in: packages/core/src/agent/types.ts:196

Per-call override of AgentDefinition.streamRetries. Wins over the definition, including 0. Omit both to leave stream retries off. See AgentDefinition.streamRetries for what a positive value retries.


optional suppressSystemPromptConflictWarning?: boolean

Defined in: packages/core/src/agent/types.ts:213

Do not console.warn when a different agent’s system prompt conflicts with the pin on this scope.


optional systemPromptConflict?: SystemPromptConflictStrategy

Defined in: packages/core/src/agent/types.ts:208

When a different agent hits this scope with a different system prompt. Defaults to "keep-pinned". Ignored for same-agent follow-ups.


optional tags?: string[]

Defined in: packages/core/src/agent/types.ts:244

Labels recorded on this episode (e.g. ["dataset:qa-v1"]).

Every agent.run() also records which project code produced it, unless a caller tag already uses the same prefix — same rules as WorkflowRunStartOptions.tags. Pass version: false on the runtime to skip that lookup.


optional toolProviderContext?: ToolProviderContext

Defined in: packages/core/src/agent/types.ts:235

Stays a plain, always-optional field rather than conditionally required (optional key when ToolProviderContext allows undefined, required key otherwise) — verified via a minimal repro: that presence-toggle pattern breaks the bivariant run/stream parameter check Agent<Context, ...> needs to widen into a heterogeneous registry, once the target is a concrete type like the old Agent<unknown, ToolSet, unknown>[] (TypeScript falls back to strict contravariant checking as soon as a key’s presence — not just its value type — depends on the type parameter, and that direction always fails for undefined vs unknown). Registries now widen to AnyAgent instead, whose any params sidestep this class of bug entirely — confirmed by re-running the same repro against AnyAgent, no break — but the field stays plain regardless, since there’s no upside to the conditional form once nothing requires it. The framework never validates this value — a ToolProvider that wants Zod validation/defaults parses it itself inside getTools.


optional tools?: ToolSet | ToolProvider<ToolSet>

Defined in: packages/core/src/agent/types.ts:215

Per-call override of the agent’s tools. Wins over AgentDefinition.tools.


optional user?: string

Defined in: packages/core/src/agent/types.ts:174


optional workflow?: AgentWorkflowScope

Defined in: packages/core/src/agent/types.ts:220

When running inside a workflow, pass the current WorkflowContext ids so agent events attach to the correct step. Omit for standalone episodes.