Skip to main content

load_md_agent

Function load_md_agent 

Source
pub fn load_md_agent(path: &Path) -> Result<AgentConfig>
Expand description

Load a tcode AgentConfig from a .md agent source file.

Why: the primary entry point for the (now sole) agent loader — takes a file path and returns a fully-populated AgentConfig or a descriptive error. What: resolves path’s parent directory as the extends: source dir and its file stem as the agent name, composes the inheritance chain via compose_agent, then projects the result via [project_to_agent_config]. A missing parent directory, an unreadable file stem, or any AgentBuildError (not found, cycle, depth exceeded, malformed frontmatter) is surfaced as a descriptive anyhow::Error — never a panic. Test: load_md_agent_base_case, load_md_agent_missing_file_errors, load_md_agent_with_extends_resolves_chain.