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

Function getConfiguredOpenAIPortFromReflect

actions/setup/js/codex_harness.cjs:292–301  ·  view source on GitHub ↗

* Determine configured OpenAI endpoint port from AWF /reflect payload. * @param {any} reflectData * @returns {number|null}

(reflectData)

Source from the content-addressed store, hash-verified

290 * @returns {number|null}
291 */
292function getConfiguredOpenAIPortFromReflect(reflectData) {
293 const endpoints = reflectData && Array.isArray(reflectData.endpoints) ? reflectData.endpoints : [];
294 const openAIEndpoint = endpoints.find(ep => {
295 if (!ep || ep.configured !== true || typeof ep.provider !== "string") return false;
296 return ep.provider.toLowerCase() === "openai";
297 });
298 if (!openAIEndpoint || openAIEndpoint.port == null) return null;
299 const parsedPort = Number(openAIEndpoint.port);
300 return Number.isNaN(parsedPort) ? null : parsedPort;
301}
302
303/**
304 * Validate that Codex openai-proxy base_url matches the configured OpenAI endpoint from /reflect.

Calls

no outgoing calls

Tested by

no test coverage detected