lean-ctx 3.9.19

Context Runtime for AI Agents with CCP. 79 MCP tools, 10 read modes, 95+ compression patterns, cross-session memory (CCP), persistent AI knowledge with temporal facts + contradiction detection, multi-agent context sharing, LITM-aware positioning, AAAK compact format, adaptive compression with Thompson Sampling bandits. Supports 24+ AI tools. Reduces LLM token consumption by up to 99%.
use axum::http::request::Parts;

pub(super) fn schedule_provider_connector(
    parts: &Parts,
    lineage: Option<&crate::core::ocla::OclaRequestContext>,
    route: Option<&super::routing::RouteDecision>,
    provider_label: &str,
) {
    let Some(context) = lineage.cloned() else {
        return;
    };
    let connector_id = route
        .and_then(|decision| decision.provider_id.as_deref())
        .or_else(|| {
            parts
                .extensions
                .get::<super::providers::RegistryProviderId>()
                .map(|provider| provider.id.as_str())
        })
        .unwrap_or(provider_label)
        .to_owned();
    let payload_ref = context.content_ref.clone();
    let job = crate::core::ocla::ConnectorJob {
        context,
        connector_id,
        payload_ref,
        deadline_ms: None,
    };
    if let Err(error) = crate::core::ocla::OclaRegistry::global()
        .connector_scheduler
        .schedule_connector(job)
    {
        tracing::warn!("lean-ctx connector scheduling skipped: {error}");
    }
}