π OpenHands: AI-Driven Development
remove deprecated github-token config (#2334)
Engel Nystfab8c9003bbf
diff --git a/opendevin/core/config.py b/opendevin/core/config.pyindex 2bbab5656a..1de422d59a 100644--- a/opendevin/core/config.py+++ b/opendevin/core/config.py@@ -149,7 +149,6 @@ class AppConfig(metaclass=Singleton):disable_color: Whether to disable color. For terminals that don't support color.sandbox_user_id: The user ID for the sandbox.sandbox_timeout: The timeout for the sandbox.- github_token: The GitHub token.debug: Whether to enable debugging.enable_auto_lint: Whether to enable auto linting. This is False by default, for regular runs of the app. For evaluation, please set this to True."""@@ -183,7 +182,6 @@ class AppConfig(metaclass=Singleton):persist_sandbox: bool = Falsessh_port: int = 63710ssh_password: str | None = None- github_token: str | None = Nonejwt_secret: str = uuid.uuid4().hexdebug: bool = Falseenable_auto_lint: bool = (diff --git a/opendevin/core/schema/config.py b/opendevin/core/schema/config.pyindex 4c66feeaf6..94813fb6f1 100644--- a/opendevin/core/schema/config.py+++ b/opendevin/core/schema/config.py@@ -41,5 +41,4 @@ class ConfigType(str, Enum):USE_HOST_NETWORK = 'USE_HOST_NETWORK'SSH_HOSTNAME = 'SSH_HOSTNAME'DISABLE_COLOR = 'DISABLE_COLOR'- GITHUB_TOKEN = 'GITHUB_TOKEN'DEBUG = 'DEBUG'diff --git a/tests/unit/test_config.py b/tests/unit/test_config.pyindex 731a5fce09..2703314b4b 100644--- a/tests/unit/test_config.py+++ b/tests/unit/test_config.py@@ -160,8 +160,6 @@ def test_invalid_toml_format(monkeypatch, temp_toml_file, default_config):default_config.jwt_secret = None # prevent leakassert default_config.llm.model == 'gpt-5-turbo-1106'assert default_config.llm.custom_llm_provider is None- if default_config.github_token is not None: # prevent leak- pytest.fail('GitHub token should be empty')if default_config.llm.api_key is not None: # prevent leakpytest.fail('LLM API key should be empty.')@@ -270,16 +268,13 @@ def test_api_keys_repr_str():llm=llm_config,agent=agent_config,e2b_api_key='my_e2b_api_key',- github_token='my_github_token',)assert "e2b_api_key='******'" in repr(app_config)- assert "github_token='******'" in repr(app_config)assert "e2b_api_key='******'" in str(app_config)- assert "github_token='******'" in str(app_config)# Check that no other attrs in AppConfig have 'key' or 'token' in their name# This will fail when new attrs are added, and attract attention- known_key_token_attrs_app = ['e2b_api_key', 'github_token']+ known_key_token_attrs_app = ['e2b_api_key']for attr_name in dir(AppConfig):if (not attr_name.startswith('__')diff --git a/tests/unit/test_logging.py b/tests/unit/test_logging.pyindex 2e441b30d3..db8ec35ff6 100644--- a/tests/unit/test_logging.py+++ b/tests/unit/test_logging.py@@ -82,13 +82,11 @@ def test_llm_config_attributes_masking(test_handler):def test_app_config_attributes_masking(test_handler):logger, stream = test_handler- app_config = AppConfig(- e2b_api_key='e2b-xyz789', github_token='ghp_abcdefghijklmnopqrstuvwxyz'- )+ app_config = AppConfig(e2b_api_key='e2b-xyz789')logger.info(f'App Config: {app_config}')log_output = stream.getvalue()assert "e2b_api_key='******'" in log_output- assert "github_token='******'" in log_output+ assert 'github_token' not in log_outputassert 'e2b-xyz789' not in log_outputassert 'ghp_abcdefghijklmnopqrstuvwxyz' not in log_output