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

Function finalize

nodejs/src/copilotRequestHandler.ts:401–418  ·  view source on GitHub ↗
(
    exchange: CopilotRequestExchange,
    status: number,
    message: string,
    code?: string
)

Source from the content-addressed store, hash-verified

399}
400
401async function finalize(
402 exchange: CopilotRequestExchange,
403 status: number,
404 message: string,
405 code?: string
406): Promise<void> {
407 if (exchange.finished) {
408 return;
409 }
410 try {
411 if (!exchange.started) {
412 await exchange.startResponse({ status, headers: {} });
413 }
414 await exchange.errorResponse({ message, code });
415 } catch {
416 // Best-effort — the connection may already be dead.
417 }
418}
419
420function routeChunk(
421 exchange: CopilotRequestExchange,

Callers 1

runFunction · 0.85

Calls 2

startResponseMethod · 0.45
errorResponseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…