MCPcopy Create free account
hub / github.com/github/copilot-sdk / build_isolated_client

Function build_isolated_client

python/e2e/_copilot_request_helpers.py:272–290  ·  view source on GitHub ↗

Build a CopilotClient wired to ``handler`` via ``request_handler``.

(
    ctx: E2ETestContext,
    handler: CopilotRequestHandler,
    extra_env: dict[str, str] | None = None,
)

Source from the content-addressed store, hash-verified

270
271
272def build_isolated_client(
273 ctx: E2ETestContext,
274 handler: CopilotRequestHandler,
275 extra_env: dict[str, str] | None = None,
276) -> CopilotClient:
277 """Build a CopilotClient wired to ``handler`` via ``request_handler``."""
278 github_token = (
279 "fake-token-for-e2e-tests" if os.environ.get("GITHUB_ACTIONS") == "true" else None
280 )
281 env = ctx.get_env()
282 if extra_env:
283 env = {**env, **extra_env}
284 return CopilotClient(
285 connection=RuntimeConnection.for_stdio(path=ctx.cli_path),
286 working_directory=ctx.work_dir,
287 env=env,
288 github_token=github_token,
289 request_handler=handler,
290 )
291
292
293def isolated_client_fixture(make_handler, extra_env: dict[str, str] | None = None):

Callers 2

bearer_fixtureFunction · 0.85
_fixtureFunction · 0.85

Calls 4

CopilotClientClass · 0.90
for_stdioMethod · 0.80
getMethod · 0.45
get_envMethod · 0.45

Tested by 1

bearer_fixtureFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…