feat: implemented pausing, implemented graceful stopping, removed old RI pausing code

ref: N25B-393
This commit is contained in:
Storm
2026-01-20 18:53:24 +01:00
parent f9b807fc97
commit 0b1c2ce20a
3 changed files with 52 additions and 30 deletions

View File

@@ -3,7 +3,6 @@ import json
import zmq
import zmq.asyncio as azmq
from pydantic import ValidationError
from zmq.asyncio import Context
from control_backend.agents import BaseAgent
@@ -12,8 +11,6 @@ from control_backend.agents.perception.visual_emotion_recognition_agent.visual_e
VisualEmotionRecognitionAgent,
)
from control_backend.core.config import settings
from control_backend.schemas.internal_message import InternalMessage
from control_backend.schemas.ri_message import PauseCommand
from ..actuation.robot_speech_agent import RobotSpeechAgent
from ..perception import VADAgent
@@ -335,12 +332,4 @@ class RICommunicationAgent(BaseAgent):
self.logger.debug("Restarting communication negotiation.")
if await self._negotiate_connection(max_retries=2):
self.connected = True
async def handle_message(self, msg: InternalMessage):
return
try:
pause_command = PauseCommand.model_validate_json(msg.body)
await self._req_socket.send_json(pause_command.model_dump())
self.logger.debug(await self._req_socket.recv_json())
except ValidationError:
self.logger.warning("Incorrect message format for PauseCommand.")