MCPcopy Index your code
hub / github.com/github/copilot-sdk / _connect_to_server

Method _connect_to_server

python/copilot/client.py:3626–3644  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers 1

startMethod · 0.95

Calls 3

_connect_via_stdioMethod · 0.95
_connect_via_tcpMethod · 0.95
log_timingFunction · 0.85

Tested by

no test coverage detected