AgentRunner
Category: Agent
Source: agent_runner.dart
Enums
ToolApprovalPolicy
Policy for automatic tool approval in headless execution.
Classes
AgentRunner
Runs an [AgentCore] to completion without interactive approval.
Used for subagent execution where the parent agent has already decided the task and tools should run without human intervention.
Constructor
dart
AgentRunner({
required this.core,
required this.policy,
Set<String>? allowedTools,
this.onEvent,
})Properties
| Property | Type | Description |
|---|---|---|
core | AgentCore | |
policy | ToolApprovalPolicy | |
stats | UsageStats | Cumulative usage observed during this runner's lifetime. Surfaces the subagent's token cost back to the parent — without this, every subagent's AgentCore.stats would be discarded when the manager returns. |
Methods
Future<String> runToCompletion(String userMessage)
Runs a [userMessage] through the agent loop until completion.
Returns the concatenated assistant text output.