def test_app_config_extended_from_toml(tmp_path: os.PathLike) -> None:
    """Test that the [extended] section in a TOML file is correctly loaded.

    This test verifies that the [extended] section is loaded into OpenHandsConfig.extended
    and that it accepts arbitrary keys.
    """
    # Create a temporary TOML file with multiple sections including [extended]
    config_content = """
[core]
workspace_base = "/tmp/workspace"

[llm]
model = "test-model"
api_key = "toml-api-key"

[extended]
custom1 = "custom_value"
custom2 = 42
llm = "overridden"  # even a key like 'llm' is accepted in extended

[agent]
enable_prompt_extensions = true
"""
    config_file = tmp_path / 'config.toml'
    config_file.write_text(config_content)

    # Load the TOML into the OpenHandsConfig instance
    config = OpenHandsConfig()
    load_from_toml(config, str(config_file))

    # Verify that extended section is applied
    assert config.extended.custom1 == 'custom_value'
    assert config.extended.custom2 == 42
    # Even though 'llm' is defined in extended, it should not affect the main llm config.
    assert config.get_llm_config().model == 'test-model'
Test that the [extended] section in a TOML file is correctly loaded.

    This test verifies that the [extended] section is loaded into OpenHandsConfig.extended
    and that it accepts arbitrary keys.
    
tests/unit/test_config_extended.py