{"record":{"id":"b304c1c7a9f7af41","repo":"BigPizzaV3/CodexPlusPlus","slug":"config-toml-toml-parse-failed-error","errorCode":null,"errorMessage":"config.toml TOML parse failed: {error}","messagePattern":"config\\.toml TOML parse failed: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/plugin_marketplace.rs","lineNumber":732,"sourceCode":"}\n\nfn windows_extended_path(path: &Path) -> String {\n    let value = path.to_string_lossy();\n    if value.starts_with(r\"\\\\?\\\") {\n        value.into_owned()\n    } else {\n        format!(r\"\\\\?\\{value}\")\n    }\n}\n\nfn parse_toml_document(contents: &str) -> anyhow::Result<DocumentMut> {\n    let contents = contents.trim_start_matches('\\u{feff}');\n    if contents.trim().is_empty() {\n        Ok(DocumentMut::new())\n    } else {\n        contents\n            .parse::<DocumentMut>()\n            .map_err(|error| anyhow::anyhow!(\"config.toml TOML parse failed: {error}\"))\n    }\n}\n\nfn table_mut_or_insert<'a>(doc: &'a mut DocumentMut, key: &str) -> anyhow::Result<&'a mut Table> {\n    if !doc.as_table().contains_key(key) {\n        doc[key] = toml_edit::table();\n    }\n    if doc.get(key).and_then(Item::as_table).is_none() {\n        doc[key] = toml_edit::table();\n    }\n    doc.get_mut(key)\n        .and_then(Item::as_table_mut)\n        .ok_or_else(|| anyhow::anyhow!(\"{key} must be a TOML table\"))\n}\n\nfn ensure_trailing_newline(mut contents: String) -> String {\n    if !contents.ends_with('\\n') {\n        contents.push('\\n');","sourceCodeStart":714,"sourceCodeEnd":750,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/plugin_marketplace.rs#L714-L750","documentation":"parse_toml_document strips a BOM, treats blank content as an empty document, and otherwise parses the text as a TOML DocumentMut. This error wraps the toml_edit parse error and fires whenever a marketplace config.toml is syntactically invalid TOML, aborting any config read or rewrite that depends on it.","triggerScenarios":"Thrown at crates/codex-plus-core/src/plugin_marketplace.rs:732 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the TOML syntax error indicated by {error} (line/column info)","Restore the config.toml from a backup or re-create it","Validate the file with a TOML linter before re-running"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}