MCPcopy Create free account
hub / github.com/github/gh-aw / generateCopilotConnectionToken

Function generateCopilotConnectionToken

actions/setup/js/copilot_harness.cjs:158–162  ·  view source on GitHub ↗

* Generate a per-run connection token for Copilot SDK headless authentication. * Produces 32 random bytes encoded as a 64-character hexadecimal string. * @param {{ randomBytes?: (size: number) => Buffer }} [options] * @returns {string} 64-character hexadecimal token (32 random bytes).

(options)

Source from the content-addressed store, hash-verified

156 * @returns {string} 64-character hexadecimal token (32 random bytes).
157 */
158function generateCopilotConnectionToken(options) {
159 // randomBytes injection exists only for unit tests; production uses crypto.randomBytes.
160 const randomBytes = options?.randomBytes ?? crypto.randomBytes;
161 return randomBytes(32).toString("hex");
162}
163
164/**
165 * Determines if the collected output contains a transient CAPIError 400

Callers 2

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected