Skip to main content

spawn_discover_and_load

Function spawn_discover_and_load 

Source
pub fn spawn_discover_and_load(
    manager: Arc<RwLock<ExtensionManager>>,
    tx: UnboundedSender<ExtensionLoaderEvent>,
    session_id: Option<String>,
) -> JoinHandle<()>
Expand description

Discover and load extensions in the background, then fire on_session_start.

The hook is emitted HERE, not at engine boot, and that placement is the whole point. engine::setup::boot() used to emit it while constructing an empty ExtensionManager — before any host had called this function — so the event reached zero subscribers in every host (TUI, server, rpc). No extension had ever received on_session_start. A comment in cmd/server.rs recorded the symptom (“no subscribers until extensions loaded”) without it being recognised as a defect.

session_id is the session the hook reports. None skips the emit, for callers that have no session (or extensions disabled).