Expand description
Execution orchestration for background agent runs.
This module provides the shared execution infrastructure used by all background execution paths: HTTP execute handler, spawn scheduler, and schedule manager.
§Key types
AgentRunner/AgentStatus— lifecycle state of an agent runtry_reserve_runner— atomically reserve a runner slotfinalize_runner— update runner terminal statuscreate_event_forwarder— MPSC → broadcast channel forwarderget_or_create_event_sender— session-scoped event broadcasterspawn_session_execution— spawn agent execution with full orchestration
Re-exports§
pub use agent_spawn::log_base_system_prompt_snapshot;pub use agent_spawn::reserve_session_execution;pub use agent_spawn::spawn_session_execution;pub use agent_spawn::SessionCompletionHook;pub use agent_spawn::SessionExecutionArgs;pub use agent_spawn::SessionExecutionOutcome;pub use agent_spawn::SessionExecutionReservation;pub use agent_spawn::SessionExecutionReserveOutcome;pub use child_completion::ChildCompletion;pub use child_completion::ChildCompletionHandler;pub use event_forwarder::create_event_forwarder;pub use event_forwarder::AccountFeedInbox;pub use runner_lifecycle::finalize_runner;pub use runner_lifecycle::finalize_runner_exact;pub use runner_lifecycle::reserve_runner_core;pub use runner_lifecycle::status_from_execution_result;pub use runner_lifecycle::try_reserve_runner;pub use runner_lifecycle::ReserveOutcome;pub use runner_lifecycle::RunnerReservation;pub use runner_state::AgentRunner;pub use runner_state::AgentStatus;pub use session_events::get_or_create_event_sender;pub use session_events::SESSION_EVENT_CHANNEL_CAPACITY;pub use spawn::ChildRunLaunchHook;pub use spawn::ExternalChildRunner;pub use spawn::SessionInboxRuntimeBinding;pub use spawn::SpawnContext;pub use spawn::SpawnJob;pub use spawn::SpawnScheduler;
Modules§
- agent_
spawn - Core agent execution spawning logic.
- child_
completion - Child-session completion notification primitives.
- event_
forwarder - Event forwarding from MPSC to broadcast channels.
- event_
publication - Per-run atomic publication fence. Token traffic never acquires the shared runner registry. Replacement closes the old fence and drains synchronous publications before the successor can emit Started on the same channel.
- runner_
lifecycle - Runner lifecycle helpers for background agent execution.
- runner_
state - Runner state types for background agent execution.
- session_
events - Session-scoped event sender management.
- spawn
- Sub-session spawn scheduler.