Skip to content

AgentRuntime

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/libs/agent-core/src/runtime/agent-runtime.ts

AgentRuntime — the SDK-based agent loop implementation. Wraps

Implements: IAgentLoop

Methods

MethodSignatureReturns
runrun(config: AgentConfig<TContext>, input: string, options: RunOptions<TContext>)Promise<RunResult>
runStreamed`runStreamed(config: AgentConfig, input: stringAgentInputItem[], options: RunOptions)`

Where it refuses work

  • AgentRuntime stops the work with an early return when maxOutputRecoveries > 0 && this.wasOutputTruncated(sdkResult).
  • AgentRuntime stops the work with an early return when fo === undefined || fo === null.
  • AgentRuntime stops the work with an early return when !sdkResult.rawResponses.
  • AgentRuntime stops the work with an early return when !lastResponse.
  • AgentRuntime stops the work with an early return when finishReason === 'length'.
  • AgentRuntime stops the work with an early return when item?.status === 'incomplete'.

When something fails

  • AgentRuntime handles failure in 5 places: it logs it and continues in 2, discards it silently in 2, and lets it reach the caller in 1. A failure discarded silently leaves no trace for whoever debugs this later.

Was this page helpful?

Download as PDF