Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Enables condensation by default (#7746)

Calvin Smith408ad1ff2bec
diff --git a/openhands/server/session/session.py b/openhands/server/session/session.py
index fbc4f9a5c9..c2ce16eca9 100644
--- a/openhands/server/session/session.py
+++ b/openhands/server/session/session.py
@@ -7,10 +7,7 @@ import socketio
from openhands.controller.agent import Agent
from openhands.core.config import AppConfig
-from openhands.core.config.condenser_config import (
- LLMSummarizingCondenserConfig,
- StructuredSummaryCondenserConfig,
-)
+from openhands.core.config.condenser_config import LLMSummarizingCondenserConfig
from openhands.core.logger import OpenHandsLoggerAdapter
from openhands.core.schema import AgentState
from openhands.events.action import MessageAction, NullAction
@@ -128,20 +125,9 @@ class Session:
agent_config = self.config.get_agent_config(agent_cls)
if settings.enable_default_condenser:
- # If function-calling is active we can use the structured summary
- # condenser for more reliable summaries.
- if llm.is_function_calling_active():
- default_condenser_config = StructuredSummaryCondenserConfig(
- llm_config=llm.config, keep_first=3, max_size=80
- )
-
- # Otherwise, we'll fall back to the unstructured summary condenser.
- # This is a good default but struggles more than the structured
- # summary condenser with long messages.
- else:
- default_condenser_config = LLMSummarizingCondenserConfig(
- llm_config=llm.config, keep_first=3, max_size=80
- )
+ default_condenser_config = LLMSummarizingCondenserConfig(
+ llm_config=llm.config, keep_first=3, max_size=80
+ )
self.logger.info(f'Enabling default condenser: {default_condenser_config}')
agent_config.condenser = default_condenser_config
diff --git a/openhands/server/settings.py b/openhands/server/settings.py
index a82c27ca22..6c53240190 100644
--- a/openhands/server/settings.py
+++ b/openhands/server/settings.py
@@ -30,7 +30,7 @@ class Settings(BaseModel):
llm_base_url: str | None = None
remote_runtime_resource_factor: int | None = None
secrets_store: SecretStore = Field(default_factory=SecretStore, frozen=True)
- enable_default_condenser: bool = False
+ enable_default_condenser: bool = True
enable_sound_notifications: bool = False
user_consents_to_analytics: bool | None = None
sandbox_base_container_image: str | None = None