{"record":{"id":"a606c1a030ec6579","repo":"openai/codex","slug":"missing-required-env-json-flag","errorCode":null,"errorMessage":"missing required {ENV_JSON_FLAG}","messagePattern":"missing required (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/wrapper.rs","lineNumber":301,"sourceCode":"        }\n    }\n\n    let codex_home = codex_home.ok_or_else(|| anyhow!(\"missing required {CODEX_HOME_FLAG}\"))?;\n    if !codex_home.is_absolute() {\n        bail!(\n            \"{CODEX_HOME_FLAG} must be absolute: {}\",\n            codex_home.display()\n        );\n    }\n    let command_cwd = command_cwd.ok_or_else(|| anyhow!(\"missing required {COMMAND_CWD_FLAG}\"))?;\n    if workspace_roots.is_empty() {\n        workspace_roots.push(command_cwd.clone());\n    }\n    Ok(WindowsSandboxWrapperRequest {\n        codex_home,\n        command_cwd,\n        workspace_roots,\n        env_map: env_map.ok_or_else(|| anyhow!(\"missing required {ENV_JSON_FLAG}\"))?,\n        permission_profile: permission_profile\n            .ok_or_else(|| anyhow!(\"missing required {PERMISSION_PROFILE_FLAG}\"))?,\n        windows_sandbox_level: windows_sandbox_level\n            .ok_or_else(|| anyhow!(\"missing required {SANDBOX_LEVEL_FLAG}\"))?,\n        windows_sandbox_private_desktop,\n        proxy_enforced,\n        network_proxy_restricting_sid,\n        proxy_settings_mode,\n        read_roots_override,\n        read_roots_include_platform_defaults,\n        write_roots_override,\n        deny_read_paths_override,\n        deny_write_paths_override,\n        command: command.ok_or_else(|| anyhow!(\"missing sandboxed command separator --\"))?,\n    })\n}\n\nfn next_flag_value(args: &mut impl Iterator<Item = String>, flag: &str) -> Result<String> {","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/wrapper.rs#L283-L319","documentation":"Error \"missing required {ENV_JSON_FLAG}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/wrapper.rs:301 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the required env-json flag with the environment payload for the sandboxed command."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}