Skip to content
LogoLogo

Runs

Toolang organizes execution into threads, runs, and steps, from persistent context to individual operations.

ConceptDescription
ThreadA persistent context that connects related runs and their history.
RunA single execution with inputs, status, and a result or error.
StepAn individual model call, tool call, or flow operation within a run.

Execution hierarchy

Each request starts a root run. Calls to other runnables create child runs within the same thread, forming a tree of execution.

Each run tracks its own inputs, status, results, and steps. A thread retains the history across multiple runs, allowing subsequent requests to build on earlier work.

Canceling a run stops its active work but does not undo completed external actions. Stopping an agent runtime is separate from canceling a run.

History and context

Toolang provides several ways to manage execution context and history:

  • Recall retrieves earlier context through near (recent messages) and far (summarized history).
  • Compaction summarizes older context to reduce model context usage while preserving execution records.
  • Fork creates a new thread from selected history, including the selected run.
  • Rewind moves the visible history back to before a selected run without deleting stored records.

These operations affect context and history, not external side effects such as file changes or sent messages.

Run limits

Run limits control resource consumption and execution duration.

LimitMeasuresScope
agic_model_callsNumber of model callsEach agic invocation
agic_tool_callsNumber of tool callsEach agic invocation
tokensInput and output tokensRun tree
costModel cost in USDRun tree
timeElapsed time in secondsRun tree

Model and tool call counters reset for each agic invocation. Token, cost, and time budgets are shared across a run tree, including child runs. An independent root run starts with fresh budgets.

Call limits are checked before execution. Token and cost limits are evaluated after each model call, so the final call may exceed the configured budget.

Limits can be configured under [limit] or overridden with --limit for an invocation.

See Inspect and control runs for managing active runs and Configuration for limit settings.