GraphError

org.llm4s.agent.graph.GraphError
See theGraphError companion trait
object GraphError

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
GraphError.type

Members list

Type members

Classlikes

enum BusyHolder

Who holds a thread that a call was refused with ThreadBusy, as far as the caller may know.

Who holds a thread that a call was refused with ThreadBusy, as far as the caller may know.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Cancelled(threadId: Option[String], lastCheckpoint: Option[String]) extends GraphError, NonRecoverableError

The run was cancelled by interrupting its thread - RunHandle.cancel in a runtime, or interrupting the thread driving CompiledGraph.step. Every task was interrupted and joined. In a runtime, tasks that finished first keep their results as pending writes, and the checkpoint stays Running, so recover continues it without re-running them. A step keeps nothing from the cancelled superstep, and returns this with the interrupt flag set.

The run was cancelled by interrupting its thread - RunHandle.cancel in a runtime, or interrupting the thread driving CompiledGraph.step. Every task was interrupted and joined. In a runtime, tasks that finished first keep their results as pending writes, and the checkpoint stays Running, so recover continues it without re-running them. A step keeps nothing from the cancelled superstep, and returns this with the interrupt flag set.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class CheckpointConflict(threadId: String, expected: Option[String], actual: Option[String]) extends GraphError, NonRecoverableError

A new checkpoint's parent is not the thread's latest: another writer advanced the thread.

A new checkpoint's parent is not the thread's latest: another writer advanced the thread.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class CheckpointNotFound(threadId: String, checkpointId: String) extends GraphError, NonRecoverableError

The thread has no checkpoint checkpointId in its history: it never had one, or retention (Checkpointer.prune), a guardrail Block (which retracts its turn) or deleteThread removed it. Nothing was changed.

The thread has no checkpoint checkpointId in its history: it never had one, or retention (Checkpointer.prune), a guardrail Block (which retracts its turn) or deleteThread removed it. Nothing was changed.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class CheckpointWriteFailed(threadId: String, cause: LLMError, runError: Option[LLMError]) extends GraphError, NonRecoverableError

The checkpointer refused or failed a commit; the run stops at its last durable checkpoint. runError is the run's own failure when the commit failed while recording it.

The checkpointer refused or failed a commit; the run stops at its last durable checkpoint. runError is the run's own failure when the commit failed while recording it.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ChildThread(threadId: String, parent: String) extends GraphError, NonRecoverableError

The thread is a child thread - its latest checkpoint records a RunOrigin - of parent, and is driven only through its parent's run (design 4.41): start, recover, resume, fork, updateState and deleteThread on it are refused before any claim, and nothing was changed. Reads (history, checkpoint, subscribe, children) are allowed; delete the parent to delete the child.

The thread is a child thread - its latest checkpoint records a RunOrigin - of parent, and is driven only through its parent's run (design 4.41): start, recover, resume, fork, updateState and deleteThread on it are refused before any claim, and nothing was changed. Reads (history, checkpoint, subscribe, children) are allowed; delete the parent to delete the child.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ClaimLost(threadId: String, token: FencingToken, current: Option[FencingToken]) extends GraphError, NonRecoverableError

The run lost its claim on the thread, so it stopped: its lease passed with no renewal landing (the run judges this itself, by its own monotonic clock), a renewal was refused (StaleClaim), or the store refused one of its commits as stale. The run commits nothing more - not even a RunFailed - and drops what it had not yet written; whatever it made durable before stands. token is the run's own claim, and current the thread's current claim when the store named one: another run then holds the thread. None means the store named none - the run judged its lease passed without asking it, or the store found no current claim (a successor that took over has since released it). A failure the run was recording when its commit was refused is logged, not carried. Unlike CheckpointWriteFailed, it is not a store outage. recover may be attempted once the thread is free: it is refused with ThreadBusy while a successor holds the thread, so retry; a successor that finished the work leaves the thread's state showing it (NothingToRecover); and a lease that lapsed with no successor leaves the last checkpoint Running, which recover continues.

The run lost its claim on the thread, so it stopped: its lease passed with no renewal landing (the run judges this itself, by its own monotonic clock), a renewal was refused (StaleClaim), or the store refused one of its commits as stale. The run commits nothing more - not even a RunFailed - and drops what it had not yet written; whatever it made durable before stands. token is the run's own claim, and current the thread's current claim when the store named one: another run then holds the thread. None means the store named none - the run judged its lease passed without asking it, or the store found no current claim (a successor that took over has since released it). A failure the run was recording when its commit was refused is logged, not carried. Unlike CheckpointWriteFailed, it is not a store outage. recover may be attempted once the thread is free: it is refused with ThreadBusy while a successor holds the thread, so retry; a successor that finished the work leaves the thread's state showing it (NothingToRecover); and a lease that lapsed with no successor leaves the last checkpoint Running, which recover continues.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class CommitTimedOut(threadId: String, after: FiniteDuration) extends GraphError, NonRecoverableError

