AgentRunInput
AgentRunInput<
ToolProviderContext> =object
Defined in: packages/core/src/agent/types.ts:128
Type Parameters
Section titled “Type Parameters”ToolProviderContext
Section titled “ToolProviderContext”ToolProviderContext = unknown
Properties
Section titled “Properties”memoryScope?
Section titled “memoryScope?”
optionalmemoryScope?:string
Defined in: packages/core/src/agent/types.ts:134
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:142
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.
outputSchema?
Section titled “outputSchema?”
optionaloutputSchema?:z.ZodType<unknown>
Defined in: packages/core/src/agent/types.ts:144
Per-episode override of the agent’s outputSchema.
stopWhen?
Section titled “stopWhen?”
optionalstopWhen?:AgentStopWhen
Defined in: packages/core/src/agent/types.ts:146
Per-call override of the agent’s stopWhen.
suppressSystemPromptConflictWarning?
Section titled “suppressSystemPromptConflictWarning?”
optionalsuppressSystemPromptConflictWarning?:boolean
Defined in: packages/core/src/agent/types.ts:156
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:151
When a different agent hits this scope with a different system prompt.
Defaults to "keep-pinned". Ignored for same-agent follow-ups.
toolProviderContext?
Section titled “toolProviderContext?”
optionaltoolProviderContext?:ToolProviderContext
Defined in: packages/core/src/agent/types.ts:179
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. See
notes/tool-sandboxing.md.
tools?
Section titled “tools?”
optionaltools?:ToolSet|ToolProvider<ToolSet>
Defined in: packages/core/src/agent/types.ts:158
Per-call override of the agent’s tools. Wins over AgentDefinition.tools.
optionaluser?:string
Defined in: packages/core/src/agent/types.ts:135
workflow?
Section titled “workflow?”
optionalworkflow?:AgentWorkflowScope
Defined in: packages/core/src/agent/types.ts:163
When running inside a workflow, pass the current WorkflowContext ids so agent events attach to the correct step. Omit for standalone episodes.