Reference: AgentRuntime

July 28, 2026 · View on GitHub

sealed class AgentRuntime : IAsyncDisposable, IDisposable. Main entry point.

Constructors:

  • AgentRuntime(Configuration? configuration = null, AgentConfig? settings = null) — primary. configuration resolves from the CONDUCTOR_* env chain when omitted; settings defaults to AgentConfig.FromEnv().
  • AgentRuntime(AgentRuntimeOptions options) — sugar over the above.
MemberSignatureNotes
ClientIAgentClient Client { get; }The control-plane client (OrkesAgentClient).
SchedulesSchedules Schedules { get; }Cron lifecycle.
WorkerThreadCountint { get; }From AgentConfig.WorkerThreadCount / CONDUCTOR_AGENT_WORKER_THREADS.
WorkerPollIntervalMsint { get; }From AgentConfig.WorkerPollIntervalMs / CONDUCTOR_AGENT_WORKER_POLL_INTERVAL.
RunAsyncTask<AgentResult> RunAsync(Agent agent, string prompt, string? sessionId = null, IEnumerable<string>? media = null, Plan? plan = null, RunSettings? runSettings = null, CancellationToken ct = default)Run + host workers + wait.
RunAgentResult Run(Agent, string, ...)Sync wrapper.
StartAsyncTask<AgentHandle> StartAsync(Agent, string, string? = null, IEnumerable<string>? = null, Plan? = null, RunSettings? = null, CancellationToken = default)Start, return handle.
StartAgentHandle Start(Agent, string, ...)Sync wrapper.
RunByNameAsync / StartByNameAsyncby workflow namePre-deployed agents.
StreamAsyncIAsyncEnumerable<AgentEvent> StreamAsync(Agent, string, string? = null, IEnumerable<string>? = null, RunSettings? = null, CancellationToken = default)Run + stream events.
DeployAsyncTask<DeploymentInfo[]> DeployAsync(params Agent[]) ; Task<DeploymentInfo> DeployAsync(Agent, IEnumerable<Schedule>?)Register without executing; second form reconciles schedules.
DeployDeploymentInfo[] Deploy(params Agent[])Sync.
ServeAsyncTask ServeAsync(Agent, CancellationToken = default) ; Task ServeAsync(CancellationToken = default, params Agent[]) ; Task ServeAsync(bool blocking, CancellationToken ct = default, params Agent[])Host workers; blocks until cancelled unless blocking: false.
PlanAsync / PlanTask<JsonNode?> PlanAsync(Agent, CancellationToken = default)Dry-run compile.
ResumeAsync / ResumeTask<AgentHandle> ResumeAsync(string executionId, Agent, CancellationToken = default)Reattach + re-register workers across restarts.
SendMessageAsyncTask SendMessageAsync(string executionId, object message, CancellationToken = default)Push to the Workflow Message Queue.
GetStatusAsyncTask<AgentStatus> GetStatusAsync(string executionId, CancellationToken = default)
RespondAsyncTask RespondAsync(string executionId, object response, CancellationToken = default)HITL response by id.
ApproveAsync / RejectAsync / RespondAsync (event)(AgentEvent waitingEvent, ...)Event-targeted HITL — targets the event's execution.

AgentRuntimeOptions

sealed class AgentRuntimeOptionsstring? ServerUrl, string? AuthKey, string? AuthSecret. Any unset value falls back to the corresponding env var.

AgentConfig

Construction-time knobs with lenient env parsing — invalid or empty values fall back to the default rather than throwing. Obtain via AgentConfig.FromEnv() or set properties directly.

PropertyEnv varDefault
WorkerThreadCountCONDUCTOR_AGENT_WORKER_THREADS1
WorkerPollIntervalMsCONDUCTOR_AGENT_WORKER_POLL_INTERVAL100
AutoStartWorkersCONDUCTOR_AGENT_AUTO_START_WORKERStrue
DaemonWorkersCONDUCTOR_AGENT_DAEMON_WORKERStrue
StreamingEnabledCONDUCTOR_AGENT_STREAMING_ENABLEDtrue
LivenessEnabledCONDUCTOR_AGENT_LIVENESS_ENABLEDtrue
LivenessStallSecondsCONDUCTOR_AGENT_LIVENESS_STALL_SECONDS30.0
LivenessCheckIntervalSecondsCONDUCTOR_AGENT_LIVENESS_CHECK_INTERVAL_SECONDS10.0

Only CONDUCTOR_AGENT_* names are read; the legacy AGENTSPAN_* names were removed. See ../../upgrading.md.

RunSettings

RunSettings(Model?, Temperature?, MaxTokens?, ReasoningEffort?, ThinkingBudgetTokens?) — per-run LLM overrides. Only non-null fields override the agent. No TopP; it is not part of the agentConfig wire contract.

Usage

See ../concepts/deploy-serve-run.md.