MCPcopy Create free account
hub / github.com/github/copilot-sdk / [kHandle]

Method [kHandle]

nodejs/src/copilotRequestHandler.ts:247–264  ·  view source on GitHub ↗

@internal

(exchange: CopilotRequestExchange)

Source from the content-addressed store, hash-verified

245
246 /** @internal */
247 async [kHandle](exchange: CopilotRequestExchange): Promise<void> {
248 const bridge = new CopilotWebSocketResponseBridge(exchange);
249 const ctx: InternalContext = {
250 requestId: exchange.requestId,
251 sessionId: exchange.sessionId,
252 transport: exchange.transport,
253 url: exchange.url,
254 headers: exchange.headers,
255 signal: exchange.signal,
256 [kBridge]: bridge,
257 };
258
259 if (exchange.transport === "websocket") {
260 await this.#handleWebSocket(exchange, ctx);
261 } else {
262 await this.#handleHttp(exchange, ctx);
263 }
264 }
265
266 async #handleHttp(exchange: CopilotRequestExchange, ctx: CopilotRequestContext): Promise<void> {
267 const request = await buildFetchRequest(exchange);

Callers

nothing calls this directly

Calls 2

#handleWebSocketMethod · 0.95
#handleHttpMethod · 0.95

Tested by

no test coverage detected