The run's closing wait - an Async run waiting for its queued commits, or an OnExit run's exit commit - was given up on: a commit had been in the store for after, twice the runtime's ClaimPolicy.ttl, with no commit returning meanwhile, while the run still held its claim. The run ended without waiting for it: its thread is free in this runtime, and its claim is released on a thread of its own. Every Checkpointer must return from each call within a bound it documents, so this is a store that broke that contract, or one whose bound is not well inside after.

The run's closing wait - an Async run waiting for its queued commits, or an OnExit run's exit commit - was given up on: a commit had been in the store for after, twice the runtime's ClaimPolicy.ttl, with no commit returning meanwhile, while the run still held its claim. The run ended without waiting for it: its thread is free in this runtime, and its claim is released on a thread of its own. Every Checkpointer must return from each call within a bound it documents, so this is a store that broke that contract, or one whose bound is not well inside after.

The commit given up on, and any queued behind it, may or may not land. One still in the store is fenced by the run's claim: once the release lands, or another run takes the thread over, the store refuses it, but it can land first. So read the thread before acting on it: its latest checkpoint is either the last one the run made durable, still Running - recover continues the run once the thread is free - or the run's outcome, which recover reports as it finds it (NothingToRecover, or PendingInterrupts for a suspended thread). A late commit's events are in the thread's log and reach the thread's subscribers, but never the run's own listeners or its tracing.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class DeadlineExceeded(threadId: String, lastCheckpoint: Option[String]) extends GraphError, RecoverableError

The run's RunBudgets.timeout, measured from its claim, expired: the run was stopped exactly as by Cancelled, and a RunEvent.RunTimedOut event was committed against lastCheckpoint. The checkpoint stays Running, so recover with a new budget continues the run without re-running tasks that had finished.

The run's RunBudgets.timeout, measured from its claim, expired: the run was stopped exactly as by Cancelled, and a RunEvent.RunTimedOut event was committed against lastCheckpoint. The checkpoint stays Running, so recover with a new budget continues the run without re-running tasks that had finished.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class EffectReplayRefused(operation: String, reason: String) extends GraphError, NonRecoverableError

ReplayGuard did not perform or replay effect operation, for reason: its target changed after the effect began, it may already have run and cannot be checked, or its outcome was not kept. A refusal the model should see: a tool maps it to ToolOutcome.Error (design §4.24).

ReplayGuard did not perform or replay effect operation, for reason: its target changed after the effect began, it may already have run and cannot be checked, or its outcome was not kept. A refusal the model should see: a tool maps it to ToolOutcome.Error (design §4.24).

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ForeignExecution(graphId: String) extends GraphError, NonRecoverableError

An execution was passed to a graph other than the one that created or restored it.

An execution was passed to a graph other than the one that created or restored it.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class IncompleteRun(threadId: String, checkpointId: String) extends GraphError, NonRecoverableError

start was called on a thread whose latest checkpoint is mid-execution; use recover.

start was called on a thread whose latest checkpoint is mid-execution; use recover.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class InvalidCommit(threadId: String, reason: String) extends GraphError, NonRecoverableError

A commit is malformed, such as a pending write naming a checkpoint other than the latest.

A commit is malformed, such as a pending write naming a checkpoint other than the latest.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class InvalidGraph(graphId: String, problems: List[String]) extends GraphError, NonRecoverableError

The builder found one or more structural problems; every problem is listed.

The builder found one or more structural problems; every problem is listed.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class InvalidResume(graphId: String, problems: List[String]) extends GraphError, NonRecoverableError

A resume was refused: no answers, an interrupt that is not parked, or an answer that does not decode.

A resume was refused: no answers, an interrupt that is not parked, or an answer that does not decode.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class InvalidRoute(nodeId: NodeId, taskId: TaskId, reason: String) extends GraphError, NonRecoverableError

A node returned a route this graph cannot schedule.

A node returned a route this graph cannot schedule.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class MiddlewareFailed(middleware: String, cause: Throwable) extends GraphError, NonRecoverableError

A middleware hook threw: the run fails, the checkpoint stays Running, and recover re-runs only that task. middleware is the middleware's id.

A middleware hook threw: the run fails, the checkpoint stays Running, and recover re-runs only that task. middleware is the middleware's id.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class NodeFailed(nodeId: NodeId, taskId: TaskId, cause: LLMError) extends GraphError, NonRecoverableError

A node returned a failure or threw.

A node returned a failure or threw.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class NotSuspended(threadId: String) extends GraphError, NonRecoverableError

