def test_finalize_config_cli_disables_jupyter_and_browsing_when_true():
    """
    Test that finalize_config sets enable_jupyter and enable_browsing to False
    when runtime is 'cli' and they were initially True.
    """
    app_config = OpenHandsConfig()
    app_config.runtime = 'cli'

    agent_config = AgentConfig(enable_jupyter=True, enable_browsing=True)
    app_config.agents[DEFAULT_AGENT_NAME] = agent_config

    finalize_config(app_config)

    assert not app_config.agents[DEFAULT_AGENT_NAME].enable_jupyter, (
        "enable_jupyter should be False when runtime is 'cli'"
    )
    assert not app_config.agents[DEFAULT_AGENT_NAME].enable_browsing, (
        "enable_browsing should be False when runtime is 'cli'"
    )

    Test that finalize_config sets enable_jupyter and enable_browsing to False
    when runtime is 'cli' and they were initially True.
    
tests/unit/core/config/test_config_utils.py