Skip to content

Commit 9593aa6

Browse files
committed
reduce logs
1 parent 11e6d40 commit 9593aa6

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

openhands/controller/agent_controller.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,11 @@ def _add_system_message(self):
189189
# Add the system message to the event stream
190190
# This should be done for all agents, including delegates
191191
system_message = self.agent.get_system_message()
192-
logger.debug(f'System message got from agent: {system_message}')
193192
if system_message:
193+
logger.debug(
194+
f'System message got from agent: {system_message.content[50]}...'
195+
)
194196
self.event_stream.add_event(system_message, EventSource.AGENT)
195-
logger.debug(f'System message added to event stream: {system_message}')
196197

197198
async def close(self, set_stop_state: bool = True) -> None:
198199
"""Closes the agent controller, canceling any ongoing tasks and unsubscribing from the event stream.

openhands/llm/llm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,9 @@ def init_model_info(self) -> None:
450450
pass
451451
from openhands.io import json
452452

453-
logger.debug(f'Model info: {json.dumps(self.model_info, indent=2)}')
453+
logger.debug(
454+
f'Model info: {json.dumps({"model": self.config.model, "base_url": self.config.base_url}, indent=2)}'
455+
)
454456

455457
if self.config.model.startswith('huggingface'):
456458
# HF doesn't support the OpenAI default value for top_p (1)

openhands/server/session/agent_session.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,12 +411,9 @@ def _create_controller(
411411
'\n--------------------------------- OpenHands Configuration ---------------------------------\n'
412412
f'LLM: {agent.llm.config.model}\n'
413413
f'Base URL: {agent.llm.config.base_url}\n'
414-
)
415-
416-
msg += (
417414
f'Agent: {agent.name}\n'
418415
f'Runtime: {self.runtime.__class__.__name__}\n'
419-
f'Plugins: {agent.sandbox_plugins}\n'
416+
f'Plugins: {[p.name for p in agent.sandbox_plugins] if agent.sandbox_plugins else "None"}\n'
420417
'-------------------------------------------------------------------------------------------'
421418
)
422419
self.logger.debug(msg)

openhands/server/session/session.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,15 @@ async def initialize_agent(
154154
),
155155
]
156156
)
157-
158-
self.logger.info(f'Enabling default condenser: {default_condenser_config}')
157+
158+
self.logger.info(
159+
f'Enabling pipeline condenser with:'
160+
f' browser_output_masking(attention_window=2), '
161+
f' llm(model="{llm.config.model}", '
162+
f' base_url="{llm.config.base_url}", '
163+
f' keep_first=4, max_size=80)'
164+
)
159165
agent_config.condenser = default_condenser_config
160-
161166
agent = Agent.get_cls(agent_cls)(llm, agent_config)
162167

163168
git_provider_tokens = None

openhands/utils/conversation_summary.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ async def auto_generate_title(
8989
Returns:
9090
A generated title string
9191
"""
92-
logger.info(f'Auto-generating title for conversation {conversation_id}')
93-
9492
try:
9593
# Create an event stream for the conversation
9694
event_stream = EventStream(conversation_id, file_store, user_id)

0 commit comments

Comments
 (0)