{"record":{"id":"8f5b3d075c8b3f9f","repo":"openai/codex-plugin-cc","slug":"broker-unix-socket-endpoint-is-missing-its-path","errorCode":null,"errorMessage":"Broker Unix socket endpoint is missing its path.","messagePattern":"Broker Unix socket endpoint is missing its path\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"plugins/codex/scripts/lib/broker-endpoint.mjs","lineNumber":35,"sourceCode":"}\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":17,"sourceCodeEnd":42,"githubUrl":"https://github.com/openai/codex-plugin-cc/blob/db52e28f4d9ded852ab3942cea316258ae4ef346/plugins/codex/scripts/lib/broker-endpoint.mjs#L17-L42","documentation":"Thrown by parseBrokerEndpoint when the endpoint starts with 'unix:' but the socket path after the scheme is empty (e.g. 'unix:'). Unix-domain-socket endpoints require an absolute filesystem path to the broker.sock file; a bare 'unix:' names no socket.","triggerScenarios":"Calling parseBrokerEndpoint('unix:') or any 'unix:<whitespace>' value. Arises from a config write where path.join(sessionDir,'broker.sock') returned empty (sessionDir was empty) or a user trimmed the path accidentally.","commonSituations":"Session dir resolved to empty string due to a bad temp-dir calculation. A user manually truncated the endpoint in a config file. Symlink/realpath resolution produced an empty remainder.","solutions":["Supply a full unix socket path: 'unix:/tmp/codex-session/broker.sock'.","Regenerate via createBrokerEndpoint(sessionDir) on non-win32, ensuring sessionDir is a non-empty absolute path.","Sanity-check the endpoint matches /^unix:\\/.+/ before parsing.","Verify the process has permission to create/read the socket at that path."],"exampleFix":"// before\nparseBrokerEndpoint('unix:') // throws\n\n// after\nparseBrokerEndpoint('unix:/tmp/codex-1234/broker.sock')","handlingStrategy":"validation","validationCode":"function isValidUnixEndpoint(endpoint) {\n  return typeof endpoint === 'string' &&\n    endpoint.startsWith('unix:') &&\n    endpoint.slice('unix:'.length).trim().length > 0;\n}\n// call: if (!isValidUnixEndpoint(endpoint)) regenerate via createBrokerEndpoint(sessionDir);","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Always derive unix endpoints from createBrokerEndpoint(sessionDir) on non-win32.","Confirm sessionDir is a non-empty absolute path before joining.","Persist the full 'unix:<path>' string without trimming the path portion.","Validate the endpoint with a regex before parsing."],"tags":["broker","transport","unix","validation"],"backgroundTag":null,"analyzedSha":"db52e28f4d9ded852ab3942cea316258ae4ef346","analyzedAt":"2026-08-13T05:13:20.855Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}