BigPizzaV3/CodexPlusPlus · error · anyhow::Error

config.toml TOML parse failed

Error message

config.toml TOML parse failed: {error}

What it means

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.

Solutions

  1. Fix the TOML syntax error indicated by {error} (line/column info)
  2. Restore the config.toml from a backup or re-create it
  3. Validate the file with a TOML linter before re-running
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/plugin_marketplace.rs:732 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/b304c1c7a9f7af41. Report an issue: GitHub.

Appendix: source

Thrown at crates/codex-plus-core/src/plugin_marketplace.rs:732

}

fn windows_extended_path(path: &Path) -> String {
    let value = path.to_string_lossy();
    if value.starts_with(r"\\?\") {
        value.into_owned()
    } else {
        format!(r"\\?\{value}")
    }
}

fn parse_toml_document(contents: &str) -> anyhow::Result<DocumentMut> {
    let contents = contents.trim_start_matches('\u{feff}');
    if contents.trim().is_empty() {
        Ok(DocumentMut::new())
    } else {
        contents
            .parse::<DocumentMut>()
            .map_err(|error| anyhow::anyhow!("config.toml TOML parse failed: {error}"))
    }
}

fn table_mut_or_insert<'a>(doc: &'a mut DocumentMut, key: &str) -> anyhow::Result<&'a mut Table> {
    if !doc.as_table().contains_key(key) {
        doc[key] = toml_edit::table();
    }
    if doc.get(key).and_then(Item::as_table).is_none() {
        doc[key] = toml_edit::table();
    }
    doc.get_mut(key)
        .and_then(Item::as_table_mut)
        .ok_or_else(|| anyhow::anyhow!("{key} must be a TOML table"))
}

fn ensure_trailing_newline(mut contents: String) -> String {
    if !contents.ends_with('\n') {
        contents.push('\n');

View on GitHub (pinned to f2074595a2)