Skip to main content

locate_agents_dir

Function locate_agents_dir 

Source
pub fn locate_agents_dir(project_root: &Path) -> PathBuf
Expand description

Locate the agents directory for the given project root.

Why: projects may use either .claude/agents (Claude Code native) or .open-mpm/agents (open-mpm legacy). Checking both preserves compatibility. Shared between main.rs’s run-task CLI path and (#2056) serve::build_router’s task.run wiring, so a project’s agents resolve identically whether driven from the CLI or the daemon. What: returns the first of the two conventional directories that exists; falls back to .claude/agents (which may not exist yet — callers that need it to exist check separately, e.g. via AgentConfig::load’s own error). Test: agents::tests::locate_agents_dir_prefers_claude_then_open_mpm_then_default.