openai/codex-plugin-cc · error · Error
Missing required --endpoint.
Error message
Missing required --endpoint.
What it means
After confirming the 'serve' subcommand, the broker parses argv for value options ['cwd','pid-file','endpoint']. If --endpoint is absent or empty, the broker cannot create a listening socket (parseBrokerEndpoint needs it) so it aborts immediately before binding. The endpoint identifies the unix socket path the broker will listen on.
Source
Thrown at plugins/codex/scripts/app-server-broker.mjs:59
if (!pidFile) {
return;
}
fs.mkdirSync(path.dirname(pidFile), { recursive: true });
fs.writeFileSync(pidFile, `${process.pid}\n`, "utf8");
}
async function main() {
const [subcommand, ...argv] = process.argv.slice(2);
if (subcommand !== "serve") {
throw new Error("Usage: node scripts/app-server-broker.mjs serve --endpoint <value> [--cwd <path>] [--pid-file <path>]");
}
const { options } = parseArgs(argv, {
valueOptions: ["cwd", "pid-file", "endpoint"]
});
if (!options.endpoint) {
throw new Error("Missing required --endpoint.");
}
const cwd = options.cwd ? path.resolve(process.cwd(), options.cwd) : process.cwd();
const endpoint = String(options.endpoint);
const listenTarget = parseBrokerEndpoint(endpoint);
const pidFile = options["pid-file"] ? path.resolve(options["pid-file"]) : null;
writePidFile(pidFile);
const appClient = await CodexAppServerClient.connect(cwd, { disableBroker: true });
let activeRequestSocket = null;
let activeStreamSocket = null;
let activeStreamThreadIds = null;
const sockets = new Set();
function clearSocketOwnership(socket) {
if (activeRequestSocket === socket) {
activeRequestSocket = null;
}View on GitHub (pinned to db52e28f4d)
Solutions
- Provide --endpoint with a unix socket path, e.g. --endpoint unix:///tmp/codex-broker.sock.
- Verify the wrapper actually interpolates the endpoint value and does not emit a bare '--endpoint' with nothing after it.
- Check that no upstream quoting strips the value.
Example fix
// before node scripts/app-server-broker.mjs serve // after node scripts/app-server-broker.mjs serve --endpoint unix:///tmp/codex-broker.sock
Defensive patterns
Strategy: validation
Validate before calling
if (!options.endpoint) {
console.error('--endpoint is required');
process.exit(2);
} Prevention
- Always pass --endpoint with a concrete unix socket path.
- Validate the endpoint is non-empty in the launching wrapper before exec.
When it happens
Trigger: Running `serve` without `--endpoint`, or passing `--endpoint` with no value if the arg parser treats it as a flag. Also if the endpoint env var is expected but the script reads only the CLI option (it does not fall back to env here).
Common situations: Operator forgets --endpoint when scripting broker startup, or a wrapper that conditionally sets the endpoint but the condition evaluates empty. Note this script does NOT consult CODEX_COMPANION_APP_SERVER_ENDPOINT env (that env is used by the client side in app-server.mjs).
Related errors
- Usage: node scripts/app-server-broker.mjs serve --endpoint <
- `/codex:review` now maps directly to the built-in reviewer a
- Provide a prompt, a prompt file, piped stdin, or use --resum
- Missing required --job-id for task-worker.
- `status --wait` requires a job id.
AI-assisted analysis of openai/codex-plugin-cc@db52e28f4d (2026-08-13).
Data as JSON: /api/errors/a5d9b44d094e68fb.
Report an issue: GitHub.