The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Triage
Classification pipeline for external triggers. It turns a source-specific
event (Composio webhook, incoming HTTP webhook, task-source card, desktop
notification, ad hoc RPC) into a drop / acknowledge / react / escalate
decision, then dispatches the sub-agent that decision implies. It does not
own the trigger sources themselves (Composio sync, webhook tunnels,
notification ingest); those build a TriggerEnvelope and call in.
Pipeline
- Envelope (
envelope.rs): the caller builds aTriggerEnvelopeviafrom_composio,from_webhook,from_cronorfrom_external, or by filling the struct directly (desktop/notifications/rpc.rsdoes this forTriggerSource::WebviewIntegration). It carries theTriggerSourceand the raw payload, truncated to 8 KB when rendered into the prompt. - Evaluator (
evaluator*.rs):run_triagesends thetrigger_triageagent turn over the native bus (agent.run_turn, zero tools, originAgentTurnOrigin::ExternalChannel) through a tiered chain: cloud, one retry on 429/transient/malformed-reply, then a local-model arm. Budget exhaustion and prompt-guard rejections skip the cloud retry and go straight to the local arm. If the local arm is unavailable or also fails, the result isTriageOutcome::Deferred { defer_until_ms, reason }(30 s tick) rather thanErr. Only non-retryable failures (auth, missing registry or definition) returnErr, and those also publishTriggerEscalationFailed.decision.rs::parse_triage_decisionparses the reply tolerantly (fenced JSON, prose around the object, trailing commas, wrong-case action). - Escalation (
escalation.rs):apply_decisionpublishesTriggerEvaluatedfor every action.drop/acknowledgedo no further work.react/escalatefirst passApprovalGate::intercept_auditedwith tool keytriage.react/triage.escalate, then build a rootParentExecutionContext(parent_context::build_root_parent) and runtrigger_reactorororchestratoras a direct one-shot agent turn under the triage context. - Origin (
origin.rs): every caller scopes anAgentTurnOriginaroundapply_decisionbecauseAGENT_TURN_ORIGINis a task-local and none of the callers inherit one; an unscoped call readsUnknownand the gate fails closed.local_trigger_origin(Cli, trust root, no audit row) is for triggers the machine generated itself;remote_trigger_origin(TrustedAutomation::Workflow { require_approval: true }) is for anything whose payload came from outside. - Events (
events.rs): thin wrappers aroundDomainEvent::Trigger*(TriggerEvaluated,TriggerEscalated,TriggerEscalationFailed) so the field list lives in one place.
routing.rs resolves the arms. resolve_provider_with_config resolves the
chat workload role and forces the managed backend whenever that
role points at a local runtime, a local CLI delegate, or an incomplete BYOK
route, so the initial attempt never depends on a local model being up.
build_local_provider_with_config returns the local arm only when
local_ai.runtime_enabled is set and a chat_model_id is configured;
otherwise the chain skips straight to Deferred.
Only the local arm takes the platform::llm_gate::wait_for_capacity
permit (held for the duration of that turn); cloud attempts do not wait on
the gate. Tests use a _for_test variant that skips the permit.
Not routed through triage
TriggerEnvelope::from_cron still exists, but only the manual RPCs
agent.triage_evaluate (agent_runs/schemas.rs) and webhooks.trigger_agent
(skills/webhooks/ops.rs) build one. The cron scheduler does not call
run_triage: cron/scheduler/agent_run.rs::run_agent_job runs the job's
agent directly, and scheduler/delivery.rs hard-codes
triage_action: "react" / triage_reason: "Scheduled delivery" on the
delivered notification for display.
Public surface
Re-exported from mod.rs:
TriggerEnvelope,TriggerSource:envelope.rs.TriageAction,TriageDecision,parse_triage_decision,ParseError:decision.rs.run_triage(&envelope) -> anyhow::Result<TriageOutcome>,TriageOutcome,TriageRun,TriageResolutionPath:evaluator*.rs. Alsopubon the module:TRIGGER_TRIAGE_AGENT_ID.apply_decision(run, &envelope) -> anyhow::Result<()>:escalation.rs.local_trigger_origin(),remote_trigger_origin(&envelope):origin.rs.build_local_provider_with_config(&config),ResolvedProvider:routing.rs. Alsopubon the module:resolve_provider_with_config.
Called by
crates/openhuman-core/src/skills/webhooks/bus.rs: incoming webhook requests on a tunnel registered to an agent.crates/openhuman-core/src/skills/webhooks/ops.rs:webhooks.trigger_agentmanual RPC (webhook/cron/externalsources).crates/openhuman-core/src/memory/sync/composio/bus*.rs: Composio trigger events;OPENHUMAN_TRIGGER_TRIAGE_DISABLED,composio.triage_disabled, andcomposio.triage_disabled_toolkitsskip the pipeline.crates/openhuman-core/src/integrations/task_sources/route.rs: proactive task-source cards targetingSourceTarget::AgentTodoProactive.crates/openhuman-core/src/desktop/notifications/rpc.rs: background triage spawned afternotification_ingest; score persisted viastore::update_triage, originlocal_trigger_origin.crates/openhuman-core/src/agent_runs/schemas.rs:agent.triage_evaluateRPC (synthetic trigger from any source, optional dry-run withoutapply_decision).
Related
crates/openhuman-core/src/agent_registry/agents/trigger_triage/: the classifier agent definition;prompt.mddescribes the JSON contractdecision.rsparses.crates/openhuman-core/src/agent_registry/agents/trigger_reactor/: the single-step sub-agentreactdecisions dispatch to.crates/openhuman-core/src/platform/llm_gate/README.md: the LLM-permit gate the local arm waits on.- Parent module README
- Triggers
- Agent harness architecture
Tests
envelope_tests.rs, decision_tests.rs, escalation_tests.rs,
evaluator_tests.rs, evaluator_deferral_tests.rs, evaluator_fallback_chain_tests.rs, events_tests.rs,
origin_tests.rs, routing_tests.rs.