resume was called on a thread that is not suspended.

resume was called on a thread that is not suspended.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class NothingToRecover(threadId: String) extends GraphError, NonRecoverableError

recover was called on a thread with no incomplete execution.

recover was called on a thread with no incomplete execution.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class OutputInvalid(errors: Vector[String]) extends GraphError, NonRecoverableError

An agent's answer did not match its response format (AgentBuilder.withOutput, design 4.26) after one corrective retry: the turn ended as a Block, removed from the thread, with both model calls in its usage. errors are the second answer's problems, each prefixed with a JSON path - at most 20, each at most 300 characters. They quote the answer, so message, which durable events record, gives only their count.

An agent's answer did not match its response format (AgentBuilder.withOutput, design 4.26) after one corrective retry: the turn ended as a Block, removed from the thread, with both model calls in its usage. errors are the second answer's problems, each prefixed with a JSON path - at most 20, each at most 300 characters. They quote the answer, so message, which durable events record, gives only their count.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class PendingInterrupts(threadId: String, interrupts: List[String]) extends GraphError, NonRecoverableError

start or recover was called on a suspended thread; answer its interrupts with resume.

start or recover was called on a suspended thread; answer its interrupts with resume.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ReplayUnavailable(threadId: String, earliestSeq: Long) extends GraphError, NonRecoverableError

Events before earliestSeq were compacted away and cannot be replayed.

Events before earliestSeq were compacted away and cannot be replayed.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class RestoreRejected(graphId: String, problems: List[String]) extends GraphError, NonRecoverableError

A snapshot does not match this compiled graph; every problem is listed.

A snapshot does not match this compiled graph; every problem is listed.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class RunCrashed(threadId: String, cause: Throwable) extends GraphError, NonRecoverableError

An unexpected throwable - such as a Clock that threw - refused the run at admission, or ended it where it was; a checkpointer whose commit throws is reported as CheckpointWriteFailed instead. Its thread claim is released; whatever the store holds for the thread stands.

An unexpected throwable - such as a Clock that threw - refused the run at admission, or ended it where it was; a checkpointer whose commit throws is reported as CheckpointWriteFailed instead. Its thread claim is released; whatever the store holds for the thread stands.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class StaleClaim(threadId: String, token: FencingToken, current: Option[FencingToken]) extends GraphError, NonRecoverableError

A commit, renewal or release presented a fencing token that is not the thread's current claim: the claim was taken over after it expired, was released, or never existed. A Checkpointer refuses such a commit atomically, applying nothing and numbering no event, so a writer that lost its claim cannot record anything after another run took the thread over. current is the token of the thread's current claim, if there is one.

A commit, renewal or release presented a fencing token that is not the thread's current claim: the claim was taken over after it expired, was released, or never existed. A Checkpointer refuses such a commit atomically, applying nothing and numbering no event, so a writer that lost its claim cannot record anything after another run took the thread over. current is the token of the thread's current claim, if there is one.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class StateUpdateFailed(keyId: StateKeyId, cause: LLMError) extends GraphError, NonRecoverableError

A key's update function rejected an update.

A key's update function rejected an update.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class SuperstepLimitExceeded(limit: Int) extends GraphError, NonRecoverableError

The run reached its superstep limit with work still scheduled.

The run reached its superstep limit with work still scheduled.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class TenantMismatch(threadId: String, requested: Option[String]) extends GraphError, NonRecoverableError

