{"record":{"id":"e4f2aae9b158814f","repo":"openai/codex-plugin-cc","slug":"broker-pipe-endpoint-is-missing-its-path","errorCode":null,"errorMessage":"Broker pipe endpoint is missing its path.","messagePattern":"Broker pipe endpoint is missing its path\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"plugins/codex/scripts/lib/broker-endpoint.mjs","lineNumber":27,"sourceCode":"\nexport function createBrokerEndpoint(sessionDir, platform = process.platform) {\n  if (platform === \"win32\") {\n    const pipeName = sanitizePipeName(`${path.win32.basename(sessionDir)}-codex-app-server`);\n    return `pipe:\\\\\\\\.\\\\pipe\\\\${pipeName}`;\n  }\n\n  return `unix:${path.join(sessionDir, \"broker.sock\")}`;\n}\n\nexport function parseBrokerEndpoint(endpoint) {\n  if (typeof endpoint !== \"string\" || endpoint.length === 0) {\n    throw new Error(\"Missing broker endpoint.\");\n  }\n\n  if (endpoint.startsWith(\"pipe:\")) {\n    const pipePath = endpoint.slice(\"pipe:\".length);\n    if (!pipePath) {\n      throw new Error(\"Broker pipe endpoint is missing its path.\");\n    }\n    return { kind: \"pipe\", path: pipePath };\n  }\n\n  if (endpoint.startsWith(\"unix:\")) {\n    const socketPath = endpoint.slice(\"unix:\".length);\n    if (!socketPath) {\n      throw new Error(\"Broker Unix socket endpoint is missing its path.\");\n    }\n    return { kind: \"unix\", path: socketPath };\n  }\n\n  throw new Error(`Unsupported broker endpoint: ${endpoint}`);\n}\n","sourceCodeStart":9,"sourceCodeEnd":42,"githubUrl":"https://github.com/openai/codex-plugin-cc/blob/db52e28f4d9ded852ab3942cea316258ae4ef346/plugins/codex/scripts/lib/broker-endpoint.mjs#L9-L42","documentation":"Thrown by parseBrokerEndpoint when the endpoint string starts with the 'pipe:' scheme but the path after the scheme is empty (e.g. 'pipe:' with nothing following). Windows named-pipe endpoints must carry the full pipe path such as \\\\.\\pipe\\<name>; a bare 'pipe:' has no addressable pipe.","triggerScenarios":"Calling parseBrokerEndpoint('pipe:') or parseBrokerEndpoint('pipe:\\\\.\\pipe\\') after a value that trims to empty. Typically a hand-edited config or a templating bug that produced the scheme prefix without the pipe path.","commonSituations":"Manually editing a Windows broker config and deleting the pipe path. A createBrokerEndpoint call on win32 where sessionDir basename sanitized to empty (sanitizePipeName strips all non-alphanumerics, leaving ''), yielding 'pipe:\\\\.\\pipe\\'.","solutions":["Provide a complete pipe endpoint: 'pipe:\\\\.\\pipe\\my-codex-app-server'.","If generating on Windows, ensure sessionDir basename contains alphanumerics so sanitizePipeName yields a non-empty pipe name.","Validate the endpoint with a regex like /^pipe:\\\\\\\\.\\\\pipe\\\\.+$/ before calling parseBrokerEndpoint.","Regenerate the endpoint via createBrokerEndpoint(sessionDir, 'win32') instead of hand-writing it."],"exampleFix":"// before\nparseBrokerEndpoint('pipe:') // throws\n\n// after\nparseBrokerEndpoint('pipe:\\\\\\\\.\\\\pipe\\\\codex-app-server')","handlingStrategy":"validation","validationCode":"function isValidPipeEndpoint(endpoint) {\n  return typeof endpoint === 'string' &&\n    endpoint.startsWith('pipe:') &&\n    endpoint.slice('pipe:'.length).trim().length > 0;\n}\n// call: if (!isValidPipeEndpoint(endpoint)) regenerate it;","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Generate pipe endpoints only via createBrokerEndpoint on win32.","Ensure sessionDir basenames contain alphanumerics so sanitizePipeName is non-empty.","Never hand-edit the pipe path out of the endpoint string.","Regex-validate pipe endpoints before persisting them."],"tags":["broker","transport","windows","validation"],"backgroundTag":null,"analyzedSha":"db52e28f4d9ded852ab3942cea316258ae4ef346","analyzedAt":"2026-08-13T05:13:20.855Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}