Skip to content

Commit b46d888

Browse files
authored
Merge branch 'main' into mh/rel0230
2 parents eb76656 + a7239ce commit b46d888

File tree

6 files changed

+30
-24
lines changed

6 files changed

+30
-24
lines changed

openhands/server/listen_socket.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ async def connect(connection_id: str, environ, auth):
3939
if server_config.app_mode != AppMode.OSS:
4040
cookies_str = environ.get('HTTP_COOKIE', '')
4141
cookies = dict(cookie.split('=', 1) for cookie in cookies_str.split('; '))
42-
signed_token = cookies.get('github_auth', '')
42+
signed_token = cookies.get('openhands_auth', '')
4343
if not signed_token:
44-
logger.error('No github_auth cookie')
45-
raise ConnectionRefusedError('No github_auth cookie')
44+
logger.error('No openhands_auth cookie')
45+
raise ConnectionRefusedError('No openhands_auth cookie')
4646
if not config.jwt_secret:
4747
raise RuntimeError('JWT secret not found')
4848

openhands/server/routes/github.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
app = APIRouter(prefix='/api/github')
1212

13-
1413
GithubServiceImpl = get_impl(GitHubService, server_config.github_service_class)
1514

1615

openhands/server/routes/manage_conversations.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
from openhands.events.action.message import MessageAction
1111
from openhands.events.stream import EventStreamSubscriber
1212
from openhands.runtime import get_runtime_cls
13-
from openhands.server.auth import get_github_token, get_user_id
13+
from openhands.server.auth import get_user_id
14+
from openhands.server.routes.github import GithubServiceImpl
1415
from openhands.server.session.conversation_init_data import ConversationInitData
1516
from openhands.server.shared import (
1617
ConversationStoreImpl,
@@ -130,7 +131,7 @@ async def new_conversation(request: Request, data: InitSessionRequest):
130131
"""
131132
logger.info('Initializing new conversation')
132133
user_id = get_user_id(request)
133-
github_token = get_github_token(request)
134+
github_token = GithubServiceImpl.get_gh_token(request)
134135
selected_repository = data.selected_repository
135136
initial_user_msg = data.initial_user_msg
136137
image_urls = data.image_urls or []

openhands/server/services/github_service.py

+6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from typing import Any
22

33
import httpx
4+
from fastapi import Request
45

6+
from openhands.server.auth import get_github_token
57
from openhands.server.data_models.gh_types import GitHubRepository, GitHubUser
68
from openhands.server.shared import SettingsStoreImpl, config, server_config
79
from openhands.server.types import AppMode, GhAuthenticationError, GHUnknownException
@@ -131,3 +133,7 @@ async def search_repositories(
131133
]
132134

133135
return repos
136+
137+
@classmethod
138+
def get_gh_token(cls, request: Request) -> str | None:
139+
return get_github_token(request)

poetry.lock

+17-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protobuf = "^4.21.6,<5.0.0" # chromadb currently fails on 5.0+
6161
opentelemetry-api = "1.25.0"
6262
opentelemetry-exporter-otlp-proto-grpc = "1.25.0"
6363
modal = ">=0.66.26,<0.74.0"
64-
runloop-api-client = "0.18.0"
64+
runloop-api-client = "0.19.0"
6565
libtmux = ">=0.37,<0.40"
6666
pygithub = "^2.5.0"
6767
joblib = "*"

0 commit comments

Comments
 (0)