Skip to content

Commit cd060ee

Browse files
committed
update pr instruction
1 parent 5d58c43 commit cd060ee

File tree

4 files changed

+32
-28
lines changed

4 files changed

+32
-28
lines changed

openhands/core/config/agent_config.py

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class AgentConfig(BaseModel):
3030
disabled_microagents: list[str] = Field(default_factory=list)
3131
enable_history_truncation: bool = Field(default=True)
3232
enable_som_visual_browsing: bool = Field(default=True)
33-
condenser: CondenserConfig = Field(default_factory=NoOpCondenserConfig)
3433
condenser: CondenserConfig = Field(
3534
default_factory=lambda: NoOpCondenserConfig(type='noop')
3635
)

openhands/core/schema/action.py

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class ActionType(str, Enum):
4242
"""Delegates a task to another agent.
4343
"""
4444

45-
4645
THINK = 'think'
4746
"""Logs a thought.
4847
"""

openhands/events/serialization/action.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import re
21
from typing import Any
2+
33
from openhands.core.exceptions import LLMMalformedActionError
44
from openhands.events.action.action import Action
55
from openhands.events.action.agent import (

openhands/server/routes/settings.py

+31-25
Original file line numberDiff line numberDiff line change
@@ -42,34 +42,34 @@ async def load_settings(request: Request) -> GETSettingsModel | JSONResponse:
4242

4343

4444
@app.post('/unset-settings-tokens', response_model=dict[str, str])
45-
async def unset_settings_tokens(
46-
request: Request
47-
) -> JSONResponse:
45+
async def unset_settings_tokens(request: Request) -> JSONResponse:
4846
try:
4947
settings_store = await SettingsStoreImpl.get_instance(
5048
config, get_user_id(request)
5149
)
5250

5351
existing_settings = await settings_store.load()
5452
if existing_settings:
55-
settings = existing_settings.model_copy(update={'secrets_store': SecretStore()})
53+
settings = existing_settings.model_copy(
54+
update={'secrets_store': SecretStore()}
55+
)
5656
await settings_store.store(settings)
57-
57+
5858
return JSONResponse(
5959
status_code=status.HTTP_200_OK,
6060
content={'message': 'Settings stored'},
6161
)
62-
62+
6363
except Exception as e:
6464
logger.warning(f'Something went wrong unsetting tokens: {e}')
6565
return JSONResponse(
6666
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
6767
content={'error': 'Something went wrong unsetting tokens'},
6868
)
69+
70+
6971
@app.post('/reset-settings', response_model=dict[str, str])
70-
async def reset_settings(
71-
request: Request
72-
) -> JSONResponse:
72+
async def reset_settings(request: Request) -> JSONResponse:
7373
"""
7474
Resets user settings.
7575
"""
@@ -79,23 +79,28 @@ async def reset_settings(
7979
)
8080

8181
existing_settings = await settings_store.load()
82-
settings = Settings(language="en",
83-
agent="CodeActAgent",
84-
security_analyzer="",
85-
confirmation_mode=False,
86-
llm_model="anthropic/claude-3-5-sonnet-20241022",
87-
llm_api_key="",
88-
llm_base_url="",
89-
remote_runtime_resource_factor=1,
90-
enable_default_condenser=True,
91-
enable_sound_notifications=False,
92-
user_consents_to_analytics=existing_settings.user_consents_to_analytics if existing_settings else False
93-
)
94-
82+
settings = Settings(
83+
language='en',
84+
agent='CodeActAgent',
85+
security_analyzer='',
86+
confirmation_mode=False,
87+
llm_model='anthropic/claude-3-5-sonnet-20241022',
88+
llm_api_key='',
89+
llm_base_url='',
90+
remote_runtime_resource_factor=1,
91+
enable_default_condenser=True,
92+
enable_sound_notifications=False,
93+
user_consents_to_analytics=existing_settings.user_consents_to_analytics
94+
if existing_settings
95+
else False,
96+
)
97+
9598
server_config_values = server_config.get_config()
96-
is_hide_llm_settings_enabled = server_config_values.get("FEATURE_FLAGS", {}).get("HIDE_LLM_SETTINGS", False)
99+
is_hide_llm_settings_enabled = server_config_values.get(
100+
'FEATURE_FLAGS', {}
101+
).get('HIDE_LLM_SETTINGS', False)
97102
# We don't want the user to be able to modify these settings in SaaS
98-
if (server_config.app_mode == AppMode.SAAS and is_hide_llm_settings_enabled):
103+
if server_config.app_mode == AppMode.SAAS and is_hide_llm_settings_enabled:
99104
if existing_settings:
100105
settings.llm_api_key = existing_settings.llm_api_key
101106
settings.llm_base_url = existing_settings.llm_base_url
@@ -106,14 +111,15 @@ async def reset_settings(
106111
status_code=status.HTTP_200_OK,
107112
content={'message': 'Settings stored'},
108113
)
109-
114+
110115
except Exception as e:
111116
logger.warning(f'Something went wrong resetting settings: {e}')
112117
return JSONResponse(
113118
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
114119
content={'error': 'Something went wrong resetting settings'},
115120
)
116121

122+
117123
@app.post('/settings', response_model=dict[str, str])
118124
async def store_settings(
119125
request: Request,

0 commit comments

Comments
 (0)