Connect to the runtime via the configured transport. Uses either stdio or TCP based on the client configuration. Raises: RuntimeError: If the connection fails.
(self)
| 3624 | raise RuntimeError("Timeout waiting for CLI server to start") |
| 3625 | |
| 3626 | async def _connect_to_server(self) -> None: |
| 3627 | """Connect to the runtime via the configured transport. |
| 3628 | |
| 3629 | Uses either stdio or TCP based on the client configuration. |
| 3630 | |
| 3631 | Raises: |
| 3632 | RuntimeError: If the connection fails. |
| 3633 | """ |
| 3634 | setup_start = time.perf_counter() |
| 3635 | if isinstance(self._connection, StdioRuntimeConnection): |
| 3636 | await self._connect_via_stdio() |
| 3637 | else: |
| 3638 | await self._connect_via_tcp() |
| 3639 | log_timing( |
| 3640 | logger, |
| 3641 | logging.DEBUG, |
| 3642 | "CopilotClient._connect_to_server transport setup complete", |
| 3643 | setup_start, |
| 3644 | ) |
| 3645 | |
| 3646 | async def _connect_via_stdio(self) -> None: |
| 3647 | """ |
no test coverage detected