pub struct AgentDefinition {Show 27 fields
pub name: String,
pub layer: AgentLayer,
pub cli_tool: String,
pub task: String,
pub schedule: Option<String>,
pub model: Option<String>,
pub default_tier: Option<String>,
pub capabilities: Vec<String>,
pub max_memory_bytes: Option<u64>,
pub budget_monthly_cents: Option<u64>,
pub provider: Option<String>,
pub persona: Option<String>,
pub terraphim_role: Option<String>,
pub skill_chain: Vec<String>,
pub sfia_skills: Vec<SfiaSkillRef>,
pub fallback_provider: Option<String>,
pub fallback_model: Option<String>,
pub grace_period_secs: Option<u64>,
pub max_cpu_seconds: Option<u64>,
pub pre_check: Option<PreCheckStrategy>,
pub gitea_issue: Option<u64>,
pub event_only: bool,
pub project: Option<String>,
pub evolution_enabled: bool,
pub rlm_enabled: Option<bool>,
pub bypass_kg_routing: bool,
pub enabled: bool,
}Expand description
Definition of a single agent in the fleet.
Fields§
§name: StringUnique name (e.g., “security-sentinel”).
layer: AgentLayerWhich layer: Safety, Core, Growth.
cli_tool: StringCLI tool to use (maps to Provider).
task: StringTask/prompt to give the agent on spawn.
schedule: Option<String>Cron schedule (None = always running for Safety, or on-demand for Growth).
model: Option<String>Model to use with the CLI tool (e.g., “o3” for codex, “sonnet” for claude).
default_tier: Option<String>Default KG tier concept for this agent (e.g., “review_tier” or “review”). When KG routing matches a different tier with confidence below the escalation threshold, the router falls back to this tier instead.
capabilities: Vec<String>Capabilities this agent provides.
max_memory_bytes: Option<u64>Maximum memory in bytes (optional resource limit).
budget_monthly_cents: Option<u64>Monthly USD budget in cents (e.g., 5000 = $50.00). None means unlimited (subscription model).
provider: Option<String>LLM provider for this agent (e.g., “openai”, “anthropic”, “openrouter”).
persona: Option<String>Persona name for this agent (e.g., “Security Analyst”, “Code Reviewer”).
terraphim_role: Option<String>Terraphim role identifier (e.g., “Terraphim Engineer”, “Terraphim Designer”).
skill_chain: Vec<String>Chain of skills to invoke for this agent.
sfia_skills: Vec<SfiaSkillRef>SFIA skills with proficiency levels.
fallback_provider: Option<String>Fallback LLM provider if primary fails.
fallback_model: Option<String>Fallback model if primary fails.
grace_period_secs: Option<u64>Grace period in seconds before killing an unresponsive agent.
max_cpu_seconds: Option<u64>Maximum CPU seconds allowed per agent execution.
pre_check: Option<PreCheckStrategy>Optional pre-check strategy to gate agent spawns. If None, the agent always spawns (equivalent to Always).
gitea_issue: Option<u64>Gitea issue number to post output to (optional).
event_only: boolTrue if this agent must NOT be dispatched from comment mentions.
Used for event-only agents like build-runner that are spawned only
by handle_push with ADF_PUSH_* context. When true:
handle_webhook_dispatch::SpawnAgentrejects any mention of this agent and logs an explicit rejection.- The post-exit OutputPoster hook skips publishing stdout/stderr to
gitea_issueeven if it is somehow set, because event-only agents post their verdict via a different channel (e.g. the Gitea Commit Status API).
Default false keeps existing LLM agents mention-dispatchable.
project: Option<String>Project this agent belongs to. Must match a Project.id when any
projects are defined. None means the agent is global / legacy
single-project mode; mixing per-project and global agents is
rejected at load time.
evolution_enabled: boolEnable evolution tracking for this agent (requires evolution feature
and top-level evolution.enabled = true). Default: false.
rlm_enabled: Option<bool>Enable RLM sandboxed code execution for this agent. When Some(true), the orchestrator injects RLM session info into the agent prompt, enabling the agent to request isolated code execution via terraphim_rlm. Default: None (disabled).
bypass_kg_routing: boolIf true, spawn_agent honours the explicit cli_tool and model on
this definition and skips the KG tier-routing override block. Set by
the quota-exit and wall-clock-timeout fallback respawns so the
operator-chosen fallback provider is not overridden by the same
tier-routing rule that selected the now-blocked primary.
Default false preserves existing behaviour for normal (non-fallback)
spawns – KG tier routing continues to dominate static config.
enabled: boolWhether this agent is enabled. Set to false by the config-error circuit-breaker after 3 consecutive ConfigError exits. Defaults to true.
Trait Implementations§
Source§impl Clone for AgentDefinition
impl Clone for AgentDefinition
Source§fn clone(&self) -> AgentDefinition
fn clone(&self) -> AgentDefinition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AgentDefinition
impl Debug for AgentDefinition
Source§impl<'de> Deserialize<'de> for AgentDefinition
impl<'de> Deserialize<'de> for AgentDefinition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for AgentDefinition
impl RefUnwindSafe for AgentDefinition
impl Send for AgentDefinition
impl Sync for AgentDefinition
impl Unpin for AgentDefinition
impl UnsafeUnpin for AgentDefinition
impl UnwindSafe for AgentDefinition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more