Enables condensation by default (#7746)

Co-authored-by: Calvin Smith <calvin@all-hands.dev>
This commit is contained in:
Calvin Smith 2025-04-07 11:47:51 -06:00 committed by GitHub
parent 69d4a8df7c
commit 408ad1ff2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 19 deletions

View File

@ -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

View File

@ -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