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;
24pub mod visible_messages;
25
26pub use agent_spawn::{
27    log_base_system_prompt_snapshot, reserve_session_execution, spawn_session_execution,
28    SessionCompletionHook, SessionExecutionArgs, SessionExecutionOutcome,
29    SessionExecutionReservation, SessionExecutionReserveOutcome,
30};
31pub use child_completion::{ChildCompletion, ChildCompletionHandler, ChildCompletionSource};
32pub use event_forwarder::{
33    create_event_forwarder, create_event_forwarder_with_history_commit_barrier,
34    create_event_forwarder_with_root_actor, history_commit_barrier, AccountFeedInbox,
35    HistoryCommitAcknowledger, HistoryCommitBarrier,
36};
37pub use runner_lifecycle::{
38    finalize_runner, finalize_runner_exact, reserve_runner_core, status_from_execution_result,
39    try_reserve_runner, ReserveOutcome, RunnerReservation,
40};
41pub use runner_state::{AgentRunner, AgentStatus};
42pub use session_events::{get_or_create_event_sender, SESSION_EVENT_CHANNEL_CAPACITY};
43pub use spawn::{
44    ChildRunLaunchHook, ExternalChildRunner, SessionInboxRuntimeBinding, SpawnContext, SpawnJob,
45    SpawnScheduler,
46};
47pub use visible_messages::{
48    VisibleAssistantMessage, VisibleMessageEvent, VisibleMessageEventKind, VisibleMessageSnapshot,
49    VisibleMessageStream,
50};