openai/codex-plugin-cc · error · Error

Broker pipe endpoint is missing its path.

Error message

Broker pipe endpoint is missing its path.

What it means

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.

Source

Thrown at plugins/codex/scripts/lib/broker-endpoint.mjs:27

export function createBrokerEndpoint(sessionDir, platform = process.platform) {
  if (platform === "win32") {
    const pipeName = sanitizePipeName(`${path.win32.basename(sessionDir)}-codex-app-server`);
    return `pipe:\\\\.\\pipe\\${pipeName}`;
  }

  return `unix:${path.join(sessionDir, "broker.sock")}`;
}

export function parseBrokerEndpoint(endpoint) {
  if (typeof endpoint !== "string" || endpoint.length === 0) {
    throw new Error("Missing broker endpoint.");
  }

  if (endpoint.startsWith("pipe:")) {
    const pipePath = endpoint.slice("pipe:".length);
    if (!pipePath) {
      throw new Error("Broker pipe endpoint is missing its path.");
    }
    return { kind: "pipe", path: pipePath };
  }

  if (endpoint.startsWith("unix:")) {
    const socketPath = endpoint.slice("unix:".length);
    if (!socketPath) {
      throw new Error("Broker Unix socket endpoint is missing its path.");
    }
    return { kind: "unix", path: socketPath };
  }

  throw new Error(`Unsupported broker endpoint: ${endpoint}`);
}

View on GitHub (pinned to db52e28f4d)

Solutions

  1. Provide a complete pipe endpoint: 'pipe:\\.\pipe\my-codex-app-server'.
  2. If generating on Windows, ensure sessionDir basename contains alphanumerics so sanitizePipeName yields a non-empty pipe name.
  3. Validate the endpoint with a regex like /^pipe:\\\\.\\pipe\\.+$/ before calling parseBrokerEndpoint.
  4. Regenerate the endpoint via createBrokerEndpoint(sessionDir, 'win32') instead of hand-writing it.

Example fix

// before
parseBrokerEndpoint('pipe:') // throws

// after
parseBrokerEndpoint('pipe:\\\\.\\pipe\\codex-app-server')
Defensive patterns

Strategy: validation

Validate before calling

function isValidPipeEndpoint(endpoint) {
  return typeof endpoint === 'string' &&
    endpoint.startsWith('pipe:') &&
    endpoint.slice('pipe:'.length).trim().length > 0;
}
// call: if (!isValidPipeEndpoint(endpoint)) regenerate it;

Type guard

null

Try / catch

null

Prevention

When it happens

Trigger: 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.

Common situations: 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\'.

Related errors


AI-assisted analysis of openai/codex-plugin-cc@db52e28f4d (2026-08-13). Data as JSON: /api/errors/e4f2aae9b158814f. Report an issue: GitHub.