MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / parent_dispatch_model_for_subagent

Function parent_dispatch_model_for_subagent

src/sessions/cursor.rs:682–698  ·  view source on GitHub ↗
(
    path: &Path,
    parent_session_id: &str,
    agent_id: &str,
)

Source from the content-addressed store, hash-verified

680}
681
682fn parent_dispatch_model_for_subagent(
683 path: &Path,
684 parent_session_id: &str,
685 agent_id: &str,
686) -> Option<String> {
687 let parent_dir = path.parent()?.parent()?;
688 let candidates = [
689 parent_dir.join(format!("{parent_session_id}.jsonl")),
690 parent_dir.with_extension("jsonl"),
691 ];
692 for candidate in candidates {
693 if let Some(model) = dispatch_model_for_agent(&candidate, agent_id) {
694 return Some(model);
695 }
696 }
697 None
698}
699
700fn dispatch_model_for_agent(path: &Path, agent_id: &str) -> Option<String> {
701 let contents = std::fs::read_to_string(path).ok()?;

Callers 1

parse_cursor_jsonlFunction · 0.85

Calls 1

dispatch_model_for_agentFunction · 0.85

Tested by

no test coverage detected