π OpenHands: AI-Driven Development
Fix runtime to call new token refresh (#7084)
chuckbutkus4e4f4d64f8c8
diff --git a/openhands/integrations/github/github_service.py b/openhands/integrations/github/github_service.pyindex e9049460ba..72086e27ad 100644--- a/openhands/integrations/github/github_service.py+++ b/openhands/integrations/github/github_service.py@@ -51,6 +51,9 @@ class GitHubService:async def get_latest_token(self) -> SecretStr:return self.token+ async def get_latest_provider_token(self) -> SecretStr:+ return self.token+async def _fetch_data(self, url: str, params: dict | None = None) -> tuple[Any, dict]:diff --git a/openhands/runtime/base.py b/openhands/runtime/base.pyindex 392d6b14a5..fd3eab0a93 100644--- a/openhands/runtime/base.py+++ b/openhands/runtime/base.py@@ -222,7 +222,7 @@ class Runtime(FileEditRuntimeMixin):if isinstance(event, CmdRunAction):if self.github_user_id and '$GITHUB_TOKEN' in event.command:gh_client = GithubServiceImpl(user_id=self.github_user_id)- token = await gh_client.get_latest_token()+ token = await gh_client.get_latest_provider_token()if token:export_cmd = CmdRunAction(f"export GITHUB_TOKEN='{token.get_secret_value()}'"