(
path: &Path,
parent_session_id: &str,
agent_id: &str,
)
| 680 | } |
| 681 | |
| 682 | fn 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 | |
| 700 | fn dispatch_model_for_agent(path: &Path, agent_id: &str) -> Option<String> { |
| 701 | let contents = std::fs::read_to_string(path).ok()?; |
no test coverage detected