Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use user_id as token set indicator for settings #6595

Merged
merged 9 commits into from
Feb 4, 2025
5 changes: 3 additions & 2 deletions openhands/server/routes/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@app.get('/settings')
async def load_settings(request: Request) -> GETSettingsModel | None:
try:
user_id = get_user_id(request)
settings_store = await SettingsStoreImpl.get_instance(
config, get_user_id(request)
malhotra5 marked this conversation as resolved.
Show resolved Hide resolved
)
Expand All @@ -23,10 +24,10 @@ async def load_settings(request: Request) -> GETSettingsModel | None:
content={'error': 'Settings not found'},
)

github_token = request.state.github_token
token_is_set = bool(request.state.github_token) or bool(user_id)
settings_with_token_data = GETSettingsModel(
**settings.model_dump(),
github_token_is_set=bool(github_token),
github_token_is_set=token_is_set,
)
settings_with_token_data.llm_api_key = settings.llm_api_key

Expand Down
Loading