AgentRunInput
AgentRunInput<
ToolProviderContext> =object
Defined in: packages/core/src/agent/types.ts:167
Type Parameters
Section titled “Type Parameters”ToolProviderContext
Section titled “ToolProviderContext”ToolProviderContext = unknown
Properties
Section titled “Properties”maxRetries?
Section titled “maxRetries?”
optionalmaxRetries?: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).
memoryScope?
Section titled “memoryScope?”
optionalmemoryScope?: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.
messages?
Section titled “messages?”
optionalmessages?: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.
model?
Section titled “model?”
optionalmodel?: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.
outputSchema?
Section titled “outputSchema?”
optionaloutputSchema?:z.ZodType<unknown>
Defined in: packages/core/src/agent/types.ts:183
Per-episode override of the agent’s outputSchema.
stopWhen?
Section titled “stopWhen?”
optionalstopWhen?:AgentStopWhen
Defined in: packages/core/src/agent/types.ts:185
Per-call override of the agent’s stopWhen.
streamRetries?
Section titled “streamRetries?”
optionalstreamRetries?: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.
suppressSystemPromptConflictWarning?
Section titled “suppressSystemPromptConflictWarning?”
optionalsuppressSystemPromptConflictWarning?: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.
systemPromptConflict?
Section titled “systemPromptConflict?”
optionalsystemPromptConflict?: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.
optionaltags?: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.
toolProviderContext?
Section titled “toolProviderContext?”
optionaltoolProviderContext?: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.
tools?
Section titled “tools?”
optionaltools?:ToolSet|ToolProvider<ToolSet>
Defined in: packages/core/src/agent/types.ts:215
Per-call override of the agent’s tools. Wins over AgentDefinition.tools.
optionaluser?:string
Defined in: packages/core/src/agent/types.ts:174
workflow?
Section titled “workflow?”
optionalworkflow?: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.