INNER CODE UNIT · Rust

get_subagent_result_preview

Far-Beyond-Pulsar/Pulsar-Native · crates/agent-providers/agent_chat_tools/src/lib.rs:192

pub fn get_subagent_result_preview(subagent_id: &str) -> Option<String> {
    let store = subagent_store();
    let guard = store.read();
    guard.records.get(subagent_id).and_then(|r| {
        r.result.as_ref().and_then(|result| {
            result
                .get("assistant_message")
                .and_then(|v| v.as_str())
                .filter(|s| !s.is_empty())
                .map(|s| s.chars().take(800).collect())
        })
    })
}

fn subagent_store() -> ResourceHandle<SubagentStore> {
    EngineContext::global()
        .expect("EngineContext not initialized")
        .store

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…