RunContext

org.llm4s.agent.graph.RunContext
final class RunContext

What a running task knows: the run's RunConfig, its own RunPosition, and its event channels.

emit records a durable custom event: it is committed with this task's result, given a per-thread sequence number in that commit, delivered only after the commit and replayed to later subscribers. It is discarded if the task fails. progress is live-only, for token deltas and similar high-volume progress, and carries a name and version like emit: delivered at once to current subscribers, never persisted or replayed. Outside a GraphRuntime both are no-ops.

Attributes

Source
RunConfig.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def effectKey(operation: String, discriminator: String*): EffectKey

The key of one external effect of this task - operation, such as memory.record, on what discriminator names - for ReplayGuard. A tool uses ToolContext.effectKey, whose base is its call's IdempotencyKey. Give each effect of a task its own operation or discriminator, and pass a set (memory ids) sorted.

The key of one external effect of this task - operation, such as memory.record, on what discriminator names - for ReplayGuard. A tool uses ToolContext.effectKey, whose base is its call's IdempotencyKey. Give each effect of a task its own operation or discriminator, and pass a set (memory ids) sorted.

Attributes

Source
RunConfig.scala
def emit(name: String, version: Int, payload: Value): Unit

Records a durable custom event; payload is snapshotted at the call, so the node may reuse it.

Records a durable custom event; payload is snapshotted at the call, so the node may reuse it.

Attributes

Source
RunConfig.scala

The task thread's interrupt flag, read without clearing it.

The task thread's interrupt flag, read without clearing it.

Attributes

Source
RunConfig.scala
def progress(name: String, version: Int, payload: Value): Unit

Offers live progress named name, version version; payload is snapshotted at the call. A no-op once the task's run has ended - released the thread, or lost its claim - so a node that keeps its context, or a thread of its own, past its run sends nothing into a later run's subscriptions (#1737).

Offers live progress named name, version version; payload is snapshotted at the call. A no-op once the task's run has ended - released the thread, or lost its claim - so a node that keeps its context, or a thread of its own, past its run sends nothing into a later run's subscriptions (#1737).

Attributes

Source
RunConfig.scala

Concrete fields

Attributes

Source
RunConfig.scala

Attributes

Source
RunConfig.scala

Attributes

Source
RunConfig.scala

Attributes

Source
RunConfig.scala

This task's key: the SHA-256 of the thread and the id of the logical task (design §4.24) - for a continuation, the task it stands in for, so a hook that runs again after an answer, an approval or a breakpoint keeps its key. It is the same in every run of the task: a retry, recover, recover after updateState, and a resumed continuation. The base of a hook's effectKeys, and the key a hook gives an external system. It identifies the task among the thread's live tasks, not for all time: after deleteThread, or work after the last durable checkpoint planned again under Async/OnExit, a task id can name new work.

This task's key: the SHA-256 of the thread and the id of the logical task (design §4.24) - for a continuation, the task it stands in for, so a hook that runs again after an answer, an approval or a breakpoint keeps its key. It is the same in every run of the task: a retry, recover, recover after updateState, and a resumed continuation. The base of a hook's effectKeys, and the key a hook gives an external system. It identifies the task among the thread's live tasks, not for all time: after deleteThread, or work after the last durable checkpoint planned again under Async/OnExit, a task id can name new work.

Attributes

Source
RunConfig.scala