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(crate) mod root_execution_lifetime;
21pub mod runner_lifecycle;
22pub mod runner_state;
23pub mod session_events;
24pub mod spawn;
25pub mod visible_messages;
26
27pub use agent_spawn::{
28    log_base_system_prompt_snapshot, reserve_session_execution, reserve_session_preparation,
29    spawn_session_execution, SessionCompletionHook, SessionExecutionArgs, SessionExecutionOutcome,
30    SessionExecutionReservation, SessionExecutionReserveOutcome, SessionPreparationReservation,
31};
32pub use child_completion::{ChildCompletion, ChildCompletionHandler, ChildCompletionSource};
33pub use event_forwarder::{
34    create_event_forwarder, create_event_forwarder_with_history_commit_barrier,
35    create_event_forwarder_with_root_actor, history_commit_barrier, AccountFeedInbox,
36    HistoryCommitAcknowledger, HistoryCommitBarrier,
37};
38pub use runner_lifecycle::{
39    finalize_runner, finalize_runner_exact, reserve_runner_core, status_from_execution_result,
40    try_reserve_runner, ReserveOutcome, RunnerReservation,
41};
42pub use runner_state::{AgentRunner, AgentStatus};
43pub use session_events::{get_or_create_event_sender, SESSION_EVENT_CHANNEL_CAPACITY};
44pub use spawn::{
45    ChildRunLaunchHook, ExternalChildRunner, SessionInboxRuntimeBinding, SpawnContext, SpawnJob,
46    SpawnScheduler,
47};
48pub use visible_messages::{
49    VisibleAssistantMessage, VisibleMessageEvent, VisibleMessageEventKind, VisibleMessageSnapshot,
50    VisibleMessageStream,
51};
52
53/// Log-only identifiers and redaction for execution/Workspace diagnostics.
54pub mod workspace_diagnostics;