{"record":{"id":"3f0180d8aec95cb7","repo":"openai/codex","slug":"project-root-markers-must-be-an-array-of-strings","errorCode":null,"errorMessage":"project_root_markers must be an array of strings","messagePattern":"project_root_markers must be an array of strings","errorType":"validation","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/config/src/project_root_markers.rs","lineNumber":24,"sourceCode":"\n/// Reads `project_root_markers` from a merged `config.toml` [toml::Value].\n///\n/// Invariants:\n/// - If `project_root_markers` is not specified, returns `Ok(None)`.\n/// - If `project_root_markers` is specified, returns `Ok(Some(markers))` where\n///   `markers` is a `Vec<String>` (including `Ok(Some(Vec::new()))` for an\n///   empty array, which indicates that root detection should be disabled).\n/// - Returns an error if `project_root_markers` is specified but is not an\n///   array of strings.\npub fn project_root_markers_from_config(config: &TomlValue) -> io::Result<Option<Vec<String>>> {\n    let Some(table) = config.as_table() else {\n        return Ok(None);\n    };\n    let Some(markers_value) = table.get(\"project_root_markers\") else {\n        return Ok(None);\n    };\n    let TomlValue::Array(entries) = markers_value else {\n        return Err(io::Error::new(\n            io::ErrorKind::InvalidData,\n            \"project_root_markers must be an array of strings\",\n        ));\n    };\n    if entries.is_empty() {\n        return Ok(Some(Vec::new()));\n    }\n    let mut markers = Vec::new();\n    for entry in entries {\n        let Some(marker) = entry.as_str() else {\n            return Err(io::Error::new(\n                io::ErrorKind::InvalidData,\n                \"project_root_markers must be an array of strings\",\n            ));\n        };\n        markers.push(marker.to_string());\n    }\n    Ok(Some(markers))","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/config/src/project_root_markers.rs#L6-L42","documentation":"Error \"project_root_markers must be an array of strings\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/config/src/project_root_markers.rs:24 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set `project_root_markers` to an array of strings in the config."],"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"}