fix: sync issues
ref: N25B-447
This commit is contained in:
@@ -214,8 +214,8 @@ class UserInterruptAgent(BaseAgent):
|
||||
|
||||
payload = {"type": "cond_norms_state_update", "norms": updates}
|
||||
|
||||
await self._send_experiment_update(payload)
|
||||
self.logger.debug(f"Broadcasted state for {len(updates)} conditional norms.")
|
||||
await self._send_experiment_update(payload, should_log=False)
|
||||
# self.logger.debug(f"Broadcasted state for {len(updates)} conditional norms.")
|
||||
|
||||
def _create_mapping(self, program_json: str):
|
||||
"""
|
||||
@@ -259,7 +259,7 @@ class UserInterruptAgent(BaseAgent):
|
||||
except Exception as e:
|
||||
self.logger.error(f"Mapping failed: {e}")
|
||||
|
||||
async def _send_experiment_update(self, data):
|
||||
async def _send_experiment_update(self, data, should_log: bool = True):
|
||||
"""
|
||||
Sends an update to the 'experiment' topic.
|
||||
The SSE endpoint will pick this up and push it to the UI.
|
||||
@@ -268,7 +268,8 @@ class UserInterruptAgent(BaseAgent):
|
||||
topic = b"experiment"
|
||||
body = json.dumps(data).encode("utf-8")
|
||||
await self.pub_socket.send_multipart([topic, body])
|
||||
self.logger.debug(f"Sent experiment update: {data}")
|
||||
if should_log:
|
||||
self.logger.debug(f"Sent experiment update: {data}")
|
||||
|
||||
async def _send_to_speech_agent(self, text_to_say: str):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user