The run's tenant is not the thread's: a thread belongs to the tenant recorded on its latest checkpoint, and requested (the caller's RunConfig.tenantId) is not it. None and Some differ. Nothing was changed. The owning tenant is deliberately not carried or printed, so a caller from another tenant learns nothing about the thread.

The run's tenant is not the thread's: a thread belongs to the tenant recorded on its latest checkpoint, and requested (the caller's RunConfig.tenantId) is not it. None and Some differ. Nothing was changed. The owning tenant is deliberately not carried or printed, so a caller from another tenant learns nothing about the thread.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ThreadBusy(threadId: String, latestCheckpoint: Option[String], holder: BusyHolder) extends GraphError, RecoverableError

The thread is held, so the call was refused: another run is still executing on it in this runtime, another runtime or process holds a live claim on it (RunClaim), or it claimed the thread between this call reading it and claiming it; or the call's own claim lapsed before its write landed. start, recover, resume, deleteThread, updateState and fork (on its target thread) are refused this way, so it is recoverable: retry once that run has suspended or completed, or once its claim has expired. A refusal up front accepted, applied and discarded nothing. A BusyHolder.Lapsed refusal is the exception: a write the call had already sent may still land.

The thread is held, so the call was refused: another run is still executing on it in this runtime, another runtime or process holds a live claim on it (RunClaim), or it claimed the thread between this call reading it and claiming it; or the call's own claim lapsed before its write landed. start, recover, resume, deleteThread, updateState and fork (on its target thread) are refused this way, so it is recoverable: retry once that run has suspended or completed, or once its claim has expired. A refusal up front accepted, applied and discarded nothing. A BusyHolder.Lapsed refusal is the exception: a write the call had already sent may still land.

holder says who holds the thread as far as the caller may know (BusyHolder): a run's id when it is known and of the caller's tenant - a run of this runtime, or a claim recorded for the caller's tenant - and the thread's latest checkpoint, if any, is the caller's tenant's; BusyHolder.Unnamed when another run holds it but cannot be named, such as another tenant's; and BusyHolder.Lapsed when it is the call's own claim that lapsed, with no other run known to hold the thread. A caller of another tenant is refused with TenantMismatch instead, and learns nothing.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ThreadDeleted(threadId: String, afterSeq: Long, firstSeq: Long) extends GraphError, NonRecoverableError

A read of the thread's event log after afterSeq was refused because that point is in the log of a thread of the same id that Checkpointer.deleteThread removed (Checkpointer.deleted): the thread now under the id - if one has been created - numbers its events from firstSeq, so its log is not a continuation of the one the reader was following. A subscription ends on it with DisconnectReason.ThreadDeleted. Read from 0 to follow the thread now under the id.

A read of the thread's event log after afterSeq was refused because that point is in the log of a thread of the same id that Checkpointer.deleteThread removed (Checkpointer.deleted): the thread now under the id - if one has been created - numbers its events from firstSeq, so its log is not a continuation of the one the reader was following. A subscription ends on it with DisconnectReason.ThreadDeleted. Read from 0 to follow the thread now under the id.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ThreadDeleting(threadId: String) extends GraphError, NonRecoverableError

A cascade delete of the thread began and did not finish (design 4.41, #2074): its latest checkpoint is marked Checkpoint.deleting, and some of its descendants may already be gone, so a replayed task could re-run a deleted child. start, recover, resume, fork (from it) and updateState on it are refused before any claim, and nothing was changed; deleteThread finishes the delete.

A cascade delete of the thread began and did not finish (design 4.41, #2074): its latest checkpoint is marked Checkpoint.deleting, and some of its descendants may already be gone, so a replayed task could re-run a deleted child. start, recover, resume, fork (from it) and updateState on it are refused before any claim, and nothing was changed; deleteThread finishes the delete.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ThreadExists(threadId: String) extends GraphError, NonRecoverableError

A fork's target thread already exists; a fork only ever creates a new thread. Nothing was changed.

A fork's target thread already exists; a fork only ever creates a new thread. Nothing was changed.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ToolFailed extends GraphError, NonRecoverableError

A tool call failed the run: the tool returned Fatal, or broke its contract (an update to a key it does not declare, a question it does not declare). cause says which.

A tool call failed the run: the tool returned Fatal, or broke its contract (an update to a key it does not declare, a question it does not declare). cause says which.

Attributes

Companion
object
Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ToolFailed

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
ToolFailed.type
final case class UndeclaredWrite(nodeId: NodeId, taskId: TaskId, keyId: StateKeyId) extends GraphError, NonRecoverableError

A node emitted an update for a key outside its declared write set.

A node emitted an update for a key outside its declared write set.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class UnknownStateKey(keyId: StateKeyId) extends GraphError, NonRecoverableError

A key was read or written that the graph did not register, or another key shares its id.

A key was read or written that the graph did not register, or another key shares its id.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class UnsatisfiedJoin(joinId: JoinId, missing: List[String]) extends GraphError, NonRecoverableError

The graph went quiescent while a join still waited for arrivals that nothing can produce.

The graph went quiescent while a join still waited for arrivals that nothing can produce.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class UnsupportedCheckpointFormat(found: Int, supported: Int) extends GraphError, NonRecoverableError

A checkpoint was written in a format this build does not read.

A checkpoint was written in a format this build does not read.

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class UnsupportedStoreSchema(store: String, found: Int, supported: Int) extends GraphError, NonRecoverableError

A store's storage was migrated by a newer build: its schema is at version found, and this build knows up to supported. The store refuses to open rather than read or write tables it does not know; store names the storage (for PostgreSQL, the database schema). Stop every instance of the older build before a release that changes the schema starts (design 4.50).

A store's storage was migrated by a newer build: its schema is at version found, and this build knows up to supported. The store refuses to open rather than read or write tables it does not know; store names the storage (for PostgreSQL, the database schema). Stop every instance of the older build before a release that changes the schema starts (design 4.50).

Attributes

Supertypes
trait GraphError
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror