def test_load_markdown_with_empty_frontmatter():
    """Test loading a markdown file with empty frontmatter."""
    content = (
        '---\n---\n# Test Content\nThis is a test markdown file with empty frontmatter.'
    )
    path = Path('test.md')

    # Load the agent from content using keyword argument
    agent = BaseMicroagent.load(path=path, file_content=content)

    # Verify it's loaded as a repo agent with default values
    assert isinstance(agent, RepoMicroagent)
    assert agent.name == 'default'
    assert (
        agent.content
        == '# Test Content\nThis is a test markdown file with empty frontmatter.'
    )
    assert agent.type == MicroagentType.REPO_KNOWLEDGE
    assert agent.metadata.agent == 'CodeActAgent'
    assert agent.metadata.version == '1.0.0'
Test loading a markdown file with empty frontmatter.
tests/unit/test_microagent_no_header.py