Skip to main content

bamboo_engine/runtime/execution/
mod.rs

1//! Execution orchestration for background agent runs.
2//!
3//! This module provides the shared execution infrastructure used by all
4//! background execution paths: HTTP execute handler, spawn scheduler,
5//! and schedule manager.
6//!
7//! # Key types
8//!
9//! - [`AgentRunner`] / [`AgentStatus`] — lifecycle state of an agent run
10//! - [`try_reserve_runner`] — atomically reserve a runner slot
11//! - [`finalize_runner`] — update runner terminal status
12//! - [`create_event_forwarder`] — MPSC → broadcast channel forwarder
13//! - [`get_or_create_event_sender`] — session-scoped event broadcaster
14//! - [`spawn_session_execution`] — spawn agent execution with full orchestration
15
16pub mod agent_spawn;
17pub mod child_completion;
18pub mod event_forwarder;
19pub mod event_publication;
20pub mod runner_lifecycle;
21pub mod runner_state;
22pub mod session_events;
23pub mod spawn;
24
25pub use agent_spawn::{
26    log_base_system_prompt_snapshot, reserve_session_execution, spawn_session_execution,
27    SessionCompletionHook, SessionExecutionArgs, SessionExecutionOutcome,
28    SessionExecutionReservation, SessionExecutionReserveOutcome,
29};
30pub use child_completion::{ChildCompletion, ChildCompletionHandler};
31pub use event_forwarder::{create_event_forwarder, AccountFeedInbox};
32pub use runner_lifecycle::{
33    finalize_runner, finalize_runner_exact, reserve_runner_core, status_from_execution_result,
34    try_reserve_runner, ReserveOutcome, RunnerReservation,
35};
36pub use runner_state::{AgentRunner, AgentStatus};
37pub use session_events::{get_or_create_event_sender, SESSION_EVENT_CHANNEL_CAPACITY};
38pub use spawn::{
39    ChildRunLaunchHook, ExternalChildRunner, SessionInboxRuntimeBinding, SpawnContext, SpawnJob,
40    SpawnScheduler,
41};