{"record":{"id":"c02f63b065e5e91a","repo":"BigPizzaV3/CodexPlusPlus","slug":"codex-command-is-empty","errorCode":null,"errorMessage":"Codex command is empty","messagePattern":"Codex command is empty","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/launcher.rs","lineNumber":987,"sourceCode":"                command,\n                wait_strategy: ProcessWaitStrategy::ExternalWaitCommand,\n                macos_cleanup_policy: Some(cleanup_policy),\n            });\n        }\n\n        let command = if let Some(inspector_port) = native_menu_inspector_port {\n            build_codex_command_with_native_menu_inspector(\n                app_dir,\n                debug_port,\n                inspector_port,\n                &launch_extra_args,\n            )\n        } else {\n            build_codex_command(app_dir, debug_port, &launch_extra_args)\n        };\n        let executable = command\n            .first()\n            .ok_or_else(|| anyhow::anyhow!(\"Codex command is empty\"))?;\n        let mut child_command = Command::new(executable);\n        child_command\n            .args(&command[1..])\n            .stdout(Stdio::null())\n            .stderr(Stdio::null());\n        #[cfg(windows)]\n        child_command.creation_flags(crate::windows_integration::CREATE_NO_WINDOW);\n        let child = child_command\n            .spawn()\n            .with_context(|| format!(\"failed to launch Codex executable {executable}\"))?;\n        *self.child.lock().await = Some(child);\n        if let Some(inspector_port) = native_menu_inspector_port {\n            start_native_menu_localizer(inspector_port);\n        }\n        Ok(CodexLaunch::Process {\n            command,\n            wait_strategy: ProcessWaitStrategy::TrackedChild,\n            macos_cleanup_policy: None,","sourceCodeStart":969,"sourceCodeEnd":1005,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/launcher.rs#L969-L1005","documentation":"Like the macOS counterpart, launch_codex (non-macOS path) builds the Codex command via build_codex_command and requires a first element as the executable. An empty command vector means the builder produced nothing to run, so the launch fails early with this error.","triggerScenarios":"build_codex_command or the custom-command variant returns an empty Vec — a builder regression or configuration that eliminates the executable token.","commonSituations":"Misconfigured custom codex command; developer-modified builder dropping the executable; empty launch args handling bug.","solutions":["Ensure build_codex_command always begins with the codex executable path","Reset custom launch arguments/command overrides to defaults","Verify the configured Codex CLI path is non-empty in settings"],"exampleFix":"// before\nlet command: Vec<String> = Vec::new();\n// after\nlet mut command = vec![codex_executable.to_string_lossy().into_owned()];\ncommand.extend(extra_args.iter().cloned());","handlingStrategy":"validation","validationCode":"let command = build_codex_command(app_dir, debug_port, &launch_extra_args);\nif command.is_empty() {\n    return Err(\"launcher produced an empty command; report this bug\".into());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add a unit test asserting build_codex_command always includes the executable","Keep the codex executable path non-empty in settings","Guard custom command overrides so they cannot erase the first element"],"tags":["launcher","invariant","process-spawn"],"backgroundTag":"internal-invariant-violation","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}