Open Agent Loops
API Reference

RunGoalOptions

@open-agent-loops/core


Defined in: goal/goal.types.ts:99

Inputs for a single runGoal run. Provide the agent one of two mutually exclusive ways:

  • base — shared per-round runAgent config (optionally with run overriding how rounds execute). The sessionId lives inside base.
  • agent + sessionId — one self-contained Agent value that closes over its own config; runGoal calls it each round with the round's prompt and this sessionId.

Properties

PropertyTypeDescriptionDefined in
agent?AgentA self-contained agentic loop to drive each round. Mutually exclusive with base/run; requires sessionId.goal/goal.types.ts:110
base?RunGoalRunBaseShared per-round run config (model, memory, sessionId, tools, system, …).goal/goal.types.ts:105
goalstringThe objective, in natural language — handed to the grader each round.goal/goal.types.ts:101
graderGraderJudges each round and decides done-or-continue (and the next prompt).goal/goal.types.ts:103
maxRounds?numberHard cap on outer rounds (each round is one full inner run). Default 5.goal/goal.types.ts:123
onRound?(info) => void | Promise<void>Observe each round's verdict as it settles (for logging/telemetry).goal/goal.types.ts:133
prompt?| string | Message | Message[]The first round's prompt. Omitted → the run starts from the goal restated as the prompt.goal/goal.types.ts:121
run?RunFnOverride how each round runs (for tests). Default runAgent.goal/goal.types.ts:125
sessionId?stringThe session every round runs on (so each round loads the prior rounds' history). Required with agent; ignored with base (whose own sessionId is used).goal/goal.types.ts:116
signal?AbortSignalCancel the whole goal loop. Forwarded to each round's inner run and re-checked at the top of each round, so an abort between rounds rejects promptly instead of starting another round.goal/goal.types.ts:131

On this page