org.llm4s.agent.delegation
Members list
Type members
Classlikes
The permission rules of one ancestor's PermissionMiddleware, which a subagent's calls must also pass.
The permission rules of one ancestor's PermissionMiddleware, which a subagent's calls must also pass.
Attributes
- Source
- DelegationPlan.scala
- Supertypes
A TypedAgent compiled onto a runtime by TypedAgent.bind: what the task tools run, and what run runs with no parent - from a graph node, or a test.
A TypedAgent compiled onto a runtime by TypedAgent.bind: what the task tools run, and what run runs with no parent - from a graph node, or a test.
Attributes
- Companion
- object
- Source
- TypedAgent.scala
- Supertypes
Attributes
- Companion
- class
- Source
- TypedAgent.scala
- Supertypes
- Self type
-
BoundAgent.type
What a parent does when a child run fails (design 4.44): a provider error, a tool's Fatal, or a refusal - the child was blocked, reached its step limit, or its typed answer failed its schema.
What a parent does when a child run fails (design 4.44): a provider error, a tool's Fatal, or a refusal - the child was blocked, reached its step limit, or its typed answer failed its schema.
Attributes
- Source
- TaskOutcome.scala
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
One interrupt a suspended child waits on (design 4.46): the child's own interrupt id and its request, each as the child's own AgentStatus.Suspended gives it. Delegated is one of the child's own delegated interrupts - a grandchild's - under the child's composite id (<child interrupt>~<grandchild interrupt>).
One interrupt a suspended child waits on (design 4.46): the child's own interrupt id and its request, each as the child's own AgentStatus.Suspended gives it. Delegated is one of the child's own delegated interrupts - a grandchild's - under the child's composite id (<child interrupt>~<grandchild interrupt>).
Attributes
- Companion
- object
- Source
- DelegatedSuspension.scala
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- enum
- Source
- DelegatedSuspension.scala
- Supertypes
- Self type
-
ChildInterrupt.type
The child run a delegated task ran as (design 4.44): its thread, the run that produced the outcome, the subagent's id, the parent's tool call that started it, and its depth - 1 for a child of a top-level thread. A child run with no parent (BoundAgent.run) has depth 0 and no toolCallId.
The child run a delegated task ran as (design 4.44): its thread, the run that produced the outcome, the subagent's id, the parent's tool call that started it, and its depth - 1 for a child of a top-level thread. A child run with no parent (BoundAgent.run) has depth 0 and no toolCallId.
Attributes
- Companion
- object
- Source
- TaskOutcome.scala
- Supertypes
The answers to a DelegatedQuestion (design 4.46), keyed by the child's interrupt ids - composite ones for the child's own delegated interrupts - each encoded as the child expects it.
The answers to a DelegatedQuestion (design 4.46), keyed by the child's interrupt ids - composite ones for the child's own delegated interrupts - each encoded as the child expects it.
Attributes
- Companion
- object
- Source
- DelegatedSuspension.scala
- Supertypes
Attributes
- Companion
- class
- Source
- DelegatedSuspension.scala
- Supertypes
- Self type
-
DelegatedAnswers.type
The question a task tool asks when its child suspends (design 4.46): the child run, and every interrupt it waits on. Its answer is a DelegatedAnswers. Application code does not answer it directly: the parent's Suspension.delegated lists each pending child interrupt under a composite id, which the answer helpers (approve, reject, edit, reply, proceed) and Agent.resume take unchanged.
The question a task tool asks when its child suspends (design 4.46): the child run, and every interrupt it waits on. Its answer is a DelegatedAnswers. Application code does not answer it directly: the parent's Suspension.delegated lists each pending child interrupt under a composite id, which the answer helpers (approve, reject, edit, reply, proceed) and Agent.resume take unchanged.
Attributes
- Companion
- object
- Source
- DelegatedSuspension.scala
- Supertypes
Attributes
- Companion
- class
- Source
- DelegatedSuspension.scala
- Supertypes
- Self type
-
DelegatedQuestion.type
A suspended child's interrupt, as its parent's Suspension.delegated lists it under a composite id (design 4.46): the child run that waits, and its request, never itself Delegated - a grandchild's interrupt names the grandchild here.
A suspended child's interrupt, as its parent's Suspension.delegated lists it under a composite id (design 4.46): the child run that waits, and its request, never itself Delegated - a grandchild's interrupt names the grandchild here.
Attributes
- Source
- DelegatedSuspension.scala
- Supertypes
The bounds on an agent's delegated tasks (design 4.44), each enforced on its own:
The bounds on an agent's delegated tasks (design 4.44), each enforced on its own:
maxConcurrentChildren: child runs one parent run has live at once. Ataskcall over it waits for a slot; it is not refused.maxTasksPerTurn:taskcalls one parent turn may make, counted in the order of the turn's assistant messages, across handoffs (every agent of the family's calls in the turn count), so a call is refused (a tool error) exactly when the calls before it, its own included, are over the bound, whichever order the calls run in and however often they are replayed.maxDepth: how deep delegation nests; 1, the default, lets the agent delegate and its children not.maxReportBytes: the most anytasktool message may be, in UTF-8: a child's report, as the JSON the parent model reads (a larger one is a tool error), and every tool error, its reason cut to fit, so the parent's checkpoint never holds more. At least DelegationConfig.MinReportBytes, so a cut error still fits.childRetention: settled child threads each parent thread keeps. A run'sRunConfig.childRetentionbounds it too: the smaller of the two applies.
Every bound must be positive, and maxReportBytes at least MinReportBytes: AgentBuilder.build() refuses one that is not.
Attributes
- Companion
- object
- Source
- DelegationConfig.scala
- Supertypes
Attributes
- Companion
- class
- Source
- DelegationConfig.scala
- Supertypes
- Self type
-
DelegationConfig.type
What an agent's subagents run with (design 4.45), as Agent.delegation gives it: a plain data value, built by AgentBuilder.build() from the same inputs the subagents are compiled from, so it shows what runs. Its toString is one line per subagent and nested subagent, for logs.
What an agent's subagents run with (design 4.45), as Agent.delegation gives it: a plain data value, built by AgentBuilder.build() from the same inputs the subagents are compiled from, so it shows what runs. Its toString is one line per subagent and nested subagent, for logs.
Value parameters
- subagents
-
every subagent of every agent of the family, in the order each agent declares them
Attributes
- Companion
- object
- Source
- DelegationPlan.scala
- Supertypes
Attributes
- Companion
- class
- Source
- DelegationPlan.scala
- Supertypes
- Self type
-
DelegationPlan.type
What a subagent takes from the agent it is bound to, beyond its own definition (design 4.45). Nothing is taken unless granted (rule 15): Inheritance.none, the default, gives the child its own tools and middleware only.
What a subagent takes from the agent it is bound to, beyond its own definition (design 4.45). Nothing is taken unless granted (rule 15): Inheritance.none, the default, gives the child its own tools and middleware only.
tools: the parent's tools the child also gets, as the parent's instances, run against the child's own thread. A tool over a state backend (StateFileBackend) therefore sees the child's own empty files, while one over a host, workspace or store backend shares the parent's. The task tools are never among them:delegategoverns those.middleware: the ids of the parent's middleware the child also runs, as the parent's instances - memory or a guardrail, say. Granting aSemanticMemoryMiddleware's id shares the parent's memory, under the parent's tenant, which the child always has. The parent'sdelegationmiddleware cannot be granted.budget: the child's limits, each also capped by what its parent has left when the task is called.delegate: whether the child may delegate to its own subagents (TypedAgent.withSubagents), under its parent'sDelegationConfig, to itsmaxDepth. Without it a child never has the task tools.
Identity is never part of a grant (rule 16): tenant, principal, tracing, the runtime and the checkpointer always come from the parent. Nor are permissions: every ancestor's PermissionMiddleware rules always apply to the child, and can only narrow what it may do.
A tool or middleware id the parent does not have is refused when the parent is built.
Attributes
- Companion
- object
- Source
- Inheritance.scala
- Supertypes
Attributes
- Companion
- class
- Source
- Inheritance.scala
- Supertypes
- Self type
-
Inheritance.type
A tool a subagent's model is offered, and whether it was granted from the parent rather than the child's own.
A tool a subagent's model is offered, and whether it was granted from the parent rather than the child's own.
Attributes
- Source
- DelegationPlan.scala
- Supertypes
One subagent's plan (design 4.45).
One subagent's plan (design 4.45).
Value parameters
- ancestorRules
-
the permission rules of every ancestor, outermost first, that
ancestor-permissionsapplies - budget
-
the budget granted; each limit is also capped by the parent's remainder when the task is called
- delegates
-
whether the child has task tools of its own: delegation granted, subagents declared, and room under
maxDepth - depth
-
how deep the child runs: 1 below a top-level agent
- id
-
the subagent's id
- maxDepth
-
the deepest delegation may nest
- middleware
-
the child's middleware ids in stack order, outermost first:
ancestor-permissionswhen an ancestor has permission rules, then the granted middleware, its harness's and its own, thendelegationwhen it may delegate - model
-
the client the child calls, by its class name (a client exposes no model name)
- modelInherited
-
whether that client and its options are the parent's (no
TypedAgent.withModel) - parent
-
the agent that delegates to it
- subagents
-
the child's own subagents' plans, when it delegates
- toolName
-
the parent's tool that runs it:
task, ortask_<id> - tools
-
every tool the child's model is offered, its own (its tools, its harness's, its middleware's and its own task tools) and those granted from its parent (granted tools and granted middleware's tools)
Attributes
- Source
- DelegationPlan.scala
- Supertypes
A subagent's limits (design 4.45), each None unless set. When a task is called, each is capped by what its parent has left, from the parent's snapshot:
A subagent's limits (design 4.45), each None unless set. When a task is called, each is capped by what its parent has left, from the parent's snapshot:
maxSteps: model calls in the child's turn; unset, the parent agent'smaxSteps. Either way at most the parent turn's remaining steps (RunContext.remainingSteps).timeout: the child's time, from its start; at most until the parent's deadline.maxTokens: the child's input and output tokens; at most the parent'sRunBudgets.maxTokensless what the parent's run has used.maxConcurrency: the child's run'sRunBudgets.maxConcurrency; at most the parent's.
Each limit is the child's whole life: a child recovered after a crash or a failed parent has its grant less what its earlier attempts used, and its time runs from its first start. Parallel children each get the same remainder, so together they can overshoot the parent's tokens; the parent's next model call then ends its turn TokenLimitReached. Every value set must be positive, which the parent's build() checks.
Attributes
- Companion
- object
- Source
- Inheritance.scala
- Supertypes
Attributes
- Companion
- class
- Source
- Inheritance.scala
- Supertypes
- Self type
-
TaskBudget.type
How a delegated task ended (design 4.44): only typed data crosses from the child to the parent, never the child's messages.
How a delegated task ended (design 4.44): only typed data crosses from the child to the parent, never the child's messages.
Attributes
- Source
- TaskOutcome.scala
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Why a child gave no report (design 4.44). Each case is rebuilt from one RunOutcome on replay.
Why a child gave no report (design 4.44). Each case is rebuilt from one RunOutcome on replay.
Attributes
- Companion
- object
- Source
- TaskOutcome.scala
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- enum
- Source
- TaskOutcome.scala
- Supertypes
- Self type
-
TaskRefusal.type
The input of a subagent defined with TypedAgent.text: a self-contained description of the task, which becomes the child's first user message as it is. Every such subagent is offered through the one task tool (design 4.44).
The input of a subagent defined with TypedAgent.text: a self-contained description of the task, which becomes the child's first user message as it is. Every such subagent is offered through the one task tool (design 4.44).
Attributes
- Source
- TaskOutcome.scala
- Supertypes
Which of its parent's tools a subagent also gets (design 4.45).
Which of its parent's tools a subagent also gets (design 4.45).
Attributes
- Source
- Inheritance.scala
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
A subagent's definition (design 4.44): an agent that takes a typed input I and gives back a typed report O, run on a thread of its own, with a fresh conversation, its own tools and middleware only, and nothing of its parent's (rule 15). A parent offers it with AgentBuilder.withSubagents, which compiles it with bind at the parent's build(); BoundAgent.run runs one with no parent.
A subagent's definition (design 4.44): an agent that takes a typed input I and gives back a typed report O, run on a thread of its own, with a fresh conversation, its own tools and middleware only, and nothing of its parent's (rule 15). A parent offers it with AgentBuilder.withSubagents, which compiles it with bind at the parent's build(); BoundAgent.run runs one with no parent.
Only typed data crosses (rule 17): the parent sends I, rendered as the child's first user message - by default a TaskRequest's description as it is, any other input as its canonical JSON under one line naming the subagent (withInputText replaces that) - and gets back O, decoded from the child's answer. For a TypedAgent.text subagent the answer itself is the report; otherwise the child answers in O's schema (AgentBuilder.withOutput).
A definition holds clients and functions, not data: it is immutable, and every with* returns a new one. Its id ([a-zA-Z0-9_-]{1,52}) and description (not blank) are checked when it is bound.
Attributes
- Companion
- object
- Source
- TypedAgent.scala
- Supertypes
Attributes
- Companion
- class
- Source
- TypedAgent.scala
- Supertypes
- Self type
-
TypedAgent.type
