def test_finalize_config_cli_keeps_jupyter_and_browsing_false_when_false():
    """
    Test that finalize_config keeps enable_jupyter and enable_browsing as False
    when runtime is 'cli' and they were initially False.
    """
    app_config = OpenHandsConfig()
    app_config.runtime = 'cli'

    agent_config = AgentConfig(enable_jupyter=False, enable_browsing=False)
    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 remain False when runtime is 'cli' and initially False"
    )
    assert not app_config.agents[DEFAULT_AGENT_NAME].enable_browsing, (
        "enable_browsing should remain False when runtime is 'cli' and initially False"
    )

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