restore logging of user messages when using cli (#3145)

This commit is contained in:
Engel Nyst 2024-07-27 14:58:23 +02:00 committed by GitHub
parent 437e0c76bf
commit f07280153a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -161,6 +161,10 @@ class AgentController:
await self.set_agent_state_to(event.agent_state) # type: ignore
elif isinstance(event, MessageAction):
if event.source == EventSource.USER:
logger.info(
event,
extra={'msg_type': 'ACTION', 'event_source': EventSource.USER},
)
if self.get_agent_state() != AgentState.RUNNING:
await self.set_agent_state_to(AgentState.RUNNING)
elif event.source == EventSource.AGENT and event.wait_for_response:

View File

@ -10,7 +10,7 @@ from opendevin.core.logger import opendevin_logger as logger
from opendevin.core.schema import AgentState
from opendevin.core.schema.action import ActionType
from opendevin.core.schema.config import ConfigType
from opendevin.events.action import Action, ChangeAgentStateAction, NullAction
from opendevin.events.action import ChangeAgentStateAction, NullAction
from opendevin.events.event import Event, EventSource
from opendevin.events.observation import (
AgentStateChangedObservation,
@ -146,10 +146,6 @@ class Session:
return
event = event_from_dict(data.copy())
self.agent_session.event_stream.add_event(event, EventSource.USER)
if isinstance(event, Action):
logger.info(
event, extra={'msg_type': 'ACTION', 'event_source': EventSource.USER}
)
async def send(self, data: dict[str, object]) -> bool:
try: