Handle incoming WebSocket messages
(session_id: str, data: Dict[str, Any],
websocket: WebSocket)
| 154 | |
| 155 | |
| 156 | async def handle_session_message(session_id: str, data: Dict[str, Any], |
| 157 | websocket: WebSocket): |
| 158 | """Handle incoming WebSocket messages""" |
| 159 | action = data.get('action') |
| 160 | |
| 161 | if action == 'start': |
| 162 | await start_agent(session_id, data, websocket) |
| 163 | elif action == 'stop': |
| 164 | await stop_agent(session_id) |
| 165 | elif action == 'send_input': |
| 166 | await send_input(session_id, data) |
| 167 | elif action == 'get_status': |
| 168 | await send_status(session_id, websocket) |
| 169 | |
| 170 | |
| 171 | async def start_agent(session_id: str, data: Dict[str, Any], |
no test coverage detected