Handle a REQUEST message from CLI
(self, msg: dict[str, Any])
| 492 | await write_frame(writer, response.to_dict()) |
| 493 | |
| 494 | async def _handle_request(self, msg: dict[str, Any]) -> dict[str, Any]: |
| 495 | """Handle a REQUEST message from CLI""" |
| 496 | request_id = msg.get("id", "") |
| 497 | instance_id = msg.get("instance") |
| 498 | command = msg.get("command", "") |
| 499 | params = msg.get("params", {}) |
| 500 | timeout_ms = msg.get("timeout_ms", COMMAND_TIMEOUT_MS) |
| 501 | |
| 502 | # Use request cache for idempotency |
| 503 | return await self.request_cache.handle_request( |
| 504 | request_id, |
| 505 | lambda: self._execute_command(request_id, instance_id, command, params, timeout_ms), |
| 506 | ) |
| 507 | |
| 508 | def _get_instance_or_error( |
| 509 | self, |
no test coverage detected