diff --git a/openhands/controller/agent_controller.py b/openhands/controller/agent_controller.py index ad29eb0f3f..5ec198e797 100644 --- a/openhands/controller/agent_controller.py +++ b/openhands/controller/agent_controller.py @@ -189,10 +189,14 @@ class AgentController: # Add the system message to the event stream # This should be done for all agents, including delegates system_message = self.agent.get_system_message() - logger.debug(f'System message got from agent: {system_message}') - if system_message: + if system_message and system_message.content: + preview = ( + system_message.content[:50] + '...' + if len(system_message.content) > 50 + else system_message.content + ) + logger.debug(f'System message: {preview}') self.event_stream.add_event(system_message, EventSource.AGENT) - logger.debug(f'System message added to event stream: {system_message}') async def close(self, set_stop_state: bool = True) -> None: """Closes the agent controller, canceling any ongoing tasks and unsubscribing from the event stream. diff --git a/openhands/llm/llm.py b/openhands/llm/llm.py index 835dc0c92c..e719eaba7e 100644 --- a/openhands/llm/llm.py +++ b/openhands/llm/llm.py @@ -450,7 +450,9 @@ class LLM(RetryMixin, DebugMixin): pass from openhands.io import json - logger.debug(f'Model info: {json.dumps(self.model_info, indent=2)}') + logger.debug( + f'Model info: {json.dumps({"model": self.config.model, "base_url": self.config.base_url}, indent=2)}' + ) if self.config.model.startswith('huggingface'): # HF doesn't support the OpenAI default value for top_p (1) diff --git a/openhands/microagent/microagent.py b/openhands/microagent/microagent.py index fbff3a2365..bb897eb034 100644 --- a/openhands/microagent/microagent.py +++ b/openhands/microagent/microagent.py @@ -194,7 +194,6 @@ def load_microagents_from_dir( logger.debug(f'Loading agents from {microagent_dir}') if microagent_dir.exists(): for file in microagent_dir.rglob('*.md'): - logger.debug(f'Checking file {file}...') # skip README.md if file.name == 'README.md': continue @@ -204,9 +203,6 @@ def load_microagents_from_dir( repo_agents[agent.name] = agent elif isinstance(agent, KnowledgeMicroagent): knowledge_agents[agent.name] = agent - logger.debug( - f'Loaded agent {agent.name} from {file}. Type: {type(agent)}' - ) except MicroagentValidationError as e: # For validation errors, include the original exception error_msg = f'Error loading microagent from {file}: {str(e)}' @@ -216,4 +212,8 @@ def load_microagents_from_dir( error_msg = f'Error loading microagent from {file}: {str(e)}' raise ValueError(error_msg) from e + logger.debug( + f'Loaded {len(repo_agents) + len(knowledge_agents)} microagents: ' + f'{[*repo_agents.keys(), *knowledge_agents.keys()]}' + ) return repo_agents, knowledge_agents diff --git a/openhands/server/session/agent_session.py b/openhands/server/session/agent_session.py index 010fd3ff3f..4f84fd3e16 100644 --- a/openhands/server/session/agent_session.py +++ b/openhands/server/session/agent_session.py @@ -411,12 +411,9 @@ class AgentSession: '\n--------------------------------- OpenHands Configuration ---------------------------------\n' f'LLM: {agent.llm.config.model}\n' f'Base URL: {agent.llm.config.base_url}\n' - ) - - msg += ( f'Agent: {agent.name}\n' f'Runtime: {self.runtime.__class__.__name__}\n' - f'Plugins: {agent.sandbox_plugins}\n' + f'Plugins: {[p.name for p in agent.sandbox_plugins] if agent.sandbox_plugins else "None"}\n' '-------------------------------------------------------------------------------------------' ) self.logger.debug(msg) diff --git a/openhands/server/session/session.py b/openhands/server/session/session.py index 8fc17d6516..78366cd522 100644 --- a/openhands/server/session/session.py +++ b/openhands/server/session/session.py @@ -154,10 +154,15 @@ class Session: ), ] ) - - self.logger.info(f'Enabling default condenser: {default_condenser_config}') + + self.logger.info( + f'Enabling pipeline condenser with:' + f' browser_output_masking(attention_window=2), ' + f' llm(model="{llm.config.model}", ' + f' base_url="{llm.config.base_url}", ' + f' keep_first=4, max_size=80)' + ) agent_config.condenser = default_condenser_config - agent = Agent.get_cls(agent_cls)(llm, agent_config) git_provider_tokens = None diff --git a/openhands/utils/conversation_summary.py b/openhands/utils/conversation_summary.py index b05cc8c802..5a8ff410f8 100644 --- a/openhands/utils/conversation_summary.py +++ b/openhands/utils/conversation_summary.py @@ -89,8 +89,6 @@ async def auto_generate_title( Returns: A generated title string """ - logger.info(f'Auto-generating title for conversation {conversation_id}') - try: # Create an event stream for the conversation event_stream = EventStream(conversation_id, file_store, user